Comment and format the systemd unit to make it more readable

This commit is contained in:
mtrossevin 2021-11-22 11:18:07 +01:00
parent 4d39a0f357
commit 8cb818ea0a

View file

@ -168,18 +168,27 @@ On peut activer une unité [systemd](HowtoSystemd) pour faire tourner un service
Par exemple, via `/etc/systemd/system/jdoe.js.service` :
~~~
~~~ { .ini }
[Unit]
Description=Example.com
[Service]
# Run the service as user jdoe and group jdoe
User=jdoe
Group=jdoe
WorkingDirectory=/home/jdoe/www
# A script that start the application, should NOT fork and exit (because of the service type being simple).
# (forking and waiting for the node process to die is OK but exec() or equivalent is generally better)
ExecStart=/home/jdoe/www/start
# Restart if the process die or if it is killed by something else than systemd
Restart=always
# For logging
StandardOutput=/home/jdoe/log/nodejs-access.log
StandardError=/home/jdoe/log/nodejs-error.log
SyslogIdentifier=example.com
User=jdoe
Group=jdoe
# Allow many incoming connections
LimitNOFILE=infinity