mirror of
https://github.com/hanzomsg/nats-server.git
synced 2026-10-30 20:27:34 +00:00
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.
19 lines
445 B
Desktop File
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
|