• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Scripts run at boot time and shutdown  (Read 2506 times)
birdman
Sr. Member
****

Karma: 4
Posts: 443


View Profile WWW
« on: November 30, 2009, 06:32:42 PM »

I noticed yesterday that my local filesystems were being fsck'ed at boot time (the ext2 one) and getting log replays (the ext3 ones).  It seems that they aren't being unmounted on shutdown.
I'm running the Ubuntu release, and it doesn't seem to use the same numbers for startup links that I'm used to.  The scripts have INIT info, which I presume is used.
However - I presume that the S* scripts are used to start and the K* ones used to stop services.
So I'm somewhat surprised to see umountfs, umountnfs.sh and umountroot linked into rc0.d and rc6.d with S01 prefixes, meaning they'll be run in "start" mode, which is a no-op!
Am I missing something obvious, or is the thing just setup incorrectly?   And if it's wrong, is there a recommended or correct command to use to fix things?
Logged

DamonHD
Full Member
***

Karma: 4
Posts: 169


View Profile WWW
« Reply #1 on: November 30, 2009, 06:48:36 PM »

I believe that the kernel will sync all mounted filesystems on shutdown (or when unmounted).

Rgds

Damon
Logged

fragfutter
Sr. Member
****

Karma: 12
Posts: 280


View Profile
« Reply #2 on: December 01, 2009, 01:02:16 AM »

Entering runlevel 0 (shutdown), a standard init would first execute all scripts linked as K* (in alphabetical order) with the parameter stop. Then it would execute all scripts linked as S* with parameter stop (exception for runlevel 0 and 6).


So unmountnfs will be executed afer all K* scripts and unmount  as expected.
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 443


View Profile WWW
« Reply #3 on: December 01, 2009, 03:36:39 PM »

So unmountnfs will be executed afer all K* scripts and unmount  as expected.
I came to that conclusion will mulling this over as I left work this evening.
However - it doesn't run those scripts.  It only runs the KU* ones.

This is what is sent to the console on a reboot:
Quote
The system is going down for reboot NOW!
root@plug:~# Stopping web server: cherokee      .
 * Saving the system clock
 * Stopping Postfix Mail Transport Agent postfix                         [ OK ]
 * Stopping internet superserver xinetd                                  [ OK ]
 * Will now restart
Restarting system.
No sign of "Deactivating swap" or "Unmounting local filesystems" - and on reboot I see:
Quote
* Checking file systems...
fsck 1.41.4 (27-Jan-2009)
PlugBoot was not cleanly unmounted, check forced.
PlugBoot: 14/24856 files (14.3% non-contiguous), 12708/99268 blocks
PlugLocal: recovering journal
PlugLocal: clean, 490/699008 files, 90465/2794243 blocks
fsck died with exit status 1
So, all the evidence is that the S* scripts don't get run.

Ahh!!!! I SEE THE PROBLEM!!!
rc0.d contains S01halt and rc6.d contain S01reboot, so nothing that sorts to be after those scripts will ever get run!!! That just happens to be all other S* scripts!
Isn't everybody in this position?  By that I mean anyone running Ubuntu - anywhere?  This strikes me as a fairly fundamental bug/problem.
Logged

cbxbiker61
Global Moderator
Sr. Member
*****

Karma: 38
Posts: 497


View Profile
« Reply #4 on: December 01, 2009, 03:56:26 PM »


Ahh!!!! I SEE THE PROBLEM!!!
rc0.d contains S01halt and rc6.d contain S01reboot, so nothing that sorts to be after those scripts will ever get run!!! That just happens to be all other S* scripts!
Isn't everybody in this position?  By that I mean anyone running Ubuntu - anywhere?  This strikes me as a fairly fundamental bug/problem.


I'm not sure what version/OS you're running but my sheeva is still using the distro it was packaged with.  My rc scripts are S90reboot  and S90halt.
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 443


View Profile WWW
« Reply #5 on: December 01, 2009, 06:25:16 PM »

I'm not sure what version/OS you're running but my sheeva is still using the distro it was packaged with.  My rc scripts are S90reboot  and S90halt.
I'm using the one from installer v1.0.  I've updated the kernel, but that won't affect the init scripts.  However - looking at the rootfs.tar.gz file that came with that it did have them as S90*.  And that's also what was written to my NAND flash (just checked).  So I must have done something to set the link numbers wrong.   No idea what, though.  I'm not aware of having done anything, apart from apt-get installs, which might have fiddled.
Anyway, it looks like it's just me with things to sort out (not difficult now I have a list of what should be there).
Thanks for helping me out.
Logged

Digmecy09
Guest
« Reply #6 on: December 09, 2009, 02:58:53 PM »

It seems I always have to go into the management area to find the server did not automatically start up again.
Logged

Pages: [1]
Print
Jump to: