More > JRiver Media Center 22 for Linux
Systemd services to autostart JRiver and a VNC server
mwillems:
It's hard to convince systemd to wait indefinitely, but you can specify a timeout with:
--- Code: ---TimeoutStopSec=45
--- End code ---
Adding that with Killsignal set to SIGHUP waits for JRiver to finish or for 45 seconds whichever comes first. I tested on a VM, with just the kill signal but no timeout, the shutdown is instantaneous; with the timeout it waits about five or six seconds, at which point a log message shows jriver closing and the shutdown finishes (a half second later).
You don't need the killmode. I'll add the extra lines to the service in the top post.
mk9pa:
--- Quote from: mwillems on January 30, 2017, 05:18:02 pm ---It's hard to convince systemd to wait indefinitely, but you can specify a timeout with:
--- Code: ---TimeoutStopSec=45
--- End code ---
Adding that with Killsignal set to SIGHUP waits for JRiver to finish or for 45 seconds whichever comes first. I tested on a VM, with just the kill signal but no timeout, the shutdown is instantaneous; with the timeout it waits about five or six seconds, at which point a log message shows jriver closing and the shutdown finishes (a half second later).
You don't need the killmode. I'll add the extra lines to the service in the top post.
--- End quote ---
Minor point -- the timeout shouldn't be necessary. If not provided, it defaults to DefaultTimeoutStopSec which is 90s (https://www.freedesktop.org/software/systemd/man/systemd-system.conf.html# and https://www.freedesktop.org/software/systemd/man/systemd.service.html, and see the file /etc/systemd/system.conf on your system). The log file snippet above shows a 7 second delay between systemd issuing the signal and detecting that MC has exited, which is about what it felt like at the command line.
mwillems:
--- Quote from: mk9pa on January 30, 2017, 05:43:44 pm ---Minor point -- the timeout shouldn't be necessary. If not provided, it defaults to DefaultTimeoutStopSec which is 90s (https://www.freedesktop.org/software/systemd/man/systemd-system.conf.html# and https://www.freedesktop.org/software/systemd/man/systemd.service.html, and see the file /etc/systemd/system.conf on your system). The log file snippet above shows a 7 second delay between systemd issuing the signal and detecting that MC has exited, which is about what it felt like at the command line.
--- End quote ---
That's what is supposed to happen, but is not actually happening on the systems I tested. It may be a bug, but without the timeout systemd just shuts on down on my testbeds. It may also be distro-specific changes to defaults (I'm testing on the debian stretch release candidate), or (as happens occasionally with systemd) there may have been undocumented changes.
In any case, if one configuration needs it others may ;D
Mike Noe:
@mwillems
Just FYI, the "TimeoutStopSec" entry in jriver.service in the first post is missing the "t" (TimeouStopSec).
mwillems:
Good catch! Thanks.
Navigation
[0] Message Index
[*] Previous page
Go to full version