Prevent shutdown

I'm actually looking for a workaround to prevent system shutdown when e.g. a PVR timer is running. Anyone got an idea?
I'm actually using Ubuntu 16.04 with Kodi 17.

In Ubuntu 14.04 LTS with Kodi 16 I managed this like this, which was working pretty good:

[[email protected]:~] {0}
cat /etc/cron.d/prevent-shutdown
*       *       *       *       *       root    /home/hts/; sleep 15; /home/hts/; sleep 15; /home/hts/; sleep 15; /home/hts/

[[email protected]:~] {0}
cat /home/hts/

/usr/lib/pm-utils/sleep.d/ > /dev/null 2>&1
if [[ $? -ge 1 ]]; then
        chmod 0000 /sbin/shutdown
        chmod 000 /usr/sbin/pm-suspend
        [ -f /sbin/shutdown ] || ln -s /bin/systemctl /sbin/shutdown
        chmod 755 /sbin/shutdown
        chmod 775 /usr/sbin/pm-suspend

Since the change from init.d to systemd, this solution is not working anymore.
I did already tried removing executable flags from /sbin/shutdown respectively /bin/systemctl, which was not working. Even removing the symlink is not working.
Therefore it looks like systemd uses another way.
systemd-inhibit won't be a solution, due tvheadend does not fork an extra process which I could separately start with this hook.

Thanks in advance.
Thread Rating:
  • 0 Vote(s) - 0 Average

Logout Mark Read Team Forum Stats Members Help
Prevent shutdown00
This forum uses Lukasz Tkacz MyBB addons.