Re: Running VDR from systemd on Raspberry Pi OS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 24.12.22 10:33, Marko Mäkelä wrote:
then
   sudo service vdr stop
   sudo umount /video
   sudo udisksctl power-off -b /dev/sda
fi

The first step appears to terminate the shell script, because the shell
is a subprocess of VDR. So, the storage will remain mounted and powered
on. I guess that we need to launch a separate "vdr-shutdown" service
that would take care of the remaining steps. Has someone already
implemented something like this?

Maybe you can prevent that by backgrounding and setting some bash trap's
on SIGINT or SIGKILL.

Other methods to decouple a process so it runs separated, would be
'nohup' or the old 'at now' trick.

However, I'd say the most clean way is to include the unmount and
udiskctrl into the vdr shutdown itself, so these commands run within the
vdr service after the vdr process stops. That way you just have to fire
the service stop and are done.

From a quick look into documentation, you can just not wait for the
stop to complete:

systemctl stop vdr.service --no-block


Or if you want to go full systemd, you can probably do a service that
does the mount/unmount/poweroff on start/stop, and then add that as
requirement to the vdr service.


Cheers,

Udo


_______________________________________________
vdr mailing list
vdr@xxxxxxxxxxx
https://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr




[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux