6 Replies - 18145 Views - Last Post: 26 February 2013 - 07:01 AM

#1 g37752   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 195
  • Joined: 24-July 12

nohup shell script permission denied? run process after logout?

Posted 24 February 2013 - 03:35 PM

myscript.sh:

#!/bin/sh
/usr/bin/php /home/mysite/public_html/getresult.php


path of myscript.sh added to PATH (seen in echo $PATH)

chmod u+x myscript.sh
nohup myscript.sh &


ignoring input and appending output to nohup.out
nohup: failed to run command 'myscript.sh' permission denied?

i tried
nohup php /home/mysite/public_html/getresult.php &

but i dont get my prompt back?

i tried
php /home/mysite/public_html/getresult.php
control Z
disown -h %[1]
bg 1
exit (to root)
ps ua (shows process running)
exit (getty)


log back in, ps ua: not running?

Is This A Good Question/Topic? 0
  • +

Replies To: nohup shell script permission denied? run process after logout?

#2 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6839
  • View blog
  • Posts: 31,520
  • Joined: 10-May 07

Re: nohup shell script permission denied? run process after logout?

Posted 24 February 2013 - 04:01 PM

What does dmesg show for the process? Also I would open a 2nd terminal & tail /var/log/messages. See if the OS is tripping on something.
Was This Post Helpful? 0
  • +
  • -

#3 g37752   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 195
  • Joined: 24-July 12

Re: nohup shell script permission denied? run process after logout?

Posted 24 February 2013 - 04:56 PM

View Postno2pencil, on 24 February 2013 - 04:01 PM, said:

What does dmesg show for the process? Also I would open a 2nd terminal & tail /var/log/messages. See if the OS is tripping on something.


tail /var/log/messages show no new messages since 12 hours ago.

dmesg returns nothing?

btw, my OS is centOS 6.3
Was This Post Helpful? 0
  • +
  • -

#4 g37752   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 195
  • Joined: 24-July 12

Re: nohup shell script permission denied? run process after logout?

Posted 24 February 2013 - 09:05 PM

how do i know if the process is running in the background?

jobs returns nothing
ps ua does not show my process running
top does not show my process running

HOWEVER, files are being produced by my php program at the expected times??

This post has been edited by g37752: 24 February 2013 - 09:06 PM

Was This Post Helpful? 0
  • +
  • -

#5 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6839
  • View blog
  • Posts: 31,520
  • Joined: 10-May 07

Re: nohup shell script permission denied? run process after logout?

Posted 24 February 2013 - 09:29 PM

I always use ps aux when looking for currently running processes.
Was This Post Helpful? 1
  • +
  • -

#6 g37752   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 195
  • Joined: 24-July 12

Re: nohup shell script permission denied? run process after logout?

Posted 25 February 2013 - 07:20 PM

is there any default linux settings that will terminate an infinite loop?

i did:
php /home/mysite/public_html/getresult.php
control Z
disown -h %[1]
bg 1
exit (to root)
ps ua (shows process running)
exit (getty)


logged out and back in,
ps aux | grep php

shows program running.

the next day, i login and the process is not running anymore?
Was This Post Helpful? 0
  • +
  • -

#7 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6839
  • View blog
  • Posts: 31,520
  • Joined: 10-May 07

Re: nohup shell script permission denied? run process after logout?

Posted 26 February 2013 - 07:01 AM

No there isn't. Log your results & see where it is bailing.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1