faqts

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

30 of 33 people (91%) answered Yes
Recently 9 of 10 people (90%) answered Yes

Entry

How do I background something in bash over openssh and still be able to logout?
How can I make a script act like a daemon?
How can I completely detach a process so it is owned only by init?

May 12th, 2008 21:12
i can do it, Joe Pike, Simon Ryan, http://www.snailbook.com/faq/background-jobs.auto.html


The trick is to redirect ALL streams. The one that people typically forget
is the STDIN stream:
   progname </dev/null >&/dev/null &
http://www.jaipursilverjewellery.com
http://www.jaipurhandicrafts.com
http://www.123indiansilverjewellery.com
http://www.indianexporterdirectory.com
But! The process group still remains set to that of the original parent
If this causes problems such as where the original parent is killed as
the child shuts down then you need to do a setpgrp() if you are writing
the code, or you can also do it as follows:
  setsid progname </dev/null >&/dev/null
http://www.stupidarticles.com
http://www.halazona.com
http://www.shikapika.com
http://www.stakoza.com
http://www.uploadarticles.com
http://www.ganazat.com
http://www.damima.com
http://www.tarabiza.com
http://www.articlesxarticles.com
http://www.articlesfreedirectory.com