Cannot enter sleep mode as non-root user (Operation not permitted)
freebsd at edvax.de
Sun Apr 17 12:56:02 UTC 2016
On Sat, 16 Apr 2016 21:23:37 -0400, Jason Hunt wrote:
> On Fri, Apr 15, 2016 at 12:06 PM, Polytropon <freebsd at edvax.de> wrote:
> > > Being in wheel just means you can su root, and only root can suspend the
> > > system .. unless you have a suspend button .. or know root's password :)
> > That is the key information: The program must be run by root.
> > Being in the operator or wheel group is not sufficient.
> Thanks. I thought that might be the case but couldn't find anything online
> which specifically stated root is required.
> This old post is what got me thinking wheel or operator should be able to
> do it, but I guess there's some misunderstanding of how XFCE actually
> performs suspend/shutdown/reboot:
> In the past I've always used full-blown DE's like XFCE and had to set the
> rights in PolicyKit, but now using cwm so I need to use commands for these
> types of tasks, and just kind of assumed I should be able to do it without
> root access.
The problem with those DEs is that it's hard to understand how things
are done, and when they stop working, it's almost impossible to state
_what_ went wrong. :-)
> > > > Does anyone have suggestions for how to troubleshoot this?
> > >
> > > Revise expectations or hack acpiconf.c :)
> > Or use a program like su, sudo, or super, for example like this:
> > % sudo acpiconf -s3
> > which should work as expected. It's possible to assign this command
> > to a shell alias or even to a key (or key combination).
> I thought about poking through the acpi code but decided to leave it as a
> future project :)
Probably not a good idea: The security barrier within the program
is well intended and desired.
> My solution for now is to install sudo, set the following in
> %operator ALL=(root) NOPASSWD: /usr/sbin/zzz
> Then set the following in .cshrc:
> alias zzz /usr/local/bin/sudo /usr/sbin/zzz
That should work (if "zzz" should select -s 3 as intended). You could
also assign that command to a key (or key combination) on your keyboard,
so a simple keypress will send the system to sleep.
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions