WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: execution order of shutdown scripts  (Read 6415 times)

Offline AbNoRMiS

  • Hero Member
  • *****
  • Posts: 550
  • nothing can be impeccable in this imperfect world
    • @ß№®M!$
execution order of shutdown scripts
« on: May 17, 2012, 11:37:56 AM »
which now execution order of shutdown scripts?
if i'm not mistaken then execution order the following
Code: [Select]
/usr/local/bin/exittc -> filetool.sh {-b|-s} -> exitcheck.sh -> ( /opt/shutdown.sh && sudo {reboot|poweroff} )
but seems that /opt/shutdown.sh should start before filetool.sh ?

and possible that shutdown procedure should be such?
Code: [Select]
/usr/local/bin/exittc -> /opt/shutdown.sh -> filetool.sh {-b|-s} -> exitcheck.sh -> ( sudo {reboot|poweroff} )
Basic Design Concept © @ß№®M!$
please forgive my terrible english :)

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: execution order of shutdown scripts
« Reply #1 on: May 17, 2012, 02:48:31 PM »
Because of the possibility of errors. Typically one exits via the GUI exittc. That GUI tries to perform the shutdown with a backup when so selected. If errors occur a pop is displayed which requires X and typically the user is more comfortable in X to correct. It has served well since 2006.
10+ Years Contributing to Linux Open Source Projects.

Offline AbNoRMiS

  • Hero Member
  • *****
  • Posts: 550
  • nothing can be impeccable in this imperfect world
    • @ß№®M!$
Re: execution order of shutdown scripts
« Reply #2 on: May 17, 2012, 05:53:31 PM »
probably i again could not clearly explain what i meant
Code: [Select]
/usr/local/bin/exittc -> filetool.sh {-b|-s} -> exitcheck.sh -> ( /opt/shutdown.sh && sudo {reboot|poweroff} )
i meant that first through gui /usr/local/bin/exittc starts filetool.sh
which back up with the necessary include and exclude lists
and only after backing up begins running /opt/shutdown.sh
which contain an user shutdown commands
whether it makes sense to run these commands after backup?
then i probably not quite understood in which cases it need

p.s.
by the way, earlier if .filetool.lst
contained a file or folder that did not exist
then pop up error warning and backup stopped
but now these errors are not handled

« Last Edit: May 17, 2012, 07:15:39 PM by AbNoRMiS »
Basic Design Concept © @ß№®M!$
please forgive my terrible english :)

Offline AbNoRMiS

  • Hero Member
  • *****
  • Posts: 550
  • nothing can be impeccable in this imperfect world
    • @ß№®M!$
Re: execution order of shutdown scripts
« Reply #3 on: May 17, 2012, 06:22:40 PM »
and yet i did not understood why directly before command reboot|poweroff
need to do loop through valid users to clean up if no backup of home was done
which is performed in the script /opt/shutdown.sh called from exitcheck.sh
or it is made for persistent home directory?
« Last Edit: May 17, 2012, 06:28:43 PM by AbNoRMiS »
Basic Design Concept © @ß№®M!$
please forgive my terrible english :)

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: execution order of shutdown scripts
« Reply #4 on: May 17, 2012, 09:10:30 PM »
You answered your own question. It supports the very dynamic nature of this embedded distro whether doing a backup or using a persistent home.
10+ Years Contributing to Linux Open Source Projects.

Offline AbNoRMiS

  • Hero Member
  • *****
  • Posts: 550
  • nothing can be impeccable in this imperfect world
    • @ß№®M!$
Re: execution order of shutdown scripts
« Reply #5 on: May 18, 2012, 04:08:52 AM »
is it possible to execute a user shutdown commands before backup in case when non-resistant home directory?
such commands as for example completion of apache and mysql sessions
Basic Design Concept © @ß№®M!$
please forgive my terrible english :)

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: execution order of shutdown scripts
« Reply #6 on: May 18, 2012, 05:08:19 AM »
I could be wrong, but I believe "sudo poweroff" does not perform a backup.?  But haven't test that theory much..

Offline AbNoRMiS

  • Hero Member
  • *****
  • Posts: 550
  • nothing can be impeccable in this imperfect world
    • @ß№®M!$
Re: execution order of shutdown scripts
« Reply #7 on: May 18, 2012, 06:29:06 AM »
sudo poweroff launches the system script /etc/init.d/rc.shutdown
which syncs filesystems, kills processes, unmounts tcz extensions
and removes tcz extensions marked for deletion
« Last Edit: May 18, 2012, 06:31:38 AM by AbNoRMiS »
Basic Design Concept © @ß№®M!$
please forgive my terrible english :)

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: execution order of shutdown scripts
« Reply #8 on: May 18, 2012, 06:48:00 AM »
cool, so it looks like the right tool :)  unless I missed point..  I'v been good at that today  http://forum.tinycorelinux.net/Smileys/default/shocked.gif

Offline AbNoRMiS

  • Hero Member
  • *****
  • Posts: 550
  • nothing can be impeccable in this imperfect world
    • @ß№®M!$
Re: execution order of shutdown scripts
« Reply #9 on: May 18, 2012, 07:10:05 AM »
is it possible to execute a user shutdown commands before backup in case when non-resistant home directory?
such commands as for example completion of apache and mysql sessions
particularly in addition to completion the apache and mysql sessions before backuping
such as for example executing user command to make a separate backup of server working directory
Code: [Select]
sudo lampp stop && sudo busybox tar -C / -czf /etc/sysconfig/tcedir/mylampp.tgz /opt/lampp/* && sudo rm -rf /opt/lamppsomehow it can be done before doing backup?
« Last Edit: May 18, 2012, 11:15:35 AM by AbNoRMiS »
Basic Design Concept © @ß№®M!$
please forgive my terrible english :)