Pull request for branch for-2012.02/shutdown
Hi list,
This is an update of the previous patch rework the shutdown policy by calling the stop function of init scripts.
I also added a mention of such a behaviour in the changes file so that users can notice it.
Maxime
The following changes since commit 68902f743729b3482bb6bc2ae9d0306aa9c00f65:
ti-utils: unbreak build after libnl version bump (2011-12-26 19:33:43 +0100)
are available in the git repository at:
http://free-electrons.com/~maxime/git/buildroot.git for-2012.02/shutdown
Maxime Ripard (2):
Rework of shutdown policy in inittab Update the CHANGES file to mention this new policy
CHANGES | 3 +++ fs/skeleton/etc/init.d/rcK | 27 +++++++++++++++++++++++++++ fs/skeleton/etc/inittab | 3 +-- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100755 fs/skeleton/etc/init.d/rcK
Thanks,
Signature · 1 line
Maxime Ripard
PATCH 1/2 Rework of shutdown policy in inittab
This commit follows commit ad501b66. Start up of the busybox logging daemons were moved to an init script but the shutdown were still performed in inittab. This commit moves the shutdown policy to an rcK script that calls the stop function of all the init scripts in a reversed order.
--- fs/skeleton/etc/init.d/rcK | 27 +++++++++++++++++++++++++++ fs/skeleton/etc/inittab | 3 +-- 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100755 fs/skeleton/etc/init.d/rcK
fs/skeleton/etc/init.d/rcK new file +27 -0
@@ -0,0 +1,27 @@ +#!/bin/sh + + +# Stop all init scripts in /etc/init.d +# executing them in reversed numerical order. +# +for i in $(ls -r /etc/init.d/S??*) ;do + + # Ignore dangling symlinks (if any). + [ ! -f "$i" ] && continue + + case "$i" in + *.sh) + # Source shell script for speed. + ( + trap - INT QUIT TSTP + set stop + . $i + ) + ;; + *) + # No sh extension, so fork subprocess. + $i stop + ;; + esac +done +
fs/skeleton/etc/inittab +1 -2
@@ -30,8 +30,7 @@ null::sysinit:/bin/hostname -F /etc/hostname ::ctrlaltdel:/sbin/reboot # Stuff to do before rebooting -null::shutdown:/usr/bin/killall klogd -null::shutdown:/usr/bin/killall syslogd +null::shutdown:/etc/init.d/rcK null::shutdown:/bin/umount -a -r null::shutdown:/sbin/swapoff -a
Signature · 1 line
1.7.4.1
PATCH 1/2 Rework of shutdown policy in inittab
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Maxime" == Maxime Ripard <[email protected]> writes:
Maxime> This commit follows commit ad501b66. Start up of the busybox logging Maxime> daemons were moved to an init script but the shutdown were still Maxime> performed in inittab. This commit moves the shutdown policy to an Maxime> rcK script that calls the stop function of all the init scripts in Maxime> a reversed order.
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 2/2 Update the CHANGES file to mention this new policy
In reply to Maxime Ripard--- CHANGES | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
CHANGES +3 -0
@@ -10,6 +10,9 @@ uClibc: remove 0.9.30, backport unshare() support. + Buildroot now calls the stop function of scripts in /etc/init.d at + shutdown. + Updated/fixed packages: barebox, bash, binutils, bison, coreutils, dbus-glib, diffutils, dropbear, ebtables, ffmpeg, flex, fluxbox, gawk, grep, gst-dsp, gst-ffmpeg, htop,
Signature · 1 line
1.7.4.1
PATCH 2/2 Update the CHANGES file to mention this new policy
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Maxime" == Maxime Ripard <[email protected]> writes:
Maxime> Signed-off-by: Maxime Ripard <[email protected]> Maxime> ---
Maxime> CHANGES | 3 +++
Maxime> 1 files changed, 3 insertions(+), 0 deletions(-)
Maxime> diff --git a/CHANGES b/CHANGES
Maxime> index 515e3db..5c1e9c9 100644
Maxime> --- a/CHANGES
Maxime> +++ b/CHANGES
Maxime> @@ -10,6 +10,9 @@
Maxime> uClibc: remove 0.9.30, backport unshare() support.
Maxime> + Buildroot now calls the stop function of scripts in /etc/init.d at
Maxime> + shutdown.
Thanks. In general I prefer to maintain CHANGES myself, as we otherwise easily get merge conflicts (like now), but I've fixed up the conflict and committed.
Signature · 1 line
Bye, Peter Korsgaard