Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: SamK on December 06, 2011, 05:23:00 AM

Title: TC4.1 Change Default Selection to Reboot on Exit?
Post by: SamK on December 06, 2011, 05:23:00 AM
When exiting TC, is there a way to force TC Exit Option to automatically select Reboot in preference to Shutdown?
   


Edit: Subject modified to more accurately indicate the goal.
Title: Re: TC4.1 Force Reboot on Exit
Post by: curaga on December 06, 2011, 07:08:38 AM
Not ATM. A feature request?
Title: Re: TC4.1 Force Reboot on Exit
Post by: SamK on December 06, 2011, 07:24:04 AM
The reason for the enquiry is that when administrating a remote TC server machine (e.g. via VNC) it is less prone to errors to have the remote machine configured to automatically reboot rather than shutdown.
   
Title: Re: TC4.1 Force Reboot on Exit
Post by: maro on December 06, 2011, 03:50:29 PM
If working on a remote system I personally prefer to work via CLI (well actually I tend to prefer it also for most work on local systems), and there you could achieve what your are after via a simple: sudo reboot

And if one is really "desperate" to have an icon that can be clicked then it would be simple to choose an icon and create a wrapper script and a .desktop file, and voilĂ  you've created a "GUI reboot application".
Title: Re: TC4.1 Force Reboot on Exit
Post by: SamK on December 07, 2011, 01:59:52 AM
If working on a remote system I personally prefer to work via CLI (well actually I tend to prefer it also for most work on local systems), and there you could achieve what your are after via a simple: sudo reboot

And if one is really "desperate" to have an icon that can be clicked then it would be simple to choose an icon and create a wrapper script and a .desktop file, and voilĂ  you've created a "GUI reboot application".
Thanks for the suggestions but they don't really address the heart of the enquiry. 

Both the standard TC exit and the suggestions require the operator to make a choice and follow it with a particular action to obtain a reboot.  Having an option whereby the standard TC exit can be made to default to Reboot means the operator has to make a choice not to reboot.
   
Title: Re: TC4.1 Force Reboot on Exit
Post by: andrewb on December 07, 2011, 05:16:20 PM
Change or overwrite exittc to have only 'sudo reboot' in it, add exittc to filetool.lst.  This will cause an immediate reboot when run, save the changes to the backup & reload them on reboot.

Make sure you've set a backup directory before you do this (Control panel -> backup).

[I'm writing this from memory - not at my TC machine at the moment. You may need more than just sudo reboot to ensure the backup occurs on shutdown]
Title: Re: TC4.1 Force Reboot on Exit
Post by: Rich on December 08, 2011, 01:17:04 AM
exittc is not a script but a binary, which means SamK would have to modify the source and recompile.
It would probably be simpler to change the /sbin/poweroff link to point to /sbin/reboot instead
of /bin/busybox.
Title: Re: TC4.1 Force Reboot on Exit
Post by: SamK on December 08, 2011, 01:39:52 AM
Again - thanks for the ideas.  They are closer to the desired outcome but don't quite hit the target.

I was hoping to find a way of doing this which is akin to the way that backup-on-exit is controlled, i.e. something similar to setting BACKUP=0/1 within ~/.profile.  This would have the advantages of:
   
Title: Re: TC4.1 Force Reboot on Exit
Post by: Rich on December 08, 2011, 02:03:06 AM
Hi SamK
You could change the link from bootlocal and use a persistent /opt.
Title: Re: TC4.1 Change Default Selection to Reboot on Exit?
Post by: SamK on December 08, 2011, 03:19:17 AM
Hi Rich
You could change the link from bootlocal and use a persistent /opt.
If I understand your suggestion correctly it would mean that it is not possible to shutdown the machine in the standard TC GUI manner.  This may lead to some confusion for the users.

I have changed the title of the topic in an attempt to more accurately indicate the goal.
   
Title: Re: TC4.1 Force Reboot on Exit
Post by: Rich on December 08, 2011, 10:46:14 AM
Hi SamK
You understood correctly. My suggestion was based on remotely administrating a server and the
possible consequences of inadvertently shutting it down only, local users were not considered.
Without changing the source of exittc and recompiling, you will most likely have to resort to some
form of trickery to do what you want. The only other idea I have is to log in as a special user when
working remotely. Then modify the /opt/shutdown.sh script by adding a test to see if that is the
current user. If it is, then call /sbin/reboot. Add this to the very end of the script.
Title: Re: TC4.1 Change Default Selection to Reboot on Exit?
Post by: SamK on December 08, 2011, 11:35:36 AM
Hi Rich,
As suggested in reply #2, it might be that this turns out to be a feature request.  Perhaps it might attract the attention of the Devs.