Different Shutdown process from Kodi or ssh
|
24th Apr, 2020, 04:14 AM
Post: #1
|
|||
|
|||
Different Shutdown process from Kodi or ssh
HEy,
I realize that there seem different shutdown routines whether I choose "shutdown" from the Kodi menu or do a "sudo shutdown - now" from ssh. One thing I described here: http://forum.xbian.org/thread-4084.html (different things showing below the progress bar). Another thing I'm struggling with now is: I have a shutdown script inside /etc/rc0.d/K... (spawned from /etc/init.d/ by executing update-rc.d ...). It gets perfectly executed when I do a "sudo shutdown -h now", but not, when I select "Shutdown" from the Kodi menu. Is there an explanation for this? What's the difference between these processes? Can I make Kodi to execute excatly the same as "sudo shutdown -h now" from the shutdown menu? |
|||
26th Apr, 2020, 12:39 AM
Post: #2
|
|||
|
|||
RE: Different Shutdown process from Kodi or ssh
Ok, I figured at least something out:
XBian uses the upstart mechanism for booting, right? Terminal xbian@xbian / $ /sbin/init --version init (upstart 1.13.2) Terminal xbian@xbian / $ systemctl status System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down Terminal xbian@xbian / $ sudo shutdown -h now On the other hand, scripts inside /lib/systemd/system-shutdown/ get executed as well, also if I shutdown from inside Kodi. This folder belongs to the systemd-System. So, I ask: Is Kodi using systemd, while the rest of Xbian uses upstart? Is this a bug? |
|||
26th Apr, 2020, 04:19 AM
Post: #3
|
|||
|
|||
RE: Different Shutdown process from Kodi or ssh
So, after all I read, Xbian 1.0 is running on Base of Debian 10.
Debian 10 is running with systemd as startup system. Why is (at least my) Xbian using upstart? Is that intentionally? Is there something wrong with my installation? Can this be switched? Would it work? How come that, although using UPSTART, the scripts in /lib/systemd/system-shutdown/ get executed? |
|||
26th Apr, 2020, 11:37 PM
Post: #4
|
|||
|
|||
RE: Different Shutdown process from Kodi or ssh
That's right, XBian ist based on Debian, but XBian requires Upstart due to historical reasons and this can not changed in the near future, probably never because of a couple of upstart features are used which does systemd not provide
There is nothing wrong with your installation The scripts inside of /lib/systemd/system-shutdown/ are executed from /etc/init/progress-shutdown.conf and has nothing to do with systemd Actually, Kodi is using the logind functionality (if it is there) to shutdown/reboot system. logind is provided by systemd or by alternative logind manager such as elogind that we use. It seems that there is the bug that shutdown from Kodi does not work as expected. Atm, I have no idea how to fix it, maybe integrating shutdown tool will be a good aproach, will have to look deeper if this could work |
|||
27th Apr, 2020, 03:29 AM
Post: #5
|
|||
|
|||
RE: Different Shutdown process from Kodi or ssh
Ok, thank you very much for clarification.
I already opened a issue on github. I added there my finding about the different ways that the system changes the runlevel when shutdown from Kodi. Is there a similar folder like /lib/systemd/system-shutdown that executes scripts at startup? Or is my consideration correct, that startup scripts must go into the rc?.d or rc.local, while shutdown scripts go into /lib/systemd/system-shutdown? So, there's no consistent way of executing a script on startup and shutdown? |
|||
27th Apr, 2020, 05:09 AM
Post: #6
|
|||
|
|||
RE: Different Shutdown process from Kodi or ssh
(27th Apr, 2020 03:29 AM)Gauner Wrote: Ok, thank you very much for clarification. I've already seen you issue on github I looked deeper into today and it seems that elogind is the culprit. Can't say if the version is too old (its the version shipped with buster, on giithub are oc newer versions matching with systemd versioning), or if just elogind is wrong configured. Anyway, I have a test installation running without elogind, using logind from systemd, looks ok so far. Shutdown from Kodi works as expected (AFAIS) I don't know if there is a startup folder similar to shutdown folder, I would assume there isn't though. And yes, I think you're right to put startup script into rc.local if required or look into file /etc/default/xbmc, variable USERRUN. maybe you can wrote your own userrun script For a quick test, you can replace /etc/init/elogind.conf with Code: description "Enable user and session management by systemd/(e)logind" and install systemd (/lib/systemd/systemd-logind is provided by systemd) |
|||
29th Apr, 2020, 01:23 AM
Post: #7
|
|||
|
|||
RE: Different Shutdown process from Kodi or ssh
This solution solves it, my shut down scripts get executed now! Thank You very much!
|
|||
18th Apr, 2022, 01:38 AM
Post: #8
|
|||
|
|||
RE: Different Shutdown process from Kodi or ssh
Hi guys,
Install Kodi applications: Kodi is an open-source application, completely free, so it is available on the application stores of platforms such as Windows or Android, you can install the application from the store or download the installation file from the official website of Team Kodi. |
|||
« Next Oldest | Next Newest »
|
Possibly Related Threads... | |||||
Thread: | Author | Replies | Views: | Last Post | |
xbian-config doesn't show kodi process running.... | Skywatch | 5 | 14,416 |
14th Feb, 2015 11:10 PM Last Post: Smultie |