WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: MicroCore and shutdown.sh  (Read 14098 times)

Offline batnas

  • Full Member
  • ***
  • Posts: 122
MicroCore and shutdown.sh
« 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

Offline Kingdomcome

  • Sr. Member
  • ****
  • Posts: 286
Re: MicroCore and shutdown.sh
« Reply #1 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.

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: MicroCore and shutdown.sh
« Reply #2 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'.

Offline batnas

  • Full Member
  • ***
  • Posts: 122
Re: MicroCore and shutdown.sh
« Reply #3 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
« Last Edit: May 14, 2010, 07:55:04 PM by batnas »

Offline cosmin_ap

  • Newbie
  • *
  • Posts: 48
Re: MicroCore and shutdown.sh
« Reply #4 on: May 11, 2011, 05:46:24 PM »
so no way to cleanly shutdown daemons in mc then?

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: MicroCore and shutdown.sh
« Reply #5 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.