systemd service file for LMS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shart
    Junior Member
    • Feb 2020
    • 17

    #16
    Originally posted by [email protected]
    On Mon, 2 Nov 2020 18:03:12 +0000, Shart
    <Shart.9rq38n (AT) no-mx (DOT) forums.slimdevices.com> wrote:

    > I tried the service scripy on Raspberry Pi 4 with Ubuntu Server 20.04
    > arm64 with no luck (latest 8 build). The service fails to start. I do
    > get the Perl error: > DBI EV XML::Parser::Expat HTML::Parser JSON::XS
    > Digest::SHA1 YAML::XS
    > > Sub::Name.


    This is not related to the systemd service. Maybe your LMS install is
    corrupt (or wrong architecture?). This error message typically indicates
    that the native libraries do not match.

    -- Johan
    Thanks. I tried various methods to get it to run. Without any script changes it just restarts over and over so I thought I'd see if anyone had any idea or suggestions. I know it's to do with perl. I got it to run via docker for now but not what I'd prefer.

    Comment

    • mherger
      Babelfish's Best Boy
      • Apr 2005
      • 24099

      #17
      systemd service file for LMS

      > I tried the service scripy on Raspberry Pi 4 with Ubuntu Server 20.04
      > arm64 with no luck (latest 8 build). The service fails to start. I do
      > get the Perl error: > DBI EV XML::Parser::Expat HTML::Parser JSON::XS Digest::SHA1 YAML::XS


      This most likely has nothing to do with the startup script. It's rather
      lack of binary support your system's Perl. What would "perl -v" say?

      --

      Michael
      Michael

      "It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
      (LMS: Settings/Information)

      Comment

      • mrw
        Senior Member
        • May 2010
        • 1083

        #18
        Originally posted by Shart
        I tried the service scripy on Raspberry Pi 4 with Ubuntu Server 20.04 arm64 with no luck (latest 8 build). The service fails to start.
        Ubuntu 20.04 ships with Perl 5.30. As yet, it seems only x86_64 binaries are available for v5.30. So, LMS will fail to start on your arm64 system.

        Is arm64 the same as aarch64 ?

        Comment

        • Mark Miksis
          formerly known as Fletch
          • May 2005
          • 2310

          #19
          Originally posted by mrw
          Ubuntu 20.04 ships with Perl 5.30. As yet, it seems only x86_64 binaries are available for v5.30. So, LMS will fail to start on your arm64 system.
          I assume you can still just follow the instructions to build the required perl modules and then use your service file for systemd?

          Comment

          • mrw
            Senior Member
            • May 2010
            • 1083

            #20
            Originally posted by Mark Miksis
            I assume you can still just follow the instructions to build the required perl modules and then use your service file for systemd?
            Yes, the service file is agnostic in that regard.

            As an aside, I find the following yields a useful diagnostic system log extract (in reverse order).
            Code:
            sudo journalctl -r -u logitechmediaserver
            The squeezeboxserver_safe start up script obscures some of the start up logging, so another benefit of this service file.

            Comment

            • Mark Miksis
              formerly known as Fletch
              • May 2005
              • 2310

              #21
              --d_startup is often helpful

              Comment

              • scytale
                Junior Member
                • Aug 2014
                • 8

                #22
                How this this working?

                How has this been working out?

                I'm interested in helping with this. I could test on Fedora systems if that would help.

                Comment

                • jvromans@squirrel.nl

                  #23
                  systemd service file for LMS

                  On Sat, 23 Jan 2021 11:49:35 +0000, scytale
                  <scytale.9vxglb (AT) no-mx (DOT) forums.slimdevices.com> wrote:

                  > How has this been working out?


                  There is a logitechmediaserver.service in the debian and raspberry kits
                  that works well.

                  -- Johan

                  Comment

                  • jvromans@squirrel.nl

                    #24
                    systemd service file for LMS

                    On Sat, 23 Jan 2021 15:07:31 +0100, Johan Vromans <jvromans (AT) squirrel (DOT) nl>
                    wrote:

                    > There is a logitechmediaserver.service in the debian and raspberry kits
                    > that works well.


                    Oops... It's not in the kit. I don't know where I got it from.

                    I've attached it.

                    After install of LMS remove SysV script:

                    sudo systemctl stop logitechmediaserver.service
                    sudo rm /etc/rc*.d/*logitechmediaserver


                    Use systemctl script:

                    sudo install logitechmediaserver.service.txt /etc/systemd/system/logitechmediaserver.service
                    sudo systemctl daemon-reload sudo systemctl enable logitechmediaserver.service
                    sudo systemctl start logitechmediaserver.service

                    HTH,

                    -- Johan

                    Comment

                    • mfraser
                      Senior Member
                      • Jan 2009
                      • 108

                      #25
                      Originally posted by [email protected]
                      On Sat, 23 Jan 2021 15:07:31 +0100, Johan Vromans <jvromans (AT) squirrel (DOT) nl>
                      wrote:

                      > There is a logitechmediaserver.service in the debian and raspberry kits
                      > that works well.


                      Oops... It's not in the kit. I don't know where I got it from.

                      I've attached it.

                      After install of LMS remove SysV script:

                      sudo systemctl stop logitechmediaserver.service
                      sudo rm /etc/rc*.d/*logitechmediaserver


                      Use systemctl script:

                      sudo install logitechmediaserver.service.txt /etc/systemd/system/logitechmediaserver.service
                      sudo systemctl daemon-reload sudo systemctl enable logitechmediaserver.service
                      sudo systemctl start logitechmediaserver.service

                      HTH,

                      -- Johan
                      There's nothing attached.

                      Comment

                      • jvromans@squirrel.nl

                        #26
                        systemd service file for LMS

                        On Sat, 23 Jan 2021 21:36:22 +0000, mfraser
                        <mfraser.9vy7tc (AT) no-mx (DOT) forums.slimdevices.com> wrote:

                        > There's nothing attached.


                        There is, in my copy of the message...

                        Anyway, try

                        Comment

                        • scytale
                          Junior Member
                          • Aug 2014
                          • 8

                          #27
                          This looks very useful - especially when debugging start up issues.

                          There are better way of spending time than reading through yet another shell start up script.

                          What's the best way forward with this? At a guess:
                          • fork slimserver-platforms
                          • pick one of the linux environments
                          • replace the init script with the systemd file
                          • make whatever other changes are required to the build configuration to get it to use the unit file instead of the init script
                          • build the package
                          • install, test and fix until it works across an acceptable range of versions
                          • move on to the next environment


                          The environments in question would be:
                          • debian
                          • gentoo
                          • redhat


                          We don't need to bother with:
                          • fedora - superceded by redhat
                          • readynas ?????
                          • solaris - still uses some kind of shell based init, right?


                          Sounds feasible?

                          Comment

                          • scytale
                            Junior Member
                            • Aug 2014
                            • 8

                            #28
                            Also it looks like at least in Debian it is fairly striaghtforward to use a postinst script to determine if systemd or sysVinit are in use an install the apropriate file:

                            Check out this stackexchange answer

                            Basically:

                            Code:
                            if [[ `systemctl` =~ -\.mount ]] 
                            then 
                              cp $serviceDir/service-systemd /lib/systemd/system/$serviceName.service
                            elif [[ -f /etc/init.d/cron && ! -h /etc/init.d/cron ]]
                            then 
                            cp $serviceDir/service-sysvinit /etc/init.d/$serviceName
                            fi

                            Comment

                            • mherger
                              Babelfish's Best Boy
                              • Apr 2005
                              • 24099

                              #29
                              systemd service file for LMS

                              > What's the best way forward with this? At a guess:
                              >
                              > - fork slimserver-platforms
                              > - pick one of the linux environments
                              > - replace the init script with the systemd file
                              > - make whatever other changes are required to the build configuration
                              > to get it to use the unit file instead of the init script
                              > - build the package
                              > - install, test and fix until it works across an acceptable range of
                              > versions
                              > - move on to the next environment


                              - submit pull request ;-)

                              > The environments in question would be:
                              >
                              > - debian
                              > - gentoo
                              > - redhat


                              I'm not sure gentoo is worth it. I doubt there still are users of these
                              files.

                              > We don't need to bother with:
                              >
                              > - fedora - superceded by redhat
                              > - readynas ?????


                              I've officially declared readynas support dead with LMS8. This support
                              always ever covered the old 1st/2nd generation devices running Perl
                              5.8/5.10, but none of the more recent (like... past 5 years) systems.

                              > - solaris - still uses some kind of shell based init, right?


                              I believe there are some community members who maintain solaris support
                              in a different form, outside this repository.
                              Michael

                              "It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
                              (LMS: Settings/Information)

                              Comment

                              • mrw
                                Senior Member
                                • May 2010
                                • 1083

                                #30
                                Originally posted by scytale
                                Also it looks like at least in Debian it is fairly striaghtforward to use a postinst script to determine if systemd or sysVinit are in use an install the apropriate file:

                                Check out this stackexchange answer
                                These days, Debian, and the Debian package builder, has support for different init systems "built-in". So it should be equally straightforward to use the package builder's provided method instead a custom post-install script. Is there a reason why you don't suggest this approach ?

                                I don't regularly maintain Debian packages, so any insight welcome.

                                Originally posted by mherger
                                - submit pull request ;-)
                                Which is what I was planning to do, for Debian only, after testing the service file that I originally suggested for a suitable period of time.

                                Well, three months have passed and I have not experienced any issue on the few occasions I have started/stopped LMS in that time, and no-one else has reported any. I suppose some people may have tested .

                                So, I guess the time has come. I'll await @scytales's input.

                                Comment

                                Working...