Created
October 12, 2018 13:44
-
-
Save jjn1056/4ebf5d13b29c4916dbb757e4304b369a to your computer and use it in GitHub Desktop.
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
jjn@ip-172-31-48-121:~$ cat /usr/local/bin/retreatcenter-fcgi-daemon | |
#!/var/www/perl5.26.2/bin/perl | |
use warnings; | |
use strict; | |
use lib '/var/www/cpan-lib/lib/perl5'; | |
use Daemon::Control; | |
my $app_home = '/var/www/src'; | |
my $name = 'retreatcenter'; | |
my $perl = '/var/www/cpan-lib/bin/localenv /var/www/perl5.26.2/bin/perl'; | |
my $program = $app_home . "/script/${name}_fastcgi.pl"; | |
my $pid_file = "/var/run/$name-fcgi.pid"; | |
my $socket = "/tmp/$name-fcgi.socket"; | |
my $workers = 5; | |
my $logpath = '/var/log/Reg'; | |
my $envvars = 'PATH=/var/www/perl5.26.2/bin DBI_DSN="dbi:mysql:reg2"'; | |
Daemon::Control->new({ | |
name => $name, | |
lsb_start => '$nginx', | |
lsb_stop => '$nginx', | |
lsb_sdesc => $name, | |
lsb_desc => $name, | |
path => "/usr/local/bin/$name-fcgi-daemon", | |
user => 'www-data', | |
#group => 'www-data', | |
directory => $app_home, | |
program => qq[$envvars $perl $program --nproc $workers --listen $socket], | |
pid_file => $pid_file, | |
stderr_file => "$logpath/$name-stderr.log", | |
stdout_file => "$logpath/$name-stdout.log", | |
fork => 2, | |
})->run; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment