On 30.08.2010 12:14, Michael Biebl wrote: > Another idea, I'd prefer over your proposed patch, is to test if the D-Bus > names > for org.freedesktop.UDisks resp. org.freedesktop.UPower are taken (which > should > not be the case in a chroot) and skip the restart if not.
So, s-s-d --exec *without* --pidfile is a bit unsafe, as according to the man page it will kill *all* processes matching /proc/pid/exe (see also guillem's comments in #593201) Going further with the dbus idea, we could use something like this if [ -f /var/run/dbus/system_bus_socket ] ; then pid=$(dbus-send --system --dest=org.freedesktop.DBus --print-reply \ /org/freedesktop/DBus org.freedesktop.DBus.GetConnectionUnixProcessID \ string:'org.freedesktop.UDisks' 2>/dev/null | grep uint32 | awk '{print $2}') [ -n "$pid" ] && kill $pid / restart etc. fi Does anyone see any obvious downsides with this approach or thinks this is not a good idea? Michael -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?
signature.asc
Description: OpenPGP digital signature