Date: Sun, 17 Apr 2016 14:55:56 +0200 From: Polytropon <freebsd@edvax.de> To: Jason Hunt <jhunt@lynden.on.ca> Cc: freebsd-questions@freebsd.org Subject: Re: Cannot enter sleep mode as non-root user (Operation not permitted) Message-ID: <20160417145556.08614f61.freebsd@edvax.de> In-Reply-To: <CAL43sjgcHTUUHxwcFZV2FBb0AHy2nF5GFKs42X%2BfinudzP-pLw@mail.gmail.com> References: <mailman.115.1460635202.18382.freebsd-questions@freebsd.org> <20160416000316.V1139@sola.nimnet.asn.au> <20160415180613.c066affb.freebsd@edvax.de> <CAL43sjgcHTUUHxwcFZV2FBb0AHy2nF5GFKs42X%2BfinudzP-pLw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 16 Apr 2016 21:23:37 -0400, Jason Hunt wrote: > On Fri, Apr 15, 2016 at 12:06 PM, Polytropon <freebsd@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: > https://marc.info/?l=freebsd-questions&m=139039546710646&w=2 > > 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 > /usr/local/etc/sudoers: > > %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. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160417145556.08614f61.freebsd>