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.
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
/bin/bash
with
/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:
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:
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 ?
Curious if this works, will report back.
Although /bin/sh is symlinked to bash (by default), bash seems to know it's called as posix sh and opens a different prompt (LE it's right https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Bash-POSIX-Mode), so if it's compatibility stuff triggers too it can be a solution as long as an exotic shell is not linked to /bin/sh later (by the user).
Well, the change does not have any effect.
I just rebooted my system and the error message was again there -
dinit: Service dbus-pre stop command failed with exit code 1
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?