Skip to content

Instantly share code, notes, and snippets.

@alishir
Created December 5, 2021 06:20
Show Gist options
  • Save alishir/80fe74b750341d8013b58ca947f372d9 to your computer and use it in GitHub Desktop.
Save alishir/80fe74b750341d8013b58ca947f372d9 to your computer and use it in GitHub Desktop.
Daemonize perl script
#!/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