Skip to main content
Topic: Sometimes dbus-pre fails to stop at poweroff/reboot (Read 215 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Sometimes dbus-pre fails to stop at poweroff/reboot

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.

Re: Sometimes dbus-pre fails to stop at poweroff/reboot

Reply #1
A previous post 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:
  • /etc/dinit.d/dbus-pre
  • /usr/lib/dinit.d/cgroups

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 ?

Re: Sometimes dbus-pre fails to stop at poweroff/reboot

Reply #2
Curious if this works, will report back.
Spoiler (click to show/hide)

Re: Sometimes dbus-pre fails to stop at poweroff/reboot

Reply #3
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

 

Re: Sometimes dbus-pre fails to stop at poweroff/reboot

Reply #4
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?