Artix Linux Forum

Init systems => dinit => Topic started by: Hitman on 10 October 2024, 14:35:46

Title: Sometimes dbus-pre fails to stop at poweroff/reboot
Post by: Hitman on 10 October 2024, 14:35:46
This script is called: /usr/lib/artix/sv-cg.sh down dbus.
It then calls /usr/share/artix/cgroups/util-sv-cg.sh and some cgroup command called by function sv_cg_down seems to exit nonzero.

LE: probably nothing wrong with the script except that it's too correct, it's that dbus lingers for some reason. Dinit doesn't give that message "Unable to stop all processes" on the TTY at shutdown when the service fails. Excuse the telephone picture, no serial console :)

I will investigate further as to why it only sometimes fails.
Title: Re: Sometimes dbus-pre fails to stop at poweroff/reboot
Post by: SoftExpert on 12 October 2024, 10:18:16
A previous post https://forum.artixlinux.org/index.php/topic,7251.0.html (https://forum.artixlinux.org/index.php/topic,7251.0.html) gave me the idea to replace
Code: [Select]
/bin/bash
with
Code: [Select]
/bin/sh 
in the following files:

Now /etc/dinit.d/dbus-pre looks like this:
Code: [Select]
type         = scripted
command      = /usr/lib/dinit/pre/dbus
stop-command = /bin/sh /usr/lib/artix/sv-cg.sh down dbus
after        = local.target
restart      = false

and /usr/lib/dinit.d/cgroups looks like this:
Code: [Select]
type       = scripted
command    = /bin/sh /usr/lib/artix/mount-cgroups.sh
restart    = false
depends-on = pseudofs

I do not see any longer the failure message for the dbus-pre service when stopping the system.

Seems to be the correct solution, right ?
Title: Re: Sometimes dbus-pre fails to stop at poweroff/reboot
Post by: Hitman on 12 October 2024, 11:38:42
Curious if this works, will report back.
Spoiler (click to show/hide)
Title: Re: Sometimes dbus-pre fails to stop at poweroff/reboot
Post by: SoftExpert on 12 October 2024, 16:41:49
Well, the change does not have any effect.
I just rebooted my system and the error message was again there -
Code: [Select]
dinit: Service dbus-pre stop command failed with exit code 1
Title: Re: Sometimes dbus-pre fails to stop at poweroff/reboot
Post by: Hitman on 12 October 2024, 17:17:01
I still get it about half the time.

Wondering why the script has a check for /sys/fs/cgroup/dbus.sv/cgroup.kill, it should kill all the processes in /sys/fs/cgroup/dbus.sv/cgroup.procs init style: try sending term then kill right away, or is that what the sv_cg_cleanup function is doing but directly?