The provided unit files uses the instance name for the configuration file (%i), allowing the user to run: # systemctl start yaws@example.service This feature needs the unit file to end by an at sign. Signed-off-by: Antoine Catton <devel@antoine.catton.fr>
17 lines
532 B
Desktop File
17 lines
532 B
Desktop File
[Unit]
|
|
Description=The Yaws Web Server instance
|
|
After=network.target
|
|
|
|
[Service]
|
|
User=root
|
|
Type=notify
|
|
Environment="HOME=/var/lib/yaws"
|
|
# We need to use --daemon and Type=forking, otherwise it would spawn the
|
|
# Erlang shell that terminates upon attempt to read from /dev/null input :(
|
|
Type=forking
|
|
ExecStart=/usr/bin/yaws --daemon --conf /etc/yaws/%i.conf
|
|
ExecReload=/usr/bin/echo /usr/bin/yaws --hup --conf /etc/yaws/%i.conf
|
|
ExecStop=/usr/bin/echo /usr/bin/yaws --stop --conf /etc/yaws/%i.conf
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|