Re: Restarting a Perl-script (socket daemon) from /etc/inittab

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 6/2/2011 3:36 PM, Alexander Farber wrote:
> I'll omit fork() and run my script from /etc/inittab as
>
> pref:3:respawn:/bin/su -c '/usr/local/pref/pref.pl' nobody 2>&1>  /tmp/pref.txt
>
> Do you think I still need setsid(); chdir("/"); and umask(0); ?

Not sure about the setsid() -  I think you want to stay in the same 
process group so init catches the sigchld and knows to respawn.  Then 
again, init inherits orphan children to clean up their exit status 
anyway so maybe it doesn't matter.  The rest affect the program behavior 
and should stay the same.

-- 
   Les Mikesell
    lesmikesell@xxxxxxxxx
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux