I was just typing something almost identical! 

Check out /etc/init.d/README and use /etc/init.d/rc.local (if Mint correponds with /etc/ layout of Ubuntu Server).

Assuming you are in init 5 you can just TERM/HUP (can't remember which, don't use X much) the root X process and it will respawn... but doing via cron is kinda fugly.

Calculate the 'limit' and inject that into root's cron (root so the user can't disable it).  Cron runs at specific times so you need to calculate when to run it and specify it exactly such that if I log in at 9:30am (today) the following happens (you need to generate the first four numbers [minute,hour,day of month,month, day of week as per crontab(5)]):
echo "0 10 6 12 * pkill -TERM Xserver" | sudo crontab -e 

Using at(1) is a better option but do it as a wheel priviledged user... does wheel even translate to Linux?? (sry.. BSD thing, if not use root).

On 2009-12-07, at 11:47 AM, Sean Walberg wrote:

A foot in the door for more unpaid work?

OTTOMH:

Your user is publicuser. Store your skeleton in /usr/local/etc/publicuser. 

In rc.local or whatever Mint calls it:

rm -rf /home/publicuser
(cd /usr/local/etc && tar -cf - publicuser) | (cd /home && tar -xf -)

In the skeleton's .bashrc

echo "reboot" | at now + 30 minutes

I'd hate to be around when someone is typing an email at T+00:30:01 though. Maybe a few minutes googling for "linux kiosk" will find a far more elegant solution. Not sure if you chose Mint because you like it or you have a particular need, but there appear to be some custom distributions or packages made for this exact purpose.

This also assumes the user can reboot the computer from the command line. It works in Red Hat/Fedora.

Sean

On Mon, Dec 7, 2009 at 11:33 AM, Mike Pfaiffer <high.res.mike@gmail.com> wrote:
       The CLL is setting up a public access machine in the next couple of
weeks. It is installed with Mint 8 (a multimedia Ubuntu fork). I would
like to set up a couple of init scripts. The first will delete the
public account home directory and copy a "clean" version in its place
each time the computer starts. The second will shut down the computer
after half an hour of use.

       I haven't touched on cron since university 20 years ago and I've never
written an init script. Having written a few shell scripts I know the
copy script should be very simple. I'm not sure how to set up the timer
script or make them run on start up. Would anybody be able to fire off
some quick directions?

       This may be a "foot in the door" situation.

                               Later
                               Mike
_______________________________________________
Roundtable mailing list
Roundtable@muug.mb.ca
http://www.muug.mb.ca/mailman/listinfo/roundtable



--
Sean Walberg <sean@ertw.com>    http://ertw.com/
_______________________________________________
Roundtable mailing list
Roundtable@muug.mb.ca
http://www.muug.mb.ca/mailman/listinfo/roundtable

-- 
Sean