Original question:
Dear SMs,
How can I nohup a process that is already running?
ie.
# ./remotebackup
^Z[1] + Stopped (SIGTSTP) ./remotebackup
# bg
[1] ./remotebackup&
#
Now I want to nohup the process which would allow me to log off.
Something like 'nohup -p <pid>' would be great.
Thanks
Answer:
It can't be done. Once a process has been kicked of without the nohup
there is no way to nohup it while it is running.
"You can't. Once a process is started, its response to signals
like 'hangup' cannot be changed externally.
The way 'nohup' works is by using 'sigvec' or 'signal' to ignore
'hangup'
and 'quit' signals. Then when it spawns the desired child process,
that
child inherits its signal response behavior from its parent, so if
the
parent ignores 'hangup' or 'quit', then the child will too.
Once the child has started, its signal-handling is set, and no
outside
process can change it. Only the child process itself can change its
own
signal-handling."
- Michael J. Maciolek
Nohupped process utility:
We do have an
inhouse process called psh which allows one to put a process in
background,
exit the login then at a later time attach the running process so
that output is directed to the new login screen (Solaris 2.x).
The binary has to be compiled with a local library, however so system
utilities are out."
- W. Frank Lowe frank@darwin.sfbr.org
Thanks to *
This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:11:44 CDT