2016-01-10 12:44:26 -05:00
|
|
|
[Unit]
|
|
|
|
Description=DAAP/DACP (iTunes), RSP and MPD server, supports AirPlay and Remote
|
2021-04-09 13:43:43 -04:00
|
|
|
Documentation=man:owntone(8)
|
2017-05-05 13:26:48 -04:00
|
|
|
After=network.target sound.target remote-fs.target pulseaudio.service avahi-daemon.service
|
2016-01-10 12:44:26 -05:00
|
|
|
|
|
|
|
[Service]
|
2021-04-09 13:43:43 -04:00
|
|
|
ExecStart=@sbindir@/owntone -f
|
2016-01-10 12:44:26 -05:00
|
|
|
|
2019-02-22 12:56:12 -05:00
|
|
|
# Constrain the upper limit of memory/swap that can be used; this prevents
|
2021-04-09 13:43:43 -04:00
|
|
|
# the server from consuming all system memory (in event of bug/malformed user
|
2019-02-22 12:56:12 -05:00
|
|
|
# curl/SMARTPL query etc) that would hang/freeze low resource and headless (ie
|
|
|
|
# RPi) machines
|
|
|
|
#
|
|
|
|
# systemd will kill the process in such an event but would be auto-restarted as
|
|
|
|
# per 'Restart' directive below
|
|
|
|
#
|
|
|
|
# Values derived from obersvations on rpi3 under load - limits are >50% above
|
|
|
|
# seen high watermarks
|
|
|
|
#
|
|
|
|
# https://www.freedesktop.org/software/systemd/man/systemd.resource-control.html
|
|
|
|
MemoryMax=256M
|
|
|
|
MemorySwapMax=32M
|
|
|
|
|
2020-04-28 15:47:02 -04:00
|
|
|
# Restart, but set a limit so we don't restart indefinitely. Unfortunately,
|
|
|
|
# systemd also applies the start limits to manual restarts, so that's why the
|
|
|
|
# burst value allows for 10 restarts.
|
2016-01-10 12:44:26 -05:00
|
|
|
Restart=on-failure
|
2020-04-28 15:47:02 -04:00
|
|
|
RestartSec=5
|
|
|
|
StartLimitBurst=10
|
2016-01-10 12:44:26 -05:00
|
|
|
StartLimitInterval=600
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
|