Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 10 of 39

Threaded View

  1. #1
    Senior Member
    Join Date
    May 2010
    Location
    London, UK
    Posts
    976

    systemd service file for LMS

    Following some recent comments in this forum, I have had a go at constructing a systemd unit service file for use on Debian based systems. It is attached to this post.

    If it, or something like it, passes muster, it could be incorporated into the Debian installer package so as to co-exist peacefully with the existing SysV init script. That will take a little more research.

    Points:

    • squeezeboxserver_safe goes, and LMS is started directly by systemd. No 'supervisor', if it fails it stops.
    • Supports setting start up options by using /etc/default/logitechmediaserver, similar to the existing SysV init script.
    • But LMS user is hardcoded to 'squeezeboxserver'.
    • Checks that /var/log/squeezeboxserver exists and is writeable, and creates it if not.
      (Good for systems with /var/log mounted as temporary file system).
      (But only on modern versions of systemd).
    • Service reload sends 'HUP' to LMS, initiating some kind of LMS reinitialization.
      This may not be useful, I've never used it.
    • Addresses issue whereby LMS may start 'too early', before network connections are configured.
      In systemd speak, by including an After=network-online.target stanza in the service file.
      It is left to the user to configure his system in a manner that gives appropriate meaning to the 'network-online.target'.


    I've left rather too many notes in the file, but they record my thoughts.

    I've tested it on Debian 8 (Jessie, systemd 215), Debian 9 (Stretch, systemd 232), and Debian 10 (Buster, systemd 241), and all seems to work as expected. I shall continue to run with it for a few weeks to see if any problems emerge.

    To install manually onto an existing system:

    • Stop LMS with systemctl stop logitechmediaserver.service
    • Install the service file as /etc/systemd/system/logitechmediaserver.service
    • Reload systemd configuration with systemctl daemon-reload
    • Restart LMS with systemctl start logitechmediaserver.service


    Comments welcome.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •