Various improvements to the systemd unit

- Use the Journal to log stdout/stderr
- Drop DefaultInstance, it doesn't do anything in non-template units
- Add sysusers config to manage the direwolf user automatically
This commit is contained in:
Davide Cavalca 2025-04-09 09:38:41 -07:00
parent 5736b0f601
commit e99d2c0c92
3 changed files with 5 additions and 16 deletions

View File

@ -1,15 +1,3 @@
/var/log/direwolf/stdout /var/log/direwolf/stderr {
missingok
rotate 30
daily
copytruncate
notifempty
compress
delaycompress
dateext
dateyesterday
}
/var/log/direwolf/*.log {
missingok
daily

View File

@ -12,16 +12,13 @@ User=direwolf
# doing so. Then run systemctl daemon-reload so systemd uses your updated
# copy of this service file.
#ExecStartPre=/some/script.sh
ExecStart=/bin/bash -ce "exec /usr/bin/direwolf $DIREWOLF_ARGS >>/var/log/direwolf/stdout 2>>/var/log/direwolf/stderr"
ExecStart=/usr/bin/direwolf $DIREWOLF_ARGS
Restart=always
StandardOutput=null
StandardError=null
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/var/log/direwolf
[Install]
WantedBy=multi-user.target
DefaultInstance=1
# alternate version: https://www.f4fxl.org/start-direwolf-at-boot-the-systemd-way/

View File

@ -0,0 +1,4 @@
#Type Name ID GECOS Home directory Shell
u direwolf -:audio 'Direwolf Sound Card-based AX.25 TNC' /usr/share/direwolf -
m direwolf audio
m direwolf dialout