However, just wanted to know is there any way to write the nohup logic directly into the script so that we can execute the script without need to specify the nohup like this:
This might do what you want:
Save it in a file, source that in any script you want to ignore SIGHUP in, call the mynohup function (or whatever you want to call it) once, and you're good to go. Tested with ksh and bash, and modeled after the nohup shipped with the GNU coreutils.
This might do what you want:
Save it in a file, source that in any script you want to ignore SIGHUP in, call the mynohup function (or whatever you want to call it) once, and you're good to go. Tested with ksh and bash, and modeled after the nohup shipped with the GNU coreutils.
I found this thing very useful. Thanks for the info.
just one query, is there any side effects if someone executes the script explicitly with nohup having this logic inside the script.
Haven't explicitly tested it, but there shouldn't. After all, the external nohup utility should make sure that the default FDs aren't connected to a terminal anymore, and that SIGHUP is ignored.
i have just tried but i think its not working with external nohup command alongwith.
when I run this, normally (without external nohup) its working fine and the stdout has been appending in the nohup.out as expected.
but when I run this with,
nothing happens. nohup.out file is zero size.
Is there any way ( some checks ) so that we can detect the external nohup and ignore anyone of that (external or internal). so that it works in all cases..
or any other solution to make it generic.
the reason for asking this is even if I put the logic inside the script and some people may unaware of that and may execute the script with external nohup.
Shell : bash
OS : Oracle Linux 6.4
I want to save the ouput of a nohup command to file other than nohup.out . Below are my 3 attempts.
For both Attempt1 and Attempt2 , the redirection logs the output correctly to the output file. But I get the error "ignoring input and redirecting stderr to... (7 Replies)
when I use the on-board modem.........and I dial in I get the login prompt
when I enter id and password it gives..........invalid login....
i hv sun fire 280R system
pls help me urgently........i m frustated
thx
girish (3 Replies)