:: Re: [DNG] How to check and restart …
Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: tito
Fecha:  
A: dng
Asunto: Re: [DNG] How to check and restart Emby server on Devuan 5 as soon as it closes.
On Sun, 17 Mar 2024 16:09:39 +0100
Mario Marietto via Dng <dng@???> wrote:

> I'm thinking. Maybe a better solution could be :
>
> check-check-emby :
>
> while :
> do
>  if pgrep Emby > /dev/null
>  then
>      echo "check-emby is running..."
>      sleep 10s
>  else
>      echo "check-emby is not running...but now it will run again"
>      /opt/emby-server/bin/./check-emby
>  fi
> done

>
>
> check-emby :
>
>
> while :
> do
>  if pgrep Emby > /dev/null
>  then
>      echo "check-check-emby is running..."
>      sleep 10s
>  else
>      echo "check-check-emby is not running...but now it will run again"
>      /opt/emby-server/bin/./check-check-emby
>  fi
> done

>
> Maybe these scripts are able to watch each other's backs :)
>
>
> On Sun, Mar 17, 2024 at 3:55 PM Mario Marietto <marietto2008@???>
> wrote:
>
> > Hello to everyone.
> >
> > I'm trying to keep up one Emby server on my ARM Chromebook arm 32 bit aka
> > SNOW. The real problem is that it is able to be up only for some time and
> > then closes. To fix this problem,I've created a couple of bash scripts that
> > act as a sentinel. As soon as it goes down,they detect it and they try to
> > restart the process. I created 3 bash scripts that should do the trick :
> >
> > 1) check-emby
> >
> > while :
> > do
> >  if pgrep Emby > /dev/null
> >  then
> >      echo "Emby is running..."
> >      sleep 10s
> >  else
> >      echo "Emby is not running...but now it will run again"
> >      /opt/emby-server/bin/./emby-server &
> >  fi
> > done

> >
> > 2) check-check-emby
> >
> > while :
> > do
> >  if pgrep Emby > /dev/null
> >  then
> >      echo "Emby is running..."
> >      sleep 10s
> >  else
> >      echo "Emby is not running...but now it will run again"
> >      /opt/emby-server/bin/./check-emby &
> >  fi
> > done

> >
> > This is what happens when "emby-server &" is invoked :
> >
> > # ps ax | grep emby
> >
> > 9202 pts/1    Sl+    1:06 /opt/emby-server/system/EmbyServer -programdata
> > /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg
> > /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe
> > -restartexitcode 3 -updatepackage emby-server-deb_{version}_armhf.deb

> >
> >
> > I had to create two bash scripts because when EmbyServer stops
> > working,even check-emby closes. I don't understand why. Inside my sick mind
> > the check-check-emby script should restart both. I don't know if it will
> > work. For the moment it is still up and running.
> >
> >
> > Well. I have a couple of questions to ask you :
> >
> >
> > 1) Can you imagine a better method than mine to achieve the same goal ?
> >
> > 2) Do you think that it will work ?
> >
> > 3) When Emby closes I would like to hear a beep coming from the Chromebook
> > and I would like the beep to be produced by the bash script.
> >
> > Can you help me ? thanks.
> >
> > --
> > Mario.
> >
>
>


Maybe adding it to /etc/inittab

7:2345:respawn:/opt/emby-server/bin/emby-server

id:runlevels:action:process

 respawn
              The process will be restarted whenever it terminates (e.g. getty).


Ciao,
Tito