- or download this
$ ./script.pl start
started script.pl daemon at PID 30216
- or download this
$ ./script.pl status
script.pl is running at PID 30216
$ ps ax | grep 30216
30216 pts/4 S 0:00 perl script.pl perform
- or download this
$ telnet localhost 6669
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
- or download this
blah
received: blah
- or download this
$ ./script.pl status
script.pl is running at PID 30216
$ ps ax | grep 30216
30216 pts/4 S 0:00 perl script.pl perform
- or download this
$ ./script.pl stop
stopped script.pl PID 30216
- or download this
$ ./script.pl status
script.pl is not running
$ ps ax | grep 30216
- or download this
#!/usr/bin/perl
use warnings;
...
}
return $pid;
}