LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-22-2008, 08:02 AM   #1
Ceran
Member
 
Registered: Sep 2006
Posts: 32

Rep: Reputation: 15
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.
 
Old 10-22-2008, 08:04 AM   #2
arckane
Member
 
Registered: Sep 2005
Location: UK
Distribution: Gentoo/Debian/Ubuntu
Posts: 307

Rep: Reputation: 38
add an & to the command line to launch as a background process.
 
Old 10-22-2008, 08:12 AM   #3
Ceran
Member
 
Registered: Sep 2006
Posts: 32

Original Poster
Rep: Reputation: 15
That's the first thing I tried, but it doesn't work. When I logoff, the process is killed.
 
Old 10-22-2008, 09:31 AM   #4
Cazed
LQ Newbie
 
Registered: Aug 2004
Location: Umeň, Sweden
Distribution: Gentoo, Debian
Posts: 10

Rep: Reputation: 0
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
 
Old 10-22-2008, 07:38 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

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

nohup myprog &
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DISCUSSION: Quick and Dirty Backups jeremy LinuxAnswers Discussion 2 03-10-2006 11:56 AM
KDE 3.5 is out! Quick 'n Dirty Upgrade Shade Slackware 19 12-25-2005 05:06 AM
Two Quick and Dirty Ones! gsibble Linux - Newbie 9 08-14-2003 04:40 AM
quick and dirty! Smerk Debian 4 07-03-2003 09:33 PM
what's a quick and dirty way to block spam finegan Linux - General 1 12-03-2001 01:10 AM


All times are GMT -5. The time now is 04:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration