Created
December 5, 2021 06:20
-
-
Save alishir/80fe74b750341d8013b58ca947f372d9 to your computer and use it in GitHub Desktop.
Daemonize perl script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# https://newbedev.com/how-can-i-run-a-perl-script-as-a-system-daemon-in-linux | |
# apt-get install libproc-daemon-perl | |
use strict; | |
use warnings; | |
use Proc::Daemon; | |
Proc::Daemon::Init; | |
my $continue = 1; | |
$SIG{TERM} = sub { $continue = 0 }; | |
while ($continue) { | |
#do stuff | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment