Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: correct content for starting Swish as a service in /etc/systemd/system/swish.service #153

Open
DalekDave opened this issue Jul 13, 2022 · 0 comments

Comments

@DalekDave
Copy link

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! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant