Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Creating a pidfile for mojolicious is giving an error errors

by newperldeveloper (Sexton)
on Nov 06, 2020 at 00:47 UTC ( #11123442=perlquestion: print w/replies, xml ) Need Help??

newperldeveloper has asked for the wisdom of the Perl Monks concerning the following question:

I am starting my application using a service file. I am trying to create a pid file that mojolicious needs, however what I have tried is not working. Here is my service file.

[Unit] Description=Perl App [Service] Type=forking User=www-data Group=www-data Environment=movielog=/tmp/movie-app/movie.log UMask=007 ExecStart=/webapp/movie-app/local/bin/hypnotoad /webapp/movie-app/scri +pt/movie ExecReload=/webapp/movie-app/local/bin/hypnotoad /webapp/movie-app/scr +ipt/obdaac ExecStop=/webapp/movie-app/local/bin/hypnotoad --stop /webapp/movie-ap +p/script/obdaac TimeoutStopSec=5 PIDFile=/tmp/movie-app/ KillMode=mixed [Install]

My hypnotoad file looks like

#!/usr/bin/perl use Mojo::Base -strict; use Mojo::Server::Hypnotoad; use Mojo::Util qw(extract_usage getopt); getopt 'f|foreground' => \$ENV{HYPNOTOAD_FOREGROUND}, 'h|help' => \my $help, 's|stop' => \$ENV{HYPNOTOAD_STOP}, 't|test' => \$ENV{HYPNOTOAD_TEST}; die extract_usage if $help || !(my $app = shift || $ENV{HYPNOTOAD_APP} +); Mojo::Server::Hypnotoad->new->run($app,pid_file => '/tmp/movie-app/hyp');

Perl keeps trying to create the pid file in the application directory /webapp/movie-app/script/movie and that is causing an error. How do I get hypnotoad to create the pid file in the /tmp/movie-app/ location.

Replies are listed 'Best First'.
Re: Creating a pidfile for mojolicious is giving an error errors
by beech (Parson) on Nov 06, 2020 at 03:44 UTC
      Thank you for your help, I added pid_file to the config. I am not to really familiar with mojolicious.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://11123442]
Approved by GrandFather
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2021-05-14 17:16 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (150 votes). Check out past polls.