:: Re: [DNG] How to run Emby server on…
Page principale
Supprimer ce message
Répondre à ce message
Auteur: tito
Date:  
À: dng
Sujet: Re: [DNG] How to run Emby server on Devuan 5.
On Fri, 16 Feb 2024 18:54:00 +0100
Mario Marietto via Dng <dng@???> wrote:

> Hello,
>
> thanks. Someone can help me to fix the error that's inside the script ?
> Because it does not work.
> I have renamed the script to emby and I've copied in /etc/init.d and then I
> tried to start it.
> This is what happened :
>
> root@devuan-bunsen:/etc/init.d# service emby start
> env: '/etc/init.d/emby': No such file or directory
>
> sorry,I'm not experienced in shell scripting. This is the actual content of
> the script :
>
> #!/bin/bash
>
> ### BEGIN INIT INFO
> # Provides:          emby-server
> # Required-Start:    $remote_fs $local_fs $network
> # Required-Stop:     $remote_fs $local_fs $network
> # Default-Start:     2 3 4 5
> # Default-Stop:      0 1 6
> # Short-Description: starts instance of Emby
> # Description:       starts instance of Emby
> ### END INIT INFO

>
> # chkconfig: 2345 20 80
> # The above indicates that the script should be started in levels 2, 3, 4,
> and 5,
> # that its start priority should be 20, and that its stop priority should
> be 80.
> # Load the VERBOSE setting and other rcS variables
> . /lib/init/vars.sh
>
> # Define LSB log_* functions.
> # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
> . /lib/lsb/init-functions
>
> NAME=emby-server
> CONF_FILE=/etc/${NAME}.conf
> DEFAULT_FILE=/etc/default/${NAME}
>
> APP_DIR=/opt/emby-server
> export FONTCONFIG_PATH=$APP_DIR/etc/fonts
> export ICU_DATA=$APP_DIR/share/icu/61.1
> export LD_LIBRARY_PATH=$APP_DIR/lib:$APP_DIR/lib/samba
> export LIBVA_DRIVERS_PATH=$APP_DIR/lib/dri
> export SSL_CERT_FILE=$APP_DIR/etc/ssl/certs/ca-certificates.crt
>
>
> # Source Emby server default configuration
> . $DEFAULT_FILE
>
> # Source Emby server user configuration overrides
> if [[ -f $CONF_FILE ]]; then
> . $CONF_FILE
> else
> echo "${CONF_FILE} not found using default settings.";
> fi
>
> # Path of emby binary
> DAEMON=${APP_DIR}/system/EmbyServer
> ARGS="-programdata $EMBY_DATA \
> -ffmpeg $APP_DIR/bin/ffmpeg \
> -ffprobe $APP_DIR/bin/ffprobe \
> -restartexitcode 3 \
> -updatepackage 'emby-server-deb_{version}_amd64.deb'"
> PIDFILE=${EMBY_PIDFILE-/var/run/emby-server.pid}
>
> case "$1" in
>   start)
>     log_daemon_msg "Starting $NAME daemon"
>     start-stop-daemon --start --quiet --background --chuid
> ${EMBY_USER}:${EMBY_GROUP} \
>         --make-pidfile --pidfile $PIDFILE \
>         --exec $DAEMON -- $ARGS
>     log_end_msg $?
>     ;;
>   stop)
>     log_daemon_msg "Stopping $NAME daemon"
>     start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \
>         --remove-pidfile --pidfile $PIDFILE \
>         --exec $DAEMON -- $ARGS
>     log_end_msg $?
>     ;;
>   status)
>     status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?
>     ;;
>   restart|force-reload)
>     $0 stop || exit $?
>     $0 start || exit $?
>     ;;
>   *)
>     echo "Usage: /etc/init.d/emby-server
> {start|stop|status|restart|force-reload}" >&2
>     exit 3
>     ;;

>
> On Fri, Feb 16, 2024 at 10:11 AM dng@??? <dng@???> wrote:
>
> > On 16-02-2024 00:27, Mario Marietto via Dng wrote:
> >
> > Hello.
> >
> > I tried to install an emby server on my Chromebook arm 32 bit,but
> > something went wrong. But when I did it the first time,it worked. I'd
> > already installed an old version,but since it didn't work anymore,I have
> > installed a new version :
> >
> >
> >
> > root@devuan-bunsen:/home/user/Downloads# dpkg -i emby-server-deb_4.8.1.0_armhf.deb
> >
> > (Reading database ... 510241 files and directories currently installed.)
> > Preparing to unpack emby-server-deb_4.8.1.0_armhf.deb ...
> > service emby-server stop
> > emby-server: unrecognized service
> > update-rc.d emby-server disable
> > update-rc.d: error: cannot find a LSB script for emby-server
> > Unpacking emby-server (4.8.1.0) over (4.7.14.0) ...
> > Setting up emby-server (4.8.1.0) ...
> > usermod: no changes
> > daemon-reload is a NOP.
> > update-rc.d emby-server enable
> > update-rc.d: error: cannot find a LSB script for emby-server
> > service emby-server start
> > emby-server: unrecognized service
> > Processing triggers for libc-bin (2.36-9+deb12u4) ...
> >
> >
> > What happens ? How to fix the errors ? thanks.
> > --
> > Mario.
> >
> > Looking at the above error messages your emby-server package does not
> > contain a sysvinit.script:
> >
> > update-rc.d: error: cannot find a LSB script for emby-server
> >
> >
> > You can find a script here: https://pastebin.com/9WPkDT1m (from 2018 so
> > check the used settings)
> >
> > Grtz.
> >
> > Nick


Hi,
this line looks suspicious to me:

PIDFILE=${EMBY_PIDFILE-/var/run/emby-server.pid}

where comes $EMBY_PIDIFLE from? is it in /etc/default/emby-server?

Maybe something like this?

if [ -n "$EMBY_PIDFILE" ] ; then
    PIDFILE="$EMBY_PIDFILE"
else
    PIDFILE="/var/run/emby-server.pid"
fi


My 0.2 cents.

Ciao,
Tito