General discussion

Locked

Background Process closes on logout

By Peter Marshall ·
We use a servlet engine on a Solaris box for our applications (ServletExec 3.1 from New Atlanta)
It is started by the application user from the command line
$ ./StartServletExec &
When that user logs out of the shell either by using exit or ^D amessage is displayed stating that there are background jobs running. We then execute either exit or ^D again to exit the shell.
As another user we execute ps -ef |grep java and we can see that the background process is nolonger running.
If ServeletExec is executed by root then the process will continue on logout.
I am after ways to ensure that the background process continues when the user is logged out when it is not started by root.

Thanks
Peter

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Background Process closes on logout

by edward In reply to Background Process closes ...

Hello,
I believe that command "nohup" will help you to do the job. You just run "/usr/bin/nohup <command> & " and this makes your command running immune to hangups. It does so arranging for the SIGHUP signal to be ignoring by the process, so when user exits the shell, this signal won't interrupt your process running. Note though that SIGTERM signal will terminate the process regardless of running it with nohup.
Hope that helps

Collapse -

Background Process closes on logout

by Shanghai Sam In reply to Background Process closes ...

Thanks to both of you for your input. Both solutions worked.

I have adopted the answer given by Edward as it is easier to put in a script that the developers are able to run. at jobs might be just a bit beyond them.

Thanks again for the assistance

Peter

Collapse -

Background Process closes on logout

by Skizz In reply to Background Process closes ...

Another way of doing it is with "at"

eg.
# at now
StartServletExec
^D
#

Collapse -

Background Process closes on logout

by Shanghai Sam In reply to Background Process closes ...

Thanks to both of you for your input. Both solutions worked.

I have adopted the answer given by Edward as it is easier to put in a script that the developers are able to run. at jobs might be just a bit beyond them.

Thanks again for the assistance

Peter

Collapse -

Background Process closes on logout

by Peter Marshall In reply to Background Process closes ...

This question was closed by the author

Back to Linux Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums