shutdown by regular user

iceblink iceblink at seti.nl
Fri Mar 27 09:51:59 UTC 2015


On 2015-03-27 06:24, Karl Auer wrote:
> On Thu, 2015-03-26 at 17:37 -0400, Niles Rogoff wrote:
>> The shutdown group with the sudoers file is the correct way to do it.
> 
> For the OP - true.
> 
> But:

More buts: if you explain different methods, you should also explain the 
good and bad about it.

>> > - have a cronjob that checks every minute for a specific file in /tmp
>> > and shuts down if the file exists
> 
> Useful if you have users whose only access is via shared filespace. By
> the way, the cronjob should also delete the file :-)

The problem with this is that if you find your system down one day, you 
will not be able to figure out who did it.

>> > - have a setuid script that shuts the system down
> 
> Useful if the grouping technique is too unwieldy, or if the shutdown
> needs to happen via an icon-click, without typing stuff (including
> without typing a password).

creating setuid scripts is asking for trouble; the chance that your 
users can execute commands as root gets a lot bigger this way.

>> > - have a "shutdown" group, put your users into it, add a sudoers rule to
>> > let that group shut the system down
> 
> Best in general, as you say, but see above and below.

agree, best method

>> > - put the system on a UPS, run a UPS client that will shut the system
>> > down if the power fails, and tell your users to turn off the power to
>> > the UPS in an emergency.
> 
> Useful if you have users with NO access to the CLI, but who CAN access
> the power switch.

Or alternatively buy a raspberry pi, hook it up to a phone and a magnet, 
have the magnet release a ball, have the ball switch off the UPS. In 
other words, this sounds a little over-complicated ;-)

> There is rarely only one right way. Except that the milk goes in the
> teacup BEFORE the hot water;  that's obviously a given.

Again, you should explain the pros and cons. After you have done so, we 
will argue about adding milk in the first place :-P

> Regards, K.
> 
> --

Patrick





More information about the ubuntu-users mailing list