Skip to content
scil edited this page Aug 12, 2018 · 5 revisions

suppose a laravel project is located /www/NAME

ensure this in /www/NAME/fly.conf.php

'daemonize' => false,

create a file named like /etc/systemd/system/laravelfly_NAME.service

[Unit]
Description=laravelfly NAME
After=network.target,syslog.target

[Service]
ExecStart=/usr/bin/php vendor/scil/laravel-fly/bin/fly start fly.conf.php
ExecReload=/bin/kill -USR1 $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID

Type=simple

User=root
Group=root
WorkingDirectory=/www/NAME
PIDFile=/www/NAME/bootstrap/laravel-fly-9501.pid
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target graphical.target

After that

sudo systemctl --system daemon-reload

# auto start 
sudo systemctl enable laravelfly_NAME

sudo systemctl start  laravelfly_NAME

sudo systemctl status laravelfly_NAME

sudo systemctl reload laravelfly_NAME

sudo systemctl stop   laravelfly_NAME