site  contact  subhomenews

busybox.conf fixes shutdown

May 01, 2011 — BarryK
Continuing from previous blog post:

In Wary I now have the suid bit set in /bin/busybox, but apparently that does not mean all the applets can run as root when invoked by a non-root user. In the case of 'reboot', 'poweroff' and 'halt' they won't run.

There is a solution though, a "poor man's sudo", that allows permissions to be set on a per-applet basis. Busybox has to be configured with CONFIG_FEATURE_SUID_CONFIG. I have done this and uploaded the PET. Compiled in Wary, but should work in other puppies (368K):

My script /usr/sbin/root2user now creates /etc/busybox.conf, that allows 'reboot' and 'poweroff' to be run by fido.

The contents of /etc/busybox.conf is explained here:
...can't say that I really understand that 'ssx' field yet!

A distro that uses Busybox is Slitaz, and they also use this mechanism:

I can now shutdown. Other things still broken though (audio for example), will tackle those soon.


missing root2user
Username: L18L
would be nice to have that script too. It is not in the pet so /etc/busybox.conf is empty

No sound
Username: BarryK
"Hmmm, I can't get sound to work. I am using the same technique as kirk in FatDog64, all audio device nodes are dynamically created, with some udev rules. This, as I understand it, should create audio device nodes with root:audio ownership: [i]SUBSYSTEM=="sound", GROUP="audio"[/i] Kirk has USER="spot" GROUP="spot". However, for me the device nodes get created root:root. Well, I will download latest FatDog64, see if that works for as I expect.

Re FatDog64
Username: BarryK
"Um, I did download FatDog64, but then realised I don't have a PC with 64-bit CPU. :cry:

Re sound
Username: L18L
"Not sure whether this is helpful but maybe useful as [b]testing scenario[/b]. seamonkey file:///usr/share/audio/ using browser as spot. 2barks heard. Or in console # whoami root # ps | grep seamonkey 16555 spot 0:00 /bin/sh /usr/bin/seamonkey -UILocale de 16588 spot 0:00 /bin/sh /usr/lib/seamonkey/ /usr/lib/seamonk ey/seamonkey-bin -UILocale de 16592 spot 0:20 /usr/lib/seamonkey/seamonkey-bin -UILocale de 19175 root 0:00 grep seamonkey # su spot # whoami spot # cat /usr/share/audio/ > /dev/audio # same good result, heard it loud and clear. My regards spot on wary503q

Tags: woof