shutdown by regular user

Karl Auer kauer at biplane.com.au
Fri Mar 27 12:07:47 UTC 2015


On Fri, 2015-03-27 at 10:51 +0100, iceblink wrote:
> More buts: if you explain different methods, you should also explain the 
> good and bad about it.

Oh FFS. This is a help list, not the place for treatises on every aspect
of every solution. If people ask about the goods and bads we tell 'em.
The point I was trying to make was in answer to someone who said,
bluntly "this is the right way", as if it was the only way. I wanted to
point out that there are many ways to skin a cat, and it depends on the
cat and the use you intend to put the skin to.

> >> > - 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.

Just provide spaces only certain people can write to - like, oooh - like
their home directories. Log all the trigger files you find, delete them,
then shut down. See? More than one way.

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

Of course it's not ideal. But if you have people who can't use the CLI
and you don't want them having to input passwords, then setuid is the
way to go. If seems crashingly obvious to me, and presumably other
capable admins, that extreme caution is needed with this method. For
production use I would probably wrap the script in a setuid C program
that hash/compared the script contents, but that's a bit harder.

> 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 ;-)

Not at all. Lots of multi-user systems are on UPSes, most of them are
appropriately configured to shut themselves down if the UPS loses mains
power. Such a setup can be used to provide an orderly shutdown in case
of emergency because why? Because the system is designed precisely for
that purpose, to provide for an orderly shutdown in case of an
emergency!

BTW I don't recommend the Pi+magnet+phone. If you need remote shutdown,
buy an IP-addressable or dial-up remote power switch.

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

You are clearly an uncivilised person.

Regards, K.

PS :-)

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)
http://www.biplane.com.au/kauer
http://twitter.com/kauer389

GPG fingerprint: 3C41 82BE A9E7 99A1 B931 5AE7 7638 0147 2C3C 2AC4
Old fingerprint: EC67 61E2 C2F6 EB55 884B E129 072B 0AF0 72AA 9882






More information about the ubuntu-users mailing list