AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / ubuntu / Perguntas / 1188506
Accepted
bomben
bomben
Asked: 2019-11-14 10:03:34 +0800 CST2019-11-14 10:03:34 +0800 CST 2019-11-14 10:03:34 +0800 CST

Como instalar o Logitech Media Server (Servidor Squeezebox)?

  • 772

Onde posso obter os arquivos de instalação mais recentes do Logitech Media Server e como instalá-lo corretamente?

(Estou executando-o em um Raspberry Pi 2 e tive que reinstalá-lo várias vezes devido a um cartão SD com falha. Portanto, responderei a essa pergunta principalmente como um lembrete para mim.)

software-installation mediaserver logitech squeezebox
  • 2 2 respostas
  • 15165 Views

2 respostas

  • Voted
  1. Best Answer
    bomben
    2019-11-14T10:03:34+08:002019-11-14T10:03:34+08:00

    No momento em que escrevo, a versão mais recente é 7.9.2.

    Está disponível aqui . Você pode encontrar uma visão geral de várias outras versões aqui . Copie linkpara um arquivo de acordo com seu sistema na área de transferência.

    Baixe o arquivo para o seu sistema com wget link. Instale o filecom sudo dpkg -i file. Isso falhará ao instalar devido a dependências ausentes.

    Corrija com sudo apt -f install.

    Comece com sudo service logitechmediaserver start.

    Verifique se está executando com top.

    Conecte-se ao servidor via Web-GUI disponível em http://IPofYOURserver:9000.


    As configurações estão em /var/lib/squeezeboxserver/prefs/server.prefs.

    Isso inclui diretórios para a biblioteca de mídia, mas também configurações para clientes locais, como o tamanho das informações mostradas na tela de um Squeezebox Boom antigo.

    Caso você queira evitar configurar tudo novo, você pode substituir server.prefs. Para poder fazer isso você tem que sudo systemctl stop logitechmediaserver.

    Em seguida, copie o arquivo e sudo chown squeezeboxserver:nogroup /var/lib/squeezeboxserver/prefs/server.prefs.

    Finalmente, sudo systemctl start logitechmediaserver.


    ATUALIZAÇÃO: Talvez o usuário squeezeboxserverprecise ser adicionado ao grupo users. Além disso, os locais das listas de reprodução devem ser chmod 775.


    Se você usa um firewall como ufwo manuseio de portas é explicado aqui .


    Outros arquivos podem ser encontrados aqui: http://wiki.slimdevices.com/index.php/Logitech_Media_Server_file_locations#Ubuntu_.3E12.04

    • 3
  2. Alex.H
    2020-05-12T15:29:21+08:002020-05-12T15:29:21+08:00

    Atualizei para o Ubuntu 20.04 e isso quebrou minha instalação, mas descobri como fazê-lo funcionar novamente:

    Depois de alguns ajustes, pensei em fazer uma nova instalação. Então eu deletei as coisas antigas em /var/lib/squeezeboxserver/

    Então eu consegui um novo pacote deb para a versão 8.0 (beta) de: http://downloads.slimdevices.com/nightly/?ver=8.0

    Pessoalmente, usei a versão mais plataforma, mas dependendo da plataforma, basta selecionar um deb adequado:

    wget http://downloads.slimdevices.com/nightly/8.0/lms/cf7bcdb87b4f8bf6f71f5b5444c923afae4c300d/logitechmediaserver_8.0.0~1589180193_all.deb
    

    Instalei com: dpkg -i logitechmediaserver_8.0.0_1588799628_all.deb

    Como eu tentei versões mais antigas também e até tentei um git checkout, espero não ter nenhum detalhe que outro script já tenha feito para mim sem perceber.

    Se a instalação do dpkg ainda não adicionou um usuário e grupo, faça isso:

    adduser squeezeboxserver
    usermod -a -G squeezeboxserver squeezeboxserver
    

    Crie um diretório para o arquivo pid:

    mkdir /var/run/logitechmediaserver
    

    E dê a esse usuário e grupo:

    chown squeezeboxserver:squeezeboxserver /var/run/logitechmediaserver
    

    O mesmo vale para as coisas em /var/lib/squeezeboxserver/

    chown squeezeboxserver:squeezeboxserver /var/lib/squeezeboxserver
    chown -R squeezeboxserver:squeezeboxserver /var/lib/squeezeboxserver/*
    

    O problema vem com o script de inicialização em /etc/init.d. Simplesmente não funciona, pois o Ubuntu 20.04 não possui mais o daemon start-stop. Ele está simplesmente vinculado a /bin/true, que pode funcionar para alguns scripts, mas não funciona para o logitechmediaserver. Eu tentei uma implementação C para este programa, mas ele tinha dobradiças, então eu larguei o start-stop-daemon e modifiquei o programa de inicialização de acordo.

    Apenas guarde o script de inicialização antigo (apenas para salvar) e copie este conteúdo em um editor de sua escolha:

    #!/bin/sh
    #
    # $Id$
    #
    # logitechmediaserver   initscript for slimserver.pl
    #           This file should be placed in /etc/init.d.
    #
    # Original Author: Mattias Holmlund
    #
    # Updated By: Dan Sully, Michael Herger, Alexander Hartmann
    
    #
    ### BEGIN INIT INFO
    # Provides:             logitechmediaserver
    # Required-Start:       $all
    # Required-Stop:        $all
    # Should-Start:         $all
    # Should-Stop:          $all
    # Default-Start:        2 3 4 5
    # Default-Stop:         0 1 6
    # Short-Description:    Startup script for the Logitech Media Server
    # Description:      Logitech Media Server powers the Squeezebox, Transporter and SLIMP3 network music \
    #           players and is the best software to stream your music to any software MP3 \
    #           player. It supports MP3, AAC, WMA, FLAC, Ogg Vorbis, WAV and more! \
    #           As of version 7.7 it also supports UPnP clients, serving pictures and movies too!"
    ### END INIT INFO
    #
    # -e  Exit immediately if a command exits with a non-zero status.
    set -e
    
    # Load the VERBOSE setting and other rcS variables
    . /lib/init/vars.sh
    
    # Define LSB log_* functions.
    # Depend on lsb-base (>= 3.2-14) to ensure that this file is present
    # and status_of_proc is working.
    . /lib/lsb/init-functions
    
    
    ### About logitechmediaserver
    # The logitechmediaserver is kind of special. It uses the
    # squeezeboxserver_safe script, to restart any died squeezeboxserver. This
    # can easily happen, for example if you use a MySQL server. Depending on unix
    # flavour you are running they sometimes do a regular restart. That would
    # cause the squeezeboxserver to terminate. Because of that the 
    # squeezeboxserver_safe starts a logitechmediaserver every few seconds, which
    # gets shut down again if any other logitechmediaserver is still running.
    #
    # Sadly this procedure messes up, the process id file. You would get a new id
    # file, every time a new server process gets started. That process will
    # terminate but the process id of the first server process is lost. So the
    # killing the squeezeboxserver have to be done with analysing the process
    # table.
    #
    # As I upgraded to Ubuntu 20.04 my logitechmediaserver stopped working.
    # Installing the lastest 8.0 version was no problem downloading the deb-packet
    # and installing with dpkg. But the server did not start. I could start it
    # manually but the startup script was not able to start it. After some looking
    # around I found this:
    #
    #           /sbin/start-stop-daemon -> /bin/true
    #
    # This explains why the start up script is not working. There is no package
    # in the ubuntu package repository for the start-stop-daemon.
    #
    # First I tried the C implementation of start-stop-daemon from Dale O'Brien on
    # github (https://github.com/daleobrien/start-stop-daemon). It does not
    # implement the --remove-pidfile option the original script. But more 
    # problematic it threw the error not able to terminate the server while
    # doing it without a problem.
    #
    # I had to compile the C implementation from Dale O'Brien myself, which
    # worked without a hitch. Considering the limiations of the implementation
    # I came to the conclusion to ditch the start-stop-daemon completly and 
    # doing it the old school way.
    
    
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    DESC="Logitech Media Server"
    NAME=squeezeboxserver
    NEWNAME=logitechmediaserver
    DAEMON=/usr/sbin/$NAME
    DAEMON_RESTARTER=/usr/sbin/${NAME}_safe
    PIDFILE=/var/run/$NEWNAME/${NEWNAME}.pid
    SCRIPTNAME=/etc/init.d/$NEWNAME
    SLIMUSER=$NAME
    SLIGROUP=$NAME
    PREFSDIR=/var/lib/$NAME/prefs
    LOGDIR=/var/log/$NAME/
    CACHEDIR=/var/lib/$NAME/cache
    CHARSET=utf8
    SLEEPTIMER=1
    
    ## if you want to add additional options
    ## use /usr/sbin/squeezeboxserver --help 
    ## for the supported options and place them
    ## into the configfile  /etc/default/logitechmediaserver
    
    
    # Read config file if it is present.
    if [ -r /etc/default/$NEWNAME ]; then
        . /etc/default/$NEWNAME
    elif [ -r /etc/default/$NAME ]; then
        . /etc/default/$NAME
    fi
    
    #
    #   Function that starts the daemon/service.
    #
    d_start() {
            # Where is your su installed?
            SU_BIN=$(command -v su)
    
            # Use squeezeboxserver_safe to restart the daemon when
            # it dies. This must be done to handle mysql restarts.
    
            $SU_BIN - $SLIMUSER \
              -s /bin/sh \
              -c "$DAEMON_RESTARTER \
                    $DAEMON \
                      --user $SLIMUSER \
                      --group $SLIGROUP \
                      --prefsdir $PREFSDIR \
                      --logdir $LOGDIR \
                      --cachedir $CACHEDIR \
                      --charset=$CHARSET \
                      --daemon \
                      $SLIMOPTIONS \
                  > /dev/null 2>&1 &"
    
    
            # Writing the pid for the restarter          
            PID=$(ps ax | \
              grep "$DAEMON_RESTARTER $DAEMON" | \
              grep -v grep | \
              head -1 | \
              awk '{print $1}' )
    
            if [ $PID ]
            then
              if [ $PID -gt 0 ]
              then
                echo -n "  Started the restarter with the process id: "
                echo $PID
    
                if [ -e $PIDFILE ]
                then
                  rm $PIDFILE
                fi
    
                echo -n $PID > $PIDFILE
              fi
            else
                echo "  ERROR: No process id for the restarter could be found!"
            fi
    
    
            # Check if the server is successfully started        
            PERL_BIN=$(command -v perl)
    
            PID_SERVER=$(ps ax | \
              grep "$PERL_BIN $DAEMON" | \
              grep -v grep | \
              head -1 | \
              awk '{print $1}' )
    
            if [ $PID_SERVER ]
            then
              if [ $PID_SERVER -gt 0 ]
              then
                echo "  Started the server successfully."
              else
                echo "  ERROR: No process id for the server could be found!"        
              fi
            fi
    }
    
    
    #   Function that stops the daemon/service.
    #
    d_stop() {
        echo -n "  Checking if the restarter is still running: "
    
        ## This will kill the squeezeboxserver_safe script. So we don't have
        ## to bother about it, starting new processes.
    
        PID1=$(ps ax | \
          grep "$DAEMON_RESTARTER $DAEMON" | \
          grep -v grep | \
          head -1 | \
          awk '{print $1}' )
    
    
        if [ $PID1 ]
        then
          echo positive
          if [ $PID1 -gt 0 ]
          then
            echo -n "  Stopping now restarter: "
    
            kill $PID1
    
                if [ -e $PIDFILE ]
                then
                  rm $PIDFILE
            fi
    
            echo done.
          fi
        else
                echo negative
            fi
    
        ## We have to kill at least one server process. Possible two processes
        ## and in weird cases  under real high load even three processess.
        ## So a loop it is.
        ## We have to wait for at least one second for closing the process
        ## and analyzing the process list again.
    
            echo -n "  Checking if any server instances are running: "
    
        PERL_BIN=$(command -v perl)
    
            PID2=$(ps ax | \
              grep "$PERL_BIN $DAEMON" | \
              grep -v grep | \
              head -1 | \
              awk '{print $1}' )
    
            if [ $PID2 ]
            then
              echo positive
              echo -n "  Stopping now all server instances: "
              if [ $PID2 -gt 0 ]
              then
                while [ $(ps ax | \
                  grep "$PERL_BIN $DAEMON" | \
                  grep -v grep | \
                  head -1 | \
                  awk '{print $1}') ]
                do
              kill $(ps ax | \
                    grep "$PERL_BIN $DAEMON" | \
                    grep -v grep | \
                    head -1 | \
                    awk '{print $1}')
                  sleep $SLEEPTIMER
                done
                echo done
              fi
            else
              echo negative
            fi
    }
    
    #
    #   Function that sends a SIGHUP to the daemon/service.
    #
    d_reload() {
        start-stop-daemon --stop --quiet --pidfile $PIDFILE --signal 1
    }
    
    case "$1" in
      start)
        echo "Making sure that $DESC is not running: "
        d_stop
        echo "Starting $DESC:"
        d_start
        ;;
      stop)
        echo "Stopping $DESC:"
        d_stop
        ;;
      restart|force-reload)
        #
        #   If the "reload" option is implemented, move the "force-reload"
        #   option to the "reload" entry above. If not, "force-reload" is
        #   just the same as "restart".
        #
        echo "Restarting $NAME."
        d_stop
        d_start
        ;;
      status)  
        status_of_proc /usr/bin/$NEWNAME $NEWNAME
        ;;
      *)
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
        exit 1
        ;;
    esac
    
    exit 0
    

    Sim, não é bonito, mas faz o trabalho para mim e espero ajudá-lo também. Você deve colocá-lo em /etc/init.d com o nome logitechmediaserver

    Depois disso, você deve executar o seguinte comando para deixar o systemctl feliz:

    systemctl daemon-reload
    

    Basta fazer um teste com iniciá-lo:

    /etc/init.d/logitechmediaserver start
    

    Você deve conseguir fazer login com seu navegador da Web em http://YourServerIP:9000/ e configurá-lo.

    E teste se ele desliga novamente:

    /etc/init.d/logitechmediaserver stop
    

    Quando tudo der certo, habilite o serviço:

    systemctl enable logitechmediaserver.service
    
    • 2

relate perguntas

  • Onde devo instalar o sagemath?

  • Como instalo o Adobe Flash player?

  • Como posso configurar o Software Center para instalar software para usuários não root?

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Existe um comando para listar todos os usuários? Também para adicionar, excluir, modificar usuários, no terminal?

    • 9 respostas
  • Marko Smith

    Como excluir um diretório não vazio no Terminal?

    • 4 respostas
  • Marko Smith

    Como descompactar um arquivo zip do Terminal?

    • 9 respostas
  • Marko Smith

    Como instalo um arquivo .deb por meio da linha de comando?

    • 11 respostas
  • Marko Smith

    Como instalo um arquivo .tar.gz (ou .tar.bz2)?

    • 14 respostas
  • Marko Smith

    Como listar todos os pacotes instalados

    • 24 respostas
  • Martin Hope
    Flimm Como posso usar o docker sem sudo? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    led-Zepp Como faço para salvar a saída do terminal em um arquivo? 2014-02-15 11:49:07 +0800 CST
  • Martin Hope
    ubuntu-nerd Como descompactar um arquivo zip do Terminal? 2011-12-11 20:37:54 +0800 CST
  • Martin Hope
    TheXed Como instalo um arquivo .deb por meio da linha de comando? 2011-05-07 09:40:28 +0800 CST
  • Martin Hope
    Ivan Como listar todos os pacotes instalados 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    David Barry Como determino o tamanho total de um diretório (pasta) na linha de comando? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher "Os seguintes pacotes foram retidos:" Por que e como resolvo isso? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford Como os PPAs podem ser removidos? 2010-07-30 01:09:42 +0800 CST

Hot tag

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve