home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Telecom
/
1996-04-telecom-walnutcreek.iso
/
technical
/
ixo.program.scripts
/
startdaemon
< prev
next >
Wrap
Text File
|
1993-02-14
|
595b
|
30 lines
#! /usr/local/bin/perl4.019
# "start daemon" -- Start the tpaged daemon if it isn't running.
# by Tom Limoncelli, tal@warren.mentorg.com
# Copyright (c) 1992, Tom Limoncelli
$BSD = -f '/vmunix';
$pscmd = $BSD ? "ps -auxww" : "ps -ef";
open(PS, "$pscmd|") || die "Can't run ps: !$";
$title = <PS>;
$found = 0;
while (<PS>) {
chop;
$found = 1 if /tpaged/;
}
if (!$found) {
unless (fork) { # this is the child
unless (fork) { # this is the child's child
sleep 1 until getppid == 1;
system "/home/adm/lib/tpage/tpaged &";
exit 0;
}
exit 0;
}
print "Started tpaged\n";
}