Opened 9 years ago

Closed 9 years ago

Last modified 4 years ago

#5032 closed defect (fixed)

/etc/init.d/rcS doesn't wait for init scripts to finish

Reported by: ambro@… Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: base system Version: Trunk
Keywords: Cc:


/etc/init.d/rcS (from base-files) should wait for init scripts to finish, not just leave them running in the background (the '&' character at the end).

This is causing problems on system shutdown, as the system halts or reboots before everything is terminated, even before the root fs is unmounted (which leaves it in an inconsistent state, often while being written to).

Considering system boot, the console shell appears before booting is complete, and a useless "logger" process is left, consuming memory.

The '&' was added as a hack; without it boot will never finish as the subshell in /etc/init.d/rcS is waiting a shell job to complete. The shell job concerned is "hotplug2" in /etc/init.d/boot.

My patch fixes running hotplug2 so that a simple background process is created, not a shell job. This allows the subshell to terminate on startup, we can now safely wait for all init scripts.

Attachments (2)

openwrt-init-trunk.patch (936 bytes) - added by ambro@… 9 years ago.
openwrt-init2-trunk.patch (1.2 KB) - added by ambro@… 9 years ago.
fix, show shell early on boot

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by ambro@…


comment:1 Changed 9 years ago by ambro@…

It appears some users want the shell to appear immediately on boot. So here is a patch which explicitely leaves the scripts running in the background for startup only.

Changed 9 years ago by ambro@…

fix, show shell early on boot

comment:2 Changed 9 years ago by nbd

  • Resolution set to fixed
  • Status changed from new to closed

added in r15530

comment:3 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

as closed .
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.