Créer un service sur systemd

Written by admin on August 30, 2016 Categories: Linux, Service Tags: , ,

Dans /lib/systemd/system, créer un fichier myservice.service

Exemple:

[Unit]
Description=uWSGI instance

[Service]
User=www-data
Group=www-data
ExecStartPre=-/bin/bash -c 'mkdir -p /run/uwsgi; chown www-data:www-data /run/uwsgi'
ExecStart=/bin/bash -c 'cd /home/app; uwsgi --uwsgi-socket app.sock --chmod-socket=660 --module wsgi:application --master --die-on-term --manage-script-name --processes 5 --mount /app=app:application --logto /var/log/uwsgi/app.log'

[Install]
WantedBy=multi-user.target

Puis

systemctl daemon-reload
systemctl enable myservice.service

 

No Comments on Créer un service sur systemd

Leave a Reply

Your email address will not be published. Required fields are marked *