Question: correct content for starting Swish as a service in /etc/systemd/system/swish.service
Opened this issue · 0 comments
Hello! Once again, thank you for your work on Swish and SWI-Prolog. :)
I have successfully got Swish installed and running on Ubuntu 20.04. It is exposed via a Nginx virtual host.
All the code is in /var/www/swish and the /var/www/swish tree structure is chown'ed to www-data:www-data
I started Swish as a service manually via the command (run as root):
cd /var/www/swish/ && sudo -u www-data swipl /var/www/swish/daemon.pl --port=4832 --ip=localhost
Now I want to start it as a systemd service at boot time.
I created /etc/systemd/system/swish.service and inserted the following content:
[Unit]
Description=Swish powered by SWI-Prolog
After=network.target
[Service]
Type=simple
User=www-data
Group=www-data
SyslogIdentifier=swish
WorkingDirectory=/var/www/swish/
ExecStart=/usr/bin/swipl /var/www/swish/daemon.pl --port=4832 --ip=localhost
Restart=always
[Install]
WantedBy=multi-user.target
But the service is failing to restart after a reboot, and I have to start Swish manually via the previously-mentioned command.
Would you have any suggestions as to what went wrong at service startup during boot, and what the corrections would be, please?
Thanking you if so! :)
And thank you again for your work on Swish and SWI-Prolog! :)