LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Quick and Dirty Daemon (https://www.linuxquestions.org/questions/linux-newbie-8/quick-and-dirty-daemon-678284/)

Ceran 10-22-2008 07:02 AM

Quick and Dirty Daemon
 
What's a quick and dirty way to launch a daemon process so that it keeps running even if the user that launched it logs off? I don't need anything fancy, like the standard start/stop/restart init scripts for the standard daemons.

arckane 10-22-2008 07:04 AM

add an & to the command line to launch as a background process.

Ceran 10-22-2008 07:12 AM

That's the first thing I tried, but it doesn't work. When I logoff, the process is killed.

Cazed 10-22-2008 08:31 AM

I'm not sure of this but it should work:

1. start the app with an appended & to send it to the background
2. run the command "jobs" to get the jobnumber of the started app.
3. run the command "disown jobnumber" to detach it from the shell completely.

/Åke

chrism01 10-22-2008 06:38 PM

You need the nohup cmd to disconnect it from the terminal, as well as & thus:

nohup myprog &


All times are GMT -5. The time now is 12:04 AM.