Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Arjan Bouter (7c07cb76fb33c04f199973bdd31c0653e7ccc00d)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Arjan Bouter <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Arjan Bouter (7c07cb76fb33c04f199973bdd31c0653e7ccc00d)
  • Date: Fri, 11 Sep 2009 13:51:34 -0500

GIT changes to master grimoire by Arjan Bouter <abouter AT sourcemage.org>:

smgl/smgl-upstart/HISTORY | 3
smgl/smgl-upstart/INSTALL | 2
smgl/smgl-upstart/inittab.native | 7 -
smgl/smgl-upstart/upstart-init/native/README | 2
smgl/smgl-upstart/upstart-init/native/alsa.conf | 7 -
smgl/smgl-upstart/upstart-init/native/avahi.conf | 2
smgl/smgl-upstart/upstart-init/native/clamav.conf | 2
smgl/smgl-upstart/upstart-init/native/dbus.conf | 8 -
smgl/smgl-upstart/upstart-init/native/devices.conf | 15 +-
smgl/smgl-upstart/upstart-init/native/freshclam.conf | 2
smgl/smgl-upstart/upstart-init/native/gdm.conf | 2
smgl/smgl-upstart/upstart-init/native/hald.conf | 9 +
smgl/smgl-upstart/upstart-init/native/hostname.conf | 2
smgl/smgl-upstart/upstart-init/native/lighttpd.conf | 2
smgl/smgl-upstart/upstart-init/native/lvm.conf | 19 --
smgl/smgl-upstart/upstart-init/native/mount_all.conf | 118
++++++++++++++++--
smgl/smgl-upstart/upstart-init/native/mount_root.conf | 73 ++++++++++-
smgl/smgl-upstart/upstart-init/native/mpd.conf | 2
smgl/smgl-upstart/upstart-init/native/network.conf | 11 +
smgl/smgl-upstart/upstart-init/native/scripts/lvm.sh | 4
smgl/smgl-upstart/upstart-init/native/shutdown.conf | 11 +
smgl/smgl-upstart/upstart-init/native/slapd.conf | 2
smgl/smgl-upstart/upstart-init/native/syslog.conf | 6
smgl/smgl-upstart/upstart-init/native/tty1.conf | 3
smgl/smgl-upstart/upstart-init/native/tty2.conf | 4
smgl/smgl-upstart/upstart-init/native/xinetd.conf | 2
26 files changed, 244 insertions(+), 76 deletions(-)

New commits:
commit 74c3af111dfc549c1ab2a6e38a36ad7705df36e8
Author: Arjan Bouter <abouter AT sourcemage.org>
Commit: Arjan Bouter <abouter AT sourcemage.org>

smgl-upstart: added emits to avoid race conditions

diff --git a/smgl/smgl-upstart/HISTORY b/smgl/smgl-upstart/HISTORY
index fe229c4..a406a15 100644
--- a/smgl/smgl-upstart/HISTORY
+++ b/smgl/smgl-upstart/HISTORY
@@ -1,3 +1,6 @@
+2009-09-11 Arjan Bouter <abouter AT sourcemage.org>
+ * rewritten native scripts to emit events to avoid race conditions
+
2009-09-07 Arjan Bouter <abouter AT sourcemage.org>
* BUILD,DEPENDS,DETAILS,INSTALL,PRE_BUILD,upstart-init/*: created
spell
based on the upstart example scripts.
diff --git a/smgl/smgl-upstart/INSTALL b/smgl/smgl-upstart/INSTALL
index 7db4c4a..d4ff75a 100755
--- a/smgl/smgl-upstart/INSTALL
+++ b/smgl/smgl-upstart/INSTALL
@@ -1,4 +1,4 @@
UPSTART_DIR="${INSTALL_ROOT}/etc/init" &&
mkdir -p ${UPSTART_DIR} &&
-cp ${SCRIPT_DIRECTORY}/upstart-init/${UPSTART_INIT}/* ${UPSTART_DIR} &&
+cp -r ${SCRIPT_DIRECTORY}/upstart-init/${UPSTART_INIT}/* ${UPSTART_DIR} &&
install_config_file ${SCRIPT_DIRECTORY}/inittab.${UPSTART_INIT}
${INSTALL_ROOT}/etc/inittab
diff --git a/smgl/smgl-upstart/inittab.native
b/smgl/smgl-upstart/inittab.native
index ef2b240..ccb906e 100644
--- a/smgl/smgl-upstart/inittab.native
+++ b/smgl/smgl-upstart/inittab.native
@@ -1,15 +1,12 @@
-bootprog = rc
+#bootprog = rc
# change this to switch to your own upstart init-scripts
fileprefix = /etc/init
PATH = /sbin:/bin:/usr/sbin:/usr/bin
-INIT_PATH = smgl
+#INIT_PATH =

tty1:linux:/sbin/agetty /dev/tty1 9600
tty2:linux:/sbin/agetty /dev/tty2 9600
tty3:linux:/sbin/agetty /dev/tty3 9600
-tty4:linux:/sbin/agetty /dev/tty4 9600
-tty5:linux:/sbin/agetty /dev/tty5 9600
-tty6:linux:/sbin/agetty /dev/tty6 9600

finalprog =
quietrollback = yes
diff --git a/smgl/smgl-upstart/upstart-init/native/README
b/smgl/smgl-upstart/upstart-init/native/README
index e35c15d..7359d10 100644
--- a/smgl/smgl-upstart/upstart-init/native/README
+++ b/smgl/smgl-upstart/upstart-init/native/README
@@ -3,7 +3,7 @@ Some useful things to know about upstart on smgl
- The jobs upstart knows about are in the *.conf files, one file per
service/daemon/task/job
- The jobs MAY NOT FAIL, or the entire boot process is halted...
- use a script in the scripts dir and a job pointing to it when a job can
fail and make sure the script exits cleanly
-- daemons shouldn't disassociate themselves from the invoking tty if upstart
it to track them
+- if a job needs to emit a signal, name it <jobname>-start or <jobname>-stop
for consistency

feel free to post bugs with additional jobs on http://bugs.sourcemage.org
and assign them to abouter AT sourcemage.org
I'll get to them eventually, or just put them in the spell yourself if you
have git access ;)
diff --git a/smgl/smgl-upstart/upstart-init/native/alsa.conf
b/smgl/smgl-upstart/upstart-init/native/alsa.conf
index e044a98..def66bf 100644
--- a/smgl/smgl-upstart/upstart-init/native/alsa.conf
+++ b/smgl/smgl-upstart/upstart-init/native/alsa.conf
@@ -5,7 +5,7 @@
description "Restore alsa settings"
author "Arjan Bouter <abouter AT sourcemage.org>"

-start on started mount_all
+start on mount_all-start
stop on shutdown

emits alsa-start alsa-stop
@@ -13,9 +13,9 @@ emits alsa-start alsa-stop
task

script
- . /etc/sysconfig/alsa
+ [ -e /etc/sysconfig/alsa ] && . /etc/sysconfig/alsa
declare -r ASOUNDCFG=/etc/asound.state
- [[ "$START_ALSA" == no ]] && exit 0
+ [[ "$START_ALSA" == no ]] && return 0
if [[ -d /proc/asound ]]; then
if ! [[ -r "$ASOUNDCFG" ]]; then
echo "No mixer config in $ASOUNDCFG, you have to unmute your card!"
@@ -23,4 +23,5 @@ script
/usr/sbin/alsactl -f $ASOUNDCFG restore
fi
fi
+ initctl emit alsa-start
end script
diff --git a/smgl/smgl-upstart/upstart-init/native/avahi.conf
b/smgl/smgl-upstart/upstart-init/native/avahi.conf
index bdbd9ce..2fc2c17 100644
--- a/smgl/smgl-upstart/upstart-init/native/avahi.conf
+++ b/smgl/smgl-upstart/upstart-init/native/avahi.conf
@@ -5,7 +5,7 @@
description "Enable avahi-daemon"
author "Arjan Bouter <abouter AT sourcemage.org>"

-start on started syslog and network-up
+start on syslog-start and network-start
stop on shutdown

exec /usr/sbin/avahi-daemon -s
diff --git a/smgl/smgl-upstart/upstart-init/native/clamav.conf
b/smgl/smgl-upstart/upstart-init/native/clamav.conf
index fe8f580..b3d72de 100644
--- a/smgl/smgl-upstart/upstart-init/native/clamav.conf
+++ b/smgl/smgl-upstart/upstart-init/native/clamav.conf
@@ -7,7 +7,7 @@ author "Arjan Bouter <abouter AT sourcemage.org>"

emits clamav-started clamav-stopped

-start on network-up and started syslog
+start on network-start and syslog-start
stop on shutdown

exec /usr/sbin/clamd
diff --git a/smgl/smgl-upstart/upstart-init/native/dbus.conf
b/smgl/smgl-upstart/upstart-init/native/dbus.conf
index 4001878..4f4d899 100644
--- a/smgl/smgl-upstart/upstart-init/native/dbus.conf
+++ b/smgl/smgl-upstart/upstart-init/native/dbus.conf
@@ -7,8 +7,7 @@ author "Arjan Bouter <abouter AT sourcemage.org>"

emits dbus-start dbus-stop

-#start on started devices
-start on started mount_all
+start on mount_all-start
stop on shutdown

pre-start script
@@ -16,7 +15,8 @@ pre-start script
end script

script
-# [[ -e /var/run/dbus/pid ]] && rm /var/run/dbus/*
- dbus-daemon --system --nofork
+ [ -e /var/run/dbus/pid ] && rm -rf /var/run/dbus/*
+ dbus-daemon --system
dbus-uuidgen --ensure
+ initctl emit dbus-start
end script
diff --git a/smgl/smgl-upstart/upstart-init/native/devices.conf
b/smgl/smgl-upstart/upstart-init/native/devices.conf
index a045dd8..427adcc 100644
--- a/smgl/smgl-upstart/upstart-init/native/devices.conf
+++ b/smgl/smgl-upstart/upstart-init/native/devices.conf
@@ -6,15 +6,18 @@
description "Populates /dev"
author "Arjan Bouter <abouter AT sourcemage.org>"

-#start on started mount_root
+start on mount_root-start
stop on shutdown

+emits devices-start
+
task

-script
- . /etc/sysconfig/devices
+script
+ [ -e /etc/sysconfig/devices ] && . /etc/sysconfig/devices
case $DEVICES in
- udev) mount -t tmpfs dev /dev
+ udev) echo "using udev to manage /dev"
+ mount -t tmpfs dev /dev
ln -s /proc/self/fd /dev/fd
ln -s /dev/fd/0 /dev/stdin
ln -s /dev/fd/1 /dev/stdout
@@ -25,8 +28,10 @@ script
mount -t devpts devpts /dev/pts
udevd --daemon
udevadm trigger
- udevadm settle ;;
+ udevadm settle --quiet
+ echo "done starting udev" ;;
static) echo "static /dev nothing to do" ;;
*) echo "unsupported /dev system, aborting" ;;
esac
+ initctl emit devices-start
end script
diff --git a/smgl/smgl-upstart/upstart-init/native/freshclam.conf
b/smgl/smgl-upstart/upstart-init/native/freshclam.conf
index caf8cba..ed678c4 100644
--- a/smgl/smgl-upstart/upstart-init/native/freshclam.conf
+++ b/smgl/smgl-upstart/upstart-init/native/freshclam.conf
@@ -5,7 +5,7 @@
description "Start Freshclam, the Clamav updater"
author "Arjan Bouter <abouter AT sourcemage.org>"

-start on network-up and started syslog
+start on network-start and syslog-start
stop on shutdown

exec /usr/bin/freshclam -d
diff --git a/smgl/smgl-upstart/upstart-init/native/gdm.conf
b/smgl/smgl-upstart/upstart-init/native/gdm.conf
index 76d04b2..abb7d40 100644
--- a/smgl/smgl-upstart/upstart-init/native/gdm.conf
+++ b/smgl/smgl-upstart/upstart-init/native/gdm.conf
@@ -5,7 +5,7 @@
description "Start GDM"
author "Arjan Bouter <abouter AT sourcemage.org>"

-start on started hald
+start on hald-start
stop on shutdown

exec /usr/sbin/gdm
diff --git a/smgl/smgl-upstart/upstart-init/native/hald.conf
b/smgl/smgl-upstart/upstart-init/native/hald.conf
index 6fcdca3..1376314 100644
--- a/smgl/smgl-upstart/upstart-init/native/hald.conf
+++ b/smgl/smgl-upstart/upstart-init/native/hald.conf
@@ -5,7 +5,12 @@
description "Start a hald demon"
author "Arjan Bouter <abouter AT sourcemage.org>"

-start on network-up
+start on network-start
stop on shutdown

-exec /usr/sbin/hald --daemon=no
+emits hald-start hald-stop
+
+script
+ /usr/sbin/hald
+ initctl emit hald-start
+end script
diff --git a/smgl/smgl-upstart/upstart-init/native/hostname.conf
b/smgl/smgl-upstart/upstart-init/native/hostname.conf
index d124651..9ac58bc 100644
--- a/smgl/smgl-upstart/upstart-init/native/hostname.conf
+++ b/smgl/smgl-upstart/upstart-init/native/hostname.conf
@@ -5,7 +5,7 @@
description "Sets hostname"
author "Arjan Bouter <abouter AT sourcemage.org>"

-start on started devices
+start on devices-start
stop on shutdown

task
diff --git a/smgl/smgl-upstart/upstart-init/native/lighttpd.conf
b/smgl/smgl-upstart/upstart-init/native/lighttpd.conf
index bc664c3..455bc54 100644
--- a/smgl/smgl-upstart/upstart-init/native/lighttpd.conf
+++ b/smgl/smgl-upstart/upstart-init/native/lighttpd.conf
@@ -5,7 +5,7 @@
description "Start lighttpd"
author "Arjan Bouter <abouter AT sourcemage.org>"

-start on network-up and started syslog
+start on network-start and syslog-start
stop on shutdown

exec /usr/sbin/lighttpd -D -f /etc/lighttpd.conf
diff --git a/smgl/smgl-upstart/upstart-init/native/lvm.conf
b/smgl/smgl-upstart/upstart-init/native/lvm.conf
deleted file mode 100644
index 2e8776c..0000000
--- a/smgl/smgl-upstart/upstart-init/native/lvm.conf
+++ /dev/null
@@ -1,19 +0,0 @@
-# lvm
-#
-# scans and activates any LVM partitions
-
-description "Find and enable LVM"
-author "Arjan Bouter <abouter AT sourcemage.org>"
-
-#start on started devices
-stop on shutdown
-
-emits lvm-start lvm-stop
-
-task
-console output
-
-script
- vgscan
- vgchange -ay
-end script
diff --git a/smgl/smgl-upstart/upstart-init/native/mount_all.conf
b/smgl/smgl-upstart/upstart-init/native/mount_all.conf
index fa1d12a..2776c69 100644
--- a/smgl/smgl-upstart/upstart-init/native/mount_all.conf
+++ b/smgl/smgl-upstart/upstart-init/native/mount_all.conf
@@ -1,15 +1,119 @@
-# mountall
+# mount_all
#
-# mounts everything in /etc/fstab
+# mount local filesystems
+# based on the init.d init scripts

-description "Mount filesystems from /etc/fstab"
+description "Mounts local filesystems"
author "Arjan Bouter <abouter AT sourcemage.org>"

-#start on started devices
-#start on started lvm
+start on devices-start
stop on shutdown

-emits filesystems-mounted
+emits mount_all-start
+
task
+console output
+
+script
+
+ [ -e /etc/sysconfig/init ] && . /etc/sysconfig/init
+ [ -e /etc/sysconfig/mountall ] && . /etc/sysconfig/mountall
+
+ # find devices that were set up in initramfs/rd
+ if [ -x /sbin/dmsetup ]; then
+ echo "(re)Creating device mapper nodes..."
+ # won't check retval because kernel just may lack device mapper
+ dmsetup mknodes || echo "failed (re)creating nodes"
+ fi
+
+ if [ -x /sbin/vgscan ] && [ -x /sbin/vgchange ]; then
+ echo "Scanning for and initializing all available LVM volume groups..."
+ /sbin/vgscan --ignorelockingfailure --mknodes
+ /sbin/vgchange -ay --ignorelockingfailure
+ fi
+
+# if [ -x /usr/sbin/cryptsetup ] && [ -f /etc/crypttab ]; then
+# echo "Attempting to open luks encrypted partitions"
+# grep -v '^#' /etc/crypttab |
+# grep -v '^$' |
+# while read line
+# do
+# if [ -z "$line" ]; then
+# echo "empty crypttab, skipping"
+# else
+# parts=( $line )
+# echo "Opening ${parts[0]} as ${parts[1]}"
+# if cryptsetup isLuks ${parts[0]}; then
+# if [[ -b /dev/mapper/${parts[1]} ]]; then
+# builtin echo "Device already exists maybe its open already"
+# else
+# cryptsetup luksOpen ${parts[0]} ${parts[1]} < /dev/console >
/dev/console 2>&1
+# fi
+# else
+# builtin echo "Error device ${parts[0]} isn't a luks partition"
+# fi
+# fi
+# done
+# fi
+
+ [ -e /fastboot ] && return
+ [ -e /forcefsck ] && FORCE="-f"
+ [ "$NOSOFTFIX" != yes ] && FIX="-a"
+ [ "$FSCKFIX" = yes ] && FIX="-y"
+ [ -z "$FIX" ] && FIX="-n" # need at least -n, -y, or -a for
non-tty fsck
+ [ "$FORCE" = yes ] && FORCE="-f"
+
+ echo "Checking file systems..."
+ fsck -T -C -A -R $FIX $FORCE
+ if [ $? -gt 1 ]; then
+ $WARNING
+ echo "fsck failed."
+ echo "Please repair your file system"
+ echo "manually by running /sbin/fsck"
+ echo "without the -a option"
+ $NORMAL
+ /sbin/sulogin
+ /sbin/reboot -f
+ fi
+
+ [ -e /fastboot ] && rm -f /fastboot
+ [ -e /forcefsck ] && rm -f /forcefsck
+
+ if [ -x /sbin/swapon ]; then
+ echo "Activating swap... "
+ swapon -a
+ fi
+
+ echo "Mounting local filesystems..."
+# Fixed so as to not mount networked filesystems yet (no networking)
+# mountnetwork.sh will take care of this.
+ mount -a -t nocifs,noncpfs,nonfs,nosmbfs,notmpfs,no9p
+# mount tmpfs mounts after physical partitions they might mount to (bug 3597)
+ mount -a -t tmpfs
+
+ # bug 7311 - if proc was mounted, list it in mtab; awk is /usr friendly
+ if awk 'BEGIN{proc=1} /\/proc/{proc=0} END{exit proc}' /proc/mounts; then
+ builtin echo 'none /proc proc rw 0 0' >> /etc/mtab
+ fi
+
+#As per FHS sm bug #10509
+#FIXME: doing this here kills upstart... fix this bug again later...
+# echo "Cleaning out /var/run..."
+# [ -d /var/run ] && rm -rf /var/run/*
+
+# if [ "$CLEAN_TMP" == "yes" ] ; then
+# echo "Cleaning out /tmp..."
+# [ -d /tmp ] && shopt -s dotglob && rm -rf /tmp/* && shopt -u dotglob
+# fi
+
+ echo "Creating /var/run/utmp..."
+ [ -d /var/run ] && touch /var/run/utmp
+
+ echo "Writing dmesg log to /var/log/dmesg..."
+ [ -d /var/log ] && dmesg > /var/log/dmesg
+
+# echo "Making /tmp/.ICE-unix temporary directory..."
+# [ -d /tmp ] && mkdir -p /tmp/.ICE-unix && chmod 1777 /tmp/.ICE-unix

-exec mount -a
+ initctl emit mount_all-start
+end script
diff --git a/smgl/smgl-upstart/upstart-init/native/mount_root.conf
b/smgl/smgl-upstart/upstart-init/native/mount_root.conf
index b5dd89e..eb50886 100644
--- a/smgl/smgl-upstart/upstart-init/native/mount_root.conf
+++ b/smgl/smgl-upstart/upstart-init/native/mount_root.conf
@@ -1,25 +1,88 @@
# mount_root
#
# mount root filesystem and pseudo filesystems
+# based on the init.d init scripts

description "Mounts rootfs and various pseudo filesystems"
author "Arjan Bouter <abouter AT sourcemage.org>"

-#start on startup
+start on startup
stop on shutdown

-emits rootfs-mounted rootfs-unmounted
+emits mount_root-start mount_rootfs-stop

task
console output

script
- mount -o remount,rw /
- #cleaning up a bit
- rm /etc/mtab
+ [ -e /etc/sysconfig/init ] && . /etc/sysconfig/init
+
+ # proc and sys are needed for scanlvm
mount -t proc proc /proc
mount -t sysfs sysfs /sys
+
+ # find devices that were set up in initramfs/rd
+ if [ -x /sbin/dmsetup ]; then
+ echo "(re)Creating device mapper nodes..."
+ # won't check retval because kernel just may lack device mapper
+ /sbin/dmsetup mknodes
+ else
+ echo "Not running dmsetup"
+ fi
+
+ if [ -x /sbin/vgscan ] && [ -x /sbin/vgchange ]; then
+ echo "Scanning for and initializing all available LVM volume groups..."
+ /sbin/vgscan --ignorelockingfailure --mknodes &&
+ /sbin/vgchange -ay --ignorelockingfailure
+ else
+ echo "Not starting LVM"
+ fi
+
+ if [ -f /etc/mdadm.conf ] ; then
+ echo "Running mdadm"
+ mdadm --assemble --scan
+ mdadm --follow --scan --delay=120 --daemonise >
/var/run/mdadm.pid
+ elif [ -f /etc/raidtab ] ; then
+ echo "Running raidstart"
+ raidstart --all
+ else
+ echo "Not auto-starting RAID"
+ fi
+
+ echo "Mounting root file system read only..."
+ mount -n -o remount,ro /
+
+ echo "Checking rootfs"
+ [ -e /fastboot ] && return
+ [ -e /forcefsck ] && FORCE="-f"
+ [ "$NOSOFTFIX" != yes ] && FIX="-a"
+ [ "$FSCKFIX" = yes ] && FIX="-y"
+ [ -z "$FIX" ] && FIX="-n" # need at least -n, -y, or -a for
non-tty fsck
+ [ "$FORCE" = yes ] && FORCE="-f"
+
+ echo "Checking root file system..."
+ /sbin/fsck -T -C $FIX $FORCE /
+ if [ $? -gt 1 ]; then
+ $WARNING
+ echo "fsck failed."
+ echo "Please repair your file system"
+ echo "manually by running /sbin/fsck"
+ echo "without the -a option"
+ $NORMAL
+ /sbin/sulogin
+ /sbin/reboot -f
+ fi
+
+ echo "Mounting root file system read/write..."
+ mount -n -o remount,rw /
+ if ! [ -h /etc/mtab ]; then
+ builtin echo > /etc/mtab
+ fi
+ mount -f -o remount,rw /
+
mount -t tmpfs lock /var/lock
mount -t tmpfs run /var/run
mount -t tmpfs tmp /tmp
+ echo "done mounting rootfs"
+ initctl emit mount_root-start
end script
diff --git a/smgl/smgl-upstart/upstart-init/native/mpd.conf
b/smgl/smgl-upstart/upstart-init/native/mpd.conf
index 879834c..0d91216 100644
--- a/smgl/smgl-upstart/upstart-init/native/mpd.conf
+++ b/smgl/smgl-upstart/upstart-init/native/mpd.conf
@@ -5,7 +5,7 @@
description "Start Music Player Daemon"
author "Arjan Bouter <abouter AT sourcemage.org>"

-start on network-up and started alsa and started syslog
+start on network-start and alsa-start and syslog-start
stop on shutdown

script
diff --git a/smgl/smgl-upstart/upstart-init/native/network.conf
b/smgl/smgl-upstart/upstart-init/native/network.conf
index 2397533..1c7fc42 100644
--- a/smgl/smgl-upstart/upstart-init/native/network.conf
+++ b/smgl/smgl-upstart/upstart-init/native/network.conf
@@ -5,10 +5,10 @@
description "Start networking"
author "Arjan Bouter <abouter AT sourcemage.org>"

-start on started dbus
+start on dbus-start
stop on shutdown

-emits network-up network-down
+emits network-start

console output

@@ -16,8 +16,11 @@ script
ifconfig lo 127.0.0.1
. /etc/sysconfig/facilities
case $network in
- wicd) /usr/sbin/wicd ;;
- network) ifup -a ;;
+ wicd) echo "using wicd to manage your network"
+ /usr/sbin/wicd ;;
+ network) echo "using ifup -a to bring up networking"
+ ifup -a ;;
*) echo "unknown network provider, aborting" ;;
esac
+ initctl emit network-start
end script
diff --git a/smgl/smgl-upstart/upstart-init/native/scripts/lvm.sh
b/smgl/smgl-upstart/upstart-init/native/scripts/lvm.sh
deleted file mode 100755
index 8df7081..0000000
--- a/smgl/smgl-upstart/upstart-init/native/scripts/lvm.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-vgscan
-vgchange -ay
diff --git a/smgl/smgl-upstart/upstart-init/native/shutdown.conf
b/smgl/smgl-upstart/upstart-init/native/shutdown.conf
index b418a86..57603c8 100644
--- a/smgl/smgl-upstart/upstart-init/native/shutdown.conf
+++ b/smgl/smgl-upstart/upstart-init/native/shutdown.conf
@@ -6,15 +6,22 @@ description "Shutdown"
author "Arjan Bouter <abouter AT sourcemage.org>"

start on shutdown
-stop on startup
+#stop on startup

task
console output

script
for running_job in $(initctl list|grep running|awk -F' ' '{print $1}'); do
- stop $running_job
+ if [[ "$running_job" = 'tty1' ]]; then
+ echo "leave tty1 running, just in case..."
+ else
+ stop $running_job
+ fi
done
+ echo "signalling everything else to stop"
+ initctl emit shutdown
+ echo "unmounting filesystems"
umount -a
sync
echo "powering off"
diff --git a/smgl/smgl-upstart/upstart-init/native/slapd.conf
b/smgl/smgl-upstart/upstart-init/native/slapd.conf
index fadb04a..5f7ca91 100644
--- a/smgl/smgl-upstart/upstart-init/native/slapd.conf
+++ b/smgl/smgl-upstart/upstart-init/native/slapd.conf
@@ -5,7 +5,7 @@
description "Start OpenLDAP slapd"
author "Arjan Bouter <abouter AT sourcemage.org>"

-start on network-up and started syslog
+start on network-up and syslog-start
stop on shutdown

script
diff --git a/smgl/smgl-upstart/upstart-init/native/syslog.conf
b/smgl/smgl-upstart/upstart-init/native/syslog.conf
index 6defcf9..086760e 100644
--- a/smgl/smgl-upstart/upstart-init/native/syslog.conf
+++ b/smgl/smgl-upstart/upstart-init/native/syslog.conf
@@ -5,7 +5,7 @@
description "Start and enable a syslog daemon"
author "Arjan Bouter <abouter AT sourcemage.org>"

-start on started mount_all
+start on filesystems-mounted
stop on shutdown

emits syslog-start syslog-stop
@@ -13,7 +13,9 @@ emits syslog-start syslog-stop
script
. /etc/sysconfig/facilities
case $syslog in
- smgl-metalog) metalog ;;
+ smgl-metalog) echo "Starting metalog"
+ initctl emit syslog-start
+ metalog ;;
*) echo "unknown syslog provider, aborting" ;;
esac
end script
diff --git a/smgl/smgl-upstart/upstart-init/native/tty1.conf
b/smgl/smgl-upstart/upstart-init/native/tty1.conf
index fb0e15a..9bf1c8d 100644
--- a/smgl/smgl-upstart/upstart-init/native/tty1.conf
+++ b/smgl/smgl-upstart/upstart-init/native/tty1.conf
@@ -6,7 +6,8 @@
description "start agetty on tty1"
author "Arjan Bouter <abouter AT sourcemage.org>"

-start on started mount_all
+start on mount_root-start
+# let's keep a tty around for now ;)
#stop on shutdown

console owner
diff --git a/smgl/smgl-upstart/upstart-init/native/tty2.conf
b/smgl/smgl-upstart/upstart-init/native/tty2.conf
index b3eddd7..67d5971 100644
--- a/smgl/smgl-upstart/upstart-init/native/tty2.conf
+++ b/smgl/smgl-upstart/upstart-init/native/tty2.conf
@@ -6,8 +6,8 @@
description "start agetty on tty2"
author "Arjan Bouter <abouter AT sourcemage.org>"

-start on started avahi and started tty3
-stop on stopped avahi
+start on network-up
+stop on shutdown

console owner
respawn
diff --git a/smgl/smgl-upstart/upstart-init/native/xinetd.conf
b/smgl/smgl-upstart/upstart-init/native/xinetd.conf
index fef7368..f61ba03 100644
--- a/smgl/smgl-upstart/upstart-init/native/xinetd.conf
+++ b/smgl/smgl-upstart/upstart-init/native/xinetd.conf
@@ -5,7 +5,7 @@
description "Find and enable LVM"
author "Arjan Bouter <abouter AT sourcemage.org>"

-start on network-up and started syslog
+start on network-up and syslog-start
stop on shutdown

exec /usr/sbin/xinetd -dontfork



  • [SM-Commit] GIT changes to master grimoire by Arjan Bouter (7c07cb76fb33c04f199973bdd31c0653e7ccc00d), Arjan Bouter, 09/11/2009

Archive powered by MHonArc 2.6.24.

Top of Page