LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 07: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, 07:04 AM   #2
arckane
Member
 
Registered: Sep 2005
Location: UK
Distribution: Gentoo/Debian/Ubuntu
Posts: 308

Rep: Reputation: 39
add an & to the command line to launch as a background process.
 
Old 10-22-2008, 07: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, 08: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, 06:38 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,369

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

nohup myprog &
 
  


Reply



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 10:56 AM
KDE 3.5 is out! Quick 'n Dirty Upgrade Shade Slackware 19 12-25-2005 04:06 AM
Two Quick and Dirty Ones! gsibble Linux - Newbie 9 08-14-2003 03:40 AM
quick and dirty! Smerk Debian 4 07-03-2003 08:33 PM
what's a quick and dirty way to block spam finegan Linux - General 1 12-03-2001 12:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:31 AM.

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
Open Source Consulting | Domain Registration