[CentOS] Restarting a Perl-script (socket daemon) from /etc/inittab
Les Mikesell
lesmikesell at gmail.comThu Jun 2 20:50:24 UTC 2011
- Previous message: [CentOS] Restarting a Perl-script (socket daemon) from /etc/inittab
- Next message: [CentOS] Restarting a Perl-script (socket daemon) from /etc/inittab
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 at gmail.com
- Previous message: [CentOS] Restarting a Perl-script (socket daemon) from /etc/inittab
- Next message: [CentOS] Restarting a Perl-script (socket daemon) from /etc/inittab
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list