On Mon, Sep 14, 2026 at 07:58:08AM +1000, Ben Yeoman wrote: > Hi, > > I prefer to configure sudeors such that my user (and any other users > in the ``powermanagement'' group) can run the basic power management > commands without sudo. > > At present, I have the following entry in /etc/sudoers (note that it > is the last entry in the sudoers file): > %powermanagement ALL=(ALL:ALL) NOPASSWD: <store path to > shepherd/sbin/halt>, NOPASSWD: <store path to shepherd/sbin/reboot> > > Additionally, my user is in group powermanagement. > > Now, when I attempt to run just halt or reboot, I get a permission > error on the shepherd socket (/var/run/shepherd/socket): > halt: error: /var/run/shepherd/socket: permission denied
Do you mean that you run just `halt`, not `sudo halt`? The sudoers configuration only applies to commands ran with sudo, so that would not be expected to work. Otherwise I would speculate that it is caused by the fact that the halt command that your shell calls is `/run/current-system/profile/sbin/halt` which is in turn a symlink to `/gnu/store/...-shepherd-.../sbin/halt`. I do not know, but maybe sudo doesn't follow the symbolic link when verifying the command. - Saku
signature.asc
Description: PGP signature
