I copied this systemd
service
file from the lighttpd-package
and adapted it to make systemd
start the mojolicious built-in server daemon.
Can I keep the ExecReload
and the KillSignal
setting for the mojolicious daemon?
[Unit]
Description=Start mojolicious.pl daemon
After=syslog.target network.target
[Service]
ExecStart=/path/to/mojolicious.pl daemon --listen "http://*:3001"
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGINT
[Install]
WantedBy=multi-user.target
I think Alex is thinking of morbo
when he says it auto-reloads. For production you'd be better using hypnotoad
. If you do switch to hypnotoad
then there are various signals that will be useful. For example /bin/kill -USR2 $MAINPID
will do a graceful reload, avoiding upset to any current connections. For more signals (for hypnotoad) see http://mojolicio.us/perldoc/Mojo/Server/Hypnotoad#SIGNALS
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With