Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
What I can't figure out is, why it won't die. I've even used die "blah"; after the last else conditional. I've put exit; everywhere I can think of. I've even defined subroutines for each function after the if does its magik.
Any ideas about what I could do to make this thing die?
I'm sure once cron finishes its work, it would kill the remaining process, but I just want to make sure it exits cleanly.
#!/usr/bin/perl -wT use strict; $ENV{PATH} = '/bin:/usr/bin:/usr/bin/X11:/usr/local/bin:/usr/bin:/usr/X11R6/bin'; my $ircd = `ps -u me | grep ircd`; my $services = `ps -u me | grep wrecked`; if ($ircd) { print "Ircd is up!\n"; } else { print "Starting Ircd......\n"; `sudo -u dsirc /home/me/Unreal3.1.4/src/ircd`; } if ($services) { print "Services are up!\n"; } else { print "Starting Services......\n"; `sudo -u dsirc /home/me/services/wrecked`; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why won't it die??
by Aristotle (Chancellor) on Aug 22, 2002 at 02:30 UTC | |
by Anonymous Monk on Aug 22, 2002 at 03:12 UTC | |
by Aristotle (Chancellor) on Aug 22, 2002 at 03:32 UTC | |
|
Re: Why won't it die??
by Bobcat (Scribe) on Aug 22, 2002 at 03:05 UTC | |
by Anonymous Monk on Aug 22, 2002 at 03:15 UTC | |
by Bobcat (Scribe) on Aug 22, 2002 at 03:27 UTC | |
|
Re: Why won't it die??
by graff (Chancellor) on Aug 22, 2002 at 03:15 UTC | |
by Anonymous Monk on Aug 22, 2002 at 03:26 UTC |