Thanks pragmatist :)
I already had this in my .xinitrc:
# invoke global X session script
. /etc/X11/Xsession
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
exec dbus-launch ck-launch-session i3
[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources
Which means I didn't have the "--exit-with-session" part.
But I don't really understand the condition (if what? else what?).
I'll have to remove the udisk rule (polkit) I've created (that allows
automounting) in order to test it.
Now, this .xinitrc thing is about automounting, and might allow me to get rid
of the udisk rule.
udev might definitely help if it can (as it says):
- launch a script when unplugged. Unfortunately though, I remember reading
that it's already too late to power off an HDD if it's being unplugged.
- changing its permissions could be useful. I'm still trying to make unmount
and power off work without sudo.