Pls help me setup environment to let back ground job running w/o keep my
terminal session open by using 'nohup'.
Thanks in advance
Thanks in advance
Thanks anyway
> nohup backgroundjob &
wZ> This only submit the background jobs. If you exit the terminal
wZ> session the background will exit also.
Since when? 'nohup foo &' will run the command foo to completion,
even if the controlling terminal hangs up (hence the term 'nohup').
You might want to also redirect I/O to disk, e.g. 'nohup foo 2>&1 >
foo.out &' (dunno if I got the redirection right, look it up in the
manpage to be certain).
But nohup *does* work as advertised, and on a lot more systems than
just NetBSD (e.g. Linux, Solaris, NeXTstep).
--
Rev. Dr. Xenophon Fenderson, the Carbon(d)ated, KSC, DEATH, SubGenius, mhm21x16
Pope, Patron Saint of All Things Plastic fnord, and Salted Litter of r.g.s.b
"When I was a kid, I used to think that Dammit was God's last name, just like
Christ is Jesus' last name." - Kimberly Chapman in rec.humor.oracle.d
Alternatively you can use the "disown" command if you switch shell to
zsh. I've also seen the command "detach".
Yet another alternativ .. if you are running interactive terminal
programs, you might have a peek at screen(1). Anyway, many BOFHs kill
or disable screen. At NetBSD, I've seen the computer running out of
ttyps disallowing logins due to too many screen processes.
Be sure always to use nice(1) when running processes overnight, it
decreases the risk of your processes getting killed by a BOFH.
--
TobiX In a world without fences, who needs gates?
http://www.td.org.uit.no/~tobias/
I experienced this scenario on different HP-UX and SVR4 machines but not all. I
asked the Unix admin and they know nothing about it.
> wZ> This only submit the background jobs. If you exit the terminal
> wZ> session the background will exit also.
> Since when? 'nohup foo &' will run the command foo to completion,
> even if the controlling terminal hangs up (hence the term 'nohup').
> You might want to also redirect I/O to disk, e.g. 'nohup foo 2>&1 >
> foo.out &' (dunno if I got the redirection right, look it up in the
> manpage to be certain).
> But nohup *does* work as advertised, and on a lot more systems than
> just NetBSD (e.g. Linux, Solaris, NeXTstep).
> --
> Rev. Dr. Xenophon Fenderson, the Carbon(d)ated, KSC, DEATH, SubGenius, mhm21x16
> Pope, Patron Saint of All Things Plastic fnord, and Salted Litter of r.g.s.b
> "When I was a kid, I used to think that Dammit was God's last name, just like
> Christ is Jesus' last name." - Kimberly Chapman in rec.humor.oracle.d
I experienced this scenario on different HP-UX and SVR4 machines but not all. I
asked the Unix admin and they know nothing about it.
> wZ> This only submit the background jobs. If you exit the terminal
> wZ> session the background will exit also.
> Since when? 'nohup foo &' will run the command foo to completion,
> even if the controlling terminal hangs up (hence the term 'nohup').
> You might want to also redirect I/O to disk, e.g. 'nohup foo 2>&1 >
> foo.out &' (dunno if I got the redirection right, look it up in the
> manpage to be certain).
> But nohup *does* work as advertised, and on a lot more systems than
> just NetBSD (e.g. Linux, Solaris, NeXTstep).
> --
> Rev. Dr. Xenophon Fenderson, the Carbon(d)ated, KSC, DEATH, SubGenius, mhm21x16
> Pope, Patron Saint of All Things Plastic fnord, and Salted Litter of r.g.s.b
> "When I was a kid, I used to think that Dammit was God's last name, just like
> Christ is Jesus' last name." - Kimberly Chapman in rec.humor.oracle.d
Check if the "detach" command exists.
Check if they have zsh, try this (just paste all below into the
shell):
zsh
{ sleep 60 ; touch /tmp/mytst } &
disown %1
exit
ls -al /tmp/mytst
sleep 61
ls -al /tmp/mytst
If this works, /tmp/mytst should be created while sleeping - so
exiting the shell doesn't kill the process. But perhaps they kill all
your processes upon logout? Try this:
zsh
{ sleep 60 ; touch /tmp/mytst } &
disown %1
exit
ls -al /tmp/mytst
exit
(log in once more)
ls -al /tmp/mytst
(check if the file is updated)
Try to log in twice (i.e. in two windows). In one window, you run top
or ps or something, to scan your processes. Try something like this in
the other window:
echo <<EOF>tst.c
#include <unistd.c>
int main() {
if (fork()) return 0;
sleep(190); /* Something more fancy might be done here */
EOFQuote:}
And, once more, if you are running at a (more or less) public server,
and you start CPU-eaters without running them at the lowest priority,
you should expect them to be removed by the sysadmin (if there are
more admins or evil admins or they have scripts killing background
processes, they might seem unaware of it).
--
TobiX In a world without fences, who needs gates?
http://www.td.org.uit.no/~tobias/
1. Use 'nohup' w/o keeping my session open
Pls help me setup environment to let back ground job running w/o keep my
terminal session open by using 'nohup'.
Thanks in advance
2. How to make a shared library under AIX 4.1.4?
4. (no subject)
5. Can't 'Open With...' HTML Konq file manager using Opera 6 beta 1
6. How do you recreate a boot disk if...
7. nohup xterm doesn't nohup -- why?
8. ****Finally, A Windows Telnet Daemon!***
9. Where is 'nodename' & 'hostname' kept
10. about remove 'LF' but keep 'CR/LF'
12. X won't start: can't open default font 'fixed'
13. nohup does not work with 'make' on SuSE 7.1