Tiny Core Linux

Tiny Core Base => Micro Core => Topic started by: batnas on May 14, 2010, 06:44:00 PM

Title: MicroCore and shutdown.sh
Post by: batnas on May 14, 2010, 06:44:00 PM
In TinyCore i have /opt/shutdown.sh running every time i shutdown the pc.

MicroCore does not. I fiddled around, and found that shutdown.sh is called from /usr/bin/exitcheck.
Exitcheck is again called from exittc. exittc is an X-program(the one when you click shutdown), and thereby not able to run in MC.

I have checked in MC 2.9, MC 3.0 Alpha3 and TC 3.0Alpha1

Soultion:
Either exitcheck should not be included in MC OR the exitcheck in MC should be called by some shutdown-script in MC

Am i completely wrong?? or does someone check this?

\\Batnas
Title: Re: MicroCore and shutdown.sh
Post by: Kingdomcome on May 14, 2010, 07:40:06 PM
Simple answer is to use exitcheck.sh as your shutdown/reboot command.  However beware that there is a small issue with only using exitcheck.sh to shut down, a backup is NOT performed, you must manually run "filetool.sh backup" before exitcheck.sh.

The cause of the issue is that at the top of exitcheck.sh the backup is only run if the file /tmp/do_backup is present, which is created by the exittc gui if the box is checked or the env var BACKUP = 1.  The problem here is that if X is not running, then the exittc gui cannot be run and /tmp/do_backup is not touched.
Title: Re: MicroCore and shutdown.sh
Post by: maro on May 14, 2010, 07:45:09 PM
Whilst I drafted a response in another thread I also just realized that '/opt/shutdown.sh' does not come into play for MC or people using sudo poweroff or sudo reboot. IIRC the '/etc/init.d/rc.shutdown' will still be executed in those cases and might be a better place from which to call '/opt/shutdown.sh'.
Title: Re: MicroCore and shutdown.sh
Post by: batnas on May 14, 2010, 07:53:07 PM
the '/etc/init.d/rc.shutdown' will still be executed in those cases and might be a better place from which to call '/opt/shutdown.sh'.

I do agree.
It is kinda silly to have the nice function, and not use it.

The idea of havin shutdown.sh is that it is executed every time the machine is shut down - whether using exittc, 'sudo reboot' or anything else.

\\Batnas
Title: Re: MicroCore and shutdown.sh
Post by: cosmin_ap on May 11, 2011, 05:46:24 PM
so no way to cleanly shutdown daemons in mc then?
Title: Re: MicroCore and shutdown.sh
Post by: danielibarnes on May 11, 2011, 07:26:51 PM
so no way to cleanly shutdown daemons in mc then?

Daemons are neither started nor stopped automatically in Tiny Core. If you compare the /etc/inittab file in TC vs. another distribution you will see runlevels are not used here -- they are ignored by busybox init. The /opt/bootlocal.sh and /opt/bootsync.sh files allow the user to coordinate the starting of daemons. As was noted in another thread, there is no hook for coordinating the shutdown of daemons currently aside from including your own script in /etc/inittab. The processes are simply killed.