Files
nats-server/util/nats-server.service
Phil Pennock 4a61421d2b systemd service files: use correct special target
Per systemd.special(7) and
<https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/> the target
we want for ordering starting up the nats server is `network-online`, not
`network`.

We want to be able to listen for incoming connections, and possibly connect
outwards for setting up routes or connecting to external account resolvers.

Without this change, nats server start-up is subject to system-dependent
race-conditions for working networking.
2023-10-18 12:02:18 -04:00

19 lines
445 B
Desktop File

[Unit]
Description=NATS Server
After=network-online.target ntp.service
[Service]
PrivateTmp=true
Type=simple
ExecStart=/usr/sbin/nats-server -c /etc/nats-server.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s SIGINT $MAINPID
User=nats
Group=nats
# The nats-server uses SIGUSR2 to trigger using Lame Duck Mode (LDM) shutdown
KillSignal=SIGUSR2
# You might want to adjust TimeoutStopSec too.
[Install]
WantedBy=multi-user.target