Weird nohup issues

  • Follow


Hello all

I made a simple script that I want to run on a sun box, I dont have
root privelleges, and for some odd reason my crontab file is owned by
root, so i cant VI it directly, but if i use crontab -e I can edit it.
When I put this script into cron, it will not execute though, it keeps
giving me an execute permission denied, half of the script works, where
it >> the date to a log file, but the actually command to execute does
not go off...

I tried just running it through telnet and using nohup myscript &

It runs, but it does not come back to the command prompt, it sits and
waits until I hit enter, then it terminates...


any ideas why this is going on?

Is it possible im not allowed to use nohup?

0
Reply TheSoulCrusher (16) 8/24/2006 3:13:31 AM

thesoulcrusher <TheSoulCrusher@gmail.com> wrote:
> Hello all
> 
> I made a simple script that I want to run on a sun box, I dont have
> root privelleges, and for some odd reason my crontab file is owned by
> root, so i cant VI it directly, but if i use crontab -e I can edit it.

You're not supposed to edit crontab files. Always use crontab -e, on pretty
much any unix.

> When I put this script into cron, it will not execute though, it keeps
> giving me an execute permission denied, half of the script works, where
> it >> the date to a log file, but the actually command to execute does
> not go off...

Did you define the required paths or environment inside your script? Cron
usuall runs with really stripped down paths and this will make lots of
poorly written scripts fail, even if they work ok from an interactive shell.


> I tried just running it through telnet and using nohup myscript &
> 
> It runs, but it does not come back to the command prompt, it sits and
> waits until I hit enter, then it terminates...

that's normal. & puts a process in the background. you will be alerted that
the process has completed when you start to type at your terminal again.

> any ideas why this is going on?

What exactly is the problem you're having? 
 
> Is it possible im not allowed to use nohup?

probably not.
0
Reply Cydrome 8/24/2006 5:35:48 AM


thesoulcrusher wrote:
> I made a simple script that I want to run on a sun box, I dont have
> root privelleges, and for some odd reason my crontab file is owned by
> root, so i cant VI it directly,

Yes, that's because cron owns it and cron runs as root, which is
pretty much necessary so it can switch uids to the various users
that it needs to run jobs for.

> but if i use crontab -e I can edit it.

Yeah, that's because that is the proper interface.

> When I put this script into cron, it will not execute though, it keeps
> giving me an execute permission denied, half of the script works, where
> it >> the date to a log file, but the actually command to execute does
> not go off...

Sounds like a problem with some of the commands in the script.  The
script itself is getting started fine, it would appear, since some of
the commands within the script run.

> I tried just running it through telnet and using nohup myscript &
> 
> It runs, but it does not come back to the command prompt, it sits and
> waits until I hit enter, then it terminates...

Try doing "nohup sleep 30 &".  That should run for about 30 seconds
before it terminates.  If so, then it indicates there is nothing
wrong with "nohup" and instead there is a problem with the script
that you're trying to run.


Anyway, what are you actually trying to accomplish?  Are you trying
to run a script periodically, or are you trying to run it just
occasionally when you need it?  If the latter, you might look at
the batch command, as in:

	echo sleep 30 | batch

If the former, then "crontab -e" is really what you want.

You might want to post what line of the script is failing, what it
is doing, and what you expected it to do.

   - Logan
0
Reply Logan 8/24/2006 6:48:40 AM

2 Replies
481 Views

(page loaded in 0.056 seconds)

Similiar Articles:







7/22/2012 1:19:34 AM


Reply: