[Tfug] How to allow the user to reboot?

Bexley Hall bexley401 at yahoo.com
Mon Nov 12 13:58:48 MST 2007


--- jblais <joe.blais at pti-instruments.com> wrote:

> > WHy do you *want* the user to be able to do this?
> > Presumably, if you don't trust the user with root
> > privileges, you probably don't trust him/her to
> > know when it's "appropriate" to shutdown, etc. (?)
> >
> > I would suggest letting the user set a flag
> somewhere
> > (e.g., "touch /path/to/shutdownplease") and then
> have
> > a job that watches for that flag and, WHEN IT IS
> > APPROPRIATE, does an orderly shutdown.
> >
> > E.g., what happens if you let the user
> unilaterally
> > do the shutdown and there is a backup job running,
> > etc.?
> >
> > <shrug>
> >
> > My $0.02...
> >
> > --don
> 
> Well -- there are no backup scripts (so far), and I
> do want some kind of
> orderly shutdown for the files -
> How do you shut down a copy machine? I don't want it
> much more difficult
> than that for the user.

Note that many devices (copiers, printers, etc.)
have the power switch act like a "shutdown REQUEST"
switch and not a hard "shut OFF" (though users can
always pull the plug to workaround that).  These
devices have cleanup actions that they want to
perform before *really* shutting down and this is
how they invoke those.

(I designed a product with similar "issues" -- it
actually fell back to *battery* power if the user
unplugged it at the wrong time and *then* invoked
its shutdown routines.  Required a special power
switch so you -- i.e. *me* -- could determine that
the power switch had been turned *off* vs. a power
failure -- since actions in each case differ)

> The script that launches everything is looking for
> the proper exit value
> from the app in order to do the shutdown. The script
> is running as user, so
> I had to figure out how to get the script to do the
> shutdown.
> Without the proper exit, it assumes a barf
> (throw(up) :-) and loops around
> to restart the system.
> 
> joe
> 
> 
> _______________________________________________
> Tucson Free Unix Group - tfug at tfug.org
> Subscription Options:
> http://www.tfug.org/mailman/listinfo/tfug_tfug.org
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




More information about the tfug mailing list