Skip to content
Fragmented Development

GNUsocial daemons and systemd

After the migration to the new server, my old SysV init script for restarting the queue daemons needed to be updated to systemd.

I have been very skeptical, if not hostile, towards the very concept of systemd. However, creating a GNUsocial service file was very simple, and works remarkably well.

Here is the service file:

[Unit]
Description=gnusocial_daemons
After=network.target mysql.service nginx.service
# Note: we use nginx, so your server may vary

[Service]
User=www-data
Type=forking
# PIDfile directory should match the value in your config.php!
PIDfile=/tmp/queuedaemon.generic.pid
ExecStart=/var/www/example.com/scripts/startdaemons.sh
ExecStop=/var/www/example.com/scripts/stopdaemons.sh

[Install]
WantedBy=multi-user.target

Tags: linux server gnusocial


Add Your Comment