howto allow anyone to poweroff?

Polytropon freebsd at
Thu Aug 8 06:58:42 UTC 2019

On Thu, 8 Aug 2019 09:46:18 +0800, Erich Dollansky wrote:
> Hi,
> On Wed, 7 Aug 2019 18:37:35 +0200
> hw <hw at> wrote:
> > Hi,
> > 
> > is there a way to allow ordinary users to poweroff a machine?  I'd
> > like to automatically poweroff PXE booted clients once the user that
> > was logged in logs out after using it.
> an unconventional way would be to have a cron job checking if someone
> is locked in an power off the machine if none is logged in. You do not
> have problems with the access rights but might run into the problem
> that the machine shutsdown when somebody just has arrived at the
> machine.
> You also can catch the logout event and shut the machine down then. It
> is the problem with the access right again.

TO extend this idea, you could parse the output of programs
like "w" to check for reamining interactive users. If the
last one has logged out in a cron-controlled specific time
window, the system could perform a shutdown. Hoewever, the
problem described above will remain. :-)

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list