Linux Kodi performs idle shutdown when other host is resyncing
#1
Hello Everybody,

I configured my kodi box (Kodi 18 on Ubuntu Server 18.04) to shutdown when idle.
But there is also a weekly cron job on another host (Ubuntu Desktop 18.04) to rsync some folders.
The last three times the rsync process was interrupted by idle shutdown of the Kodi box.

Is there any way to adjust kodi idle shutdown to check for active rsync connections before shutting down?

Thanks in advance & Best Regards
Reply
#2
(2019-09-01, 17:38)sjuk Wrote: Hello Everybody,

I configured my kodi box (Kodi 18 on Ubuntu Server 18.04) to shutdown when idle.
But there is also a weekly cron job on another host (Ubuntu Desktop 18.04) to rsync some folders.
The last three times the rsync process was interrupted by idle shutdown of the Kodi box.

Is there any way to adjust kodi idle shutdown to check for active rsync connections before shutting down?

Thanks in advance & Best Regards

You could have your rsync scrip write a file to disk while syncing and delete on finish. Your idle shutdown could be asked to check for the existance of the file via script and if it's there exit without continuing...

James
Reply
#3
(2019-09-01, 18:40)jlivin25 Wrote:
(2019-09-01, 17:38)sjuk Wrote: Hello Everybody,

I configured my kodi box (Kodi 18 on Ubuntu Server 18.04) to shutdown when idle.
But there is also a weekly cron job on another host (Ubuntu Desktop 18.04) to rsync some folders.
The last three times the rsync process was interrupted by idle shutdown of the Kodi box.

Is there any way to adjust kodi idle shutdown to check for active rsync connections before shutting down?

Thanks in advance & Best Regards

You could have your rsync scrip write a file to disk while syncing and delete on finish. Your idle shutdown could be asked to check for the existance of the file via script and if it's there exit without continuing...

James  
Good idea, do you know where to find the idle shutdown script from kodi?
Reply
#4
(2019-09-01, 19:01)sjuk Wrote:
(2019-09-01, 18:40)jlivin25 Wrote:
(2019-09-01, 17:38)sjuk Wrote: Hello Everybody,

I configured my kodi box (Kodi 18 on Ubuntu Server 18.04) to shutdown when idle.
But there is also a weekly cron job on another host (Ubuntu Desktop 18.04) to rsync some folders.
The last three times the rsync process was interrupted by idle shutdown of the Kodi box.

Is there any way to adjust kodi idle shutdown to check for active rsync connections before shutting down?

Thanks in advance & Best Regards

You could have your rsync scrip write a file to disk while syncing and delete on finish. Your idle shutdown could be asked to check for the existance of the file via script and if it's there exit without continuing...

James   
Good idea, do you know where to find the idle shutdown script from kodi? 

 You just hack one together.... what does your current idle script look like?
Need help programming a Streamzap remote?
Reply
#5
(2019-09-02, 00:20)graysky Wrote:
(2019-09-01, 19:01)sjuk Wrote:
(2019-09-01, 18:40)jlivin25 Wrote: You could have your rsync scrip write a file to disk while syncing and delete on finish. Your idle shutdown could be asked to check for the existance of the file via script and if it's there exit without continuing...

James   
Good idea, do you know where to find the idle shutdown script from kodi?   

 You just hack one together.... what does your current idle script look like?  

I don't have any idle script yet. But I think I have to give my question more precision.
Goal: I want to know if kodi supports idle scripts and when so how.
Questions on how to reach it:
Where does kodi store it's default idle script?
Is it possible to add a customized idle script in kodi?
Is there any syntax or api you have to use in the kodi idle script?
Reply
#6
You could try the shutdown monitor addon from here https://github.com/Paulemann/service.shutdown.watchdog and configure it to monitor the use of the corresponding tcp port for rsync. I think it is tcp port 873.

In case your ssh'ing into your box you could also specify 'ssh' as protocol to be monitored.
Reply
#7
(2019-09-06, 17:35)Spirou Wrote: You could try the shutdown monitor addon from here https://github.com/Paulemann/service.shutdown.watchdog and configure it to monitor the use of the corresponding tcp port for rsync. I think it is tcp port 873.

In case your ssh'ing into your box you could also specify 'ssh' as protocol to be monitored.

Hey Spirou, that looks really promising. I've installed it and will test if it works. Thanks a lot. :-)
Reply
#8
(2019-09-07, 13:56)sjuk Wrote:
(2019-09-06, 17:35)Spirou Wrote: You could try the shutdown monitor addon from here https://github.com/Paulemann/service.shutdown.watchdog and configure it to monitor the use of the corresponding tcp port for rsync. I think it is tcp port 873.

In case your ssh'ing into your box you could also specify 'ssh' as protocol to be monitored.

Hey Spirou, that looks really promising. I've installed it and will test if it works. Thanks a lot. :-) 
Hi Spirou, the test was successful. It worked out of the box because rsync was configured to use ssh (port 22) which is enabled by default.
Thank you very much for your answer. :-)
Reply
#9
Glad, I could help. Smile
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi performs idle shutdown when other host is resyncing0