wakeup script in Kodi flatpak installation on ubuntu/mint
#1
Hi,
I've been trying to get PVR wakeup to record working use the new flatpak installation method for kodi.
I've run into an issue with flatpak sandboxing and was hoping someone may have solved this already.

Basically, setting a command in the PVR > power saving > wakeup command only works if the wakeup script is stored somewhere allowed by flatpak  - I've put mine under /media/data/scripts/set_wakeup.sh
This will then work (I can echo the wakeup time to a file) as long as:

1)  I don't use "sudo set_wakeup"  - (I have added the script using sudo visudo already)

2) I don't try to read /proc/driver/rtc or write to /sys/class/rtc/rtc0/wakealarm 

Both of which are an issue when try to set a wakeup alarm!

The log shows the script is not running, e.g. when sudo is used
2024-03-31 19:54:34.666 T:7       error <general>: SetWakeupCommand: PVR Manager failed to execute wakeup command 'sudo /media/data1/scripts/test.sh 1711914000': Unknown error 32512 (32512)

For 2) I've found from searching that /proc /sys are blacklisted in flatpak apps and I assume for 1) I need to do something different to allow sudo access?

Any ideas greatly appreciated.
Reply
#2
In case anyone has a similiar problem I got it working using a workaround.

Basically have the kodi wakeup command script write the time to a file in a location available to flatpak (i used /media/data1)
Then have a service file in /etc/systemd/system/kodi-pvr-setwakeup.service)  to set the wakeup alarm at shutdown.
I also needed to specify keeping the drive mounted for it to work.
 
Code:
[Unit]
Description=Kodi PVR setwakeup service
RequiresMountsFor=/media/data1

[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/true
ExecStop=/media/data1/scripts/set_wakeup.sh

[Install]
WantedBy=multi-user.target
After making the file, with correct permissions use to enable the service.:
Code:
sudo systemctl daemon-reload
sudo systemctl enable kodi-pvr-setwakeup.service
sudo systemctl start kodi-pvr-setwakeup.service
Reply

Logout Mark Read Team Forum Stats Members Help
wakeup script in Kodi flatpak installation on ubuntu/mint0