[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [K12OSN] Auto shutdown certain clients



On 04/15/2010 04:43 PM, Jeff Siddall wrote:
> On 04/14/2010 08:26 PM, Barry Cisna wrote:
>> Jeff,
>>
>> Ask and ye shall receive,,,:-)
>> No reason this shouldn't work with a little elbow grease....
>>
>>  http://autopoweroff.sourceforge.net/
>>
>> Barry
> 
> Interesting.  If I set the idle time very high this might work.
> 
> Now I need to figure out how to run this selectively on certain TCs.
> 
> Not having given up on my original idea, I also tried SUID on
> /sbin/shutdown but still no-go running it from ltsp-localapps :(

Success!

Turns out the SUID thing does work -- I just typo'd my script when I
tested it that way.  That being said the man page says not to user SUID
so what I ended up doing is this:

1. Install sudo in the chroot
2. Remove this line from /etc/sudoers since ltsp-localapps launched
things do not have a TTY:

Defaults    requiretty

3. Add this line to /etc/sudoers:

%users  ALL=(ALL)       NOPASSWD: ALL

4. Create a script somewhere accessible on the client (ex:
~/auto-shutdown.sh) which contains something like this:

#!/bin/bash
ltsp-localapps sudo /sbin/shutdown -P +720

5. Create a desktop file in the autostart directory for the desired
user(s) (ex: ~/.config/autostart/auto-shutdown.desktop) which contains
something like this:

[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=auto-shutdown
Comment=automatically power off thin client
Exec=~/auto-shutdown.sh
StartupNotify=false
Terminal=true
Hidden=false

Note:This step works for XFCE.  Not sure if all other desktop
environments also work like this.

6. Reboot, login (or autologin in my case) and wait for shutdown!

Jeff


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]