Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Aug 2019 08:52:22 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Erich Dollansky <freebsd.ed.lists@sumeritec.com>
Cc:        hw <hw@gc-24.de>, freebsd-questions@freebsd.org
Subject:   Re: howto allow anyone to poweroff?
Message-ID:  <20190808085222.77febec0.freebsd@edvax.de>
In-Reply-To: <20190808094618.787a7422.freebsd.ed.lists@sumeritec.com>
References:  <20190807183735.f4a87306c851426be6b799ca@gc-24.de> <20190808094618.787a7422.freebsd.ed.lists@sumeritec.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 8 Aug 2019 09:46:18 +0800, Erich Dollansky wrote:
> Hi,
> 
> On Wed, 7 Aug 2019 18:37:35 +0200
> hw <hw@gc-24.de> 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. :-)



-- 
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?20190808085222.77febec0.freebsd>