From a3190ec48c5f7008922e247f264a26a749cace98 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 26 Mar 2009 10:07:50 +0100 Subject: [PATCH] initscripts: misc changes, bump to 2009-03. --HG-- extra : convert_revision : 97fb9127cb91659331f1574a19a8871fed30a0ab --- templates/initscripts/files/rc.d/checkfs | 49 ++++++++++--------- templates/initscripts/files/rc.d/cleartmp | 2 +- templates/initscripts/files/rc.d/locale | 14 +++--- templates/initscripts/files/rc.d/mountfs | 5 +- templates/initscripts/files/rc.d/network | 10 ++-- .../initscripts/files/rc.d/persistent_rules | 4 +- templates/initscripts/files/rc.d/random_seed | 2 +- templates/initscripts/files/rc.d/swap | 2 +- templates/initscripts/files/rc.d/sysclock | 2 +- templates/initscripts/files/rc.d/udev_events | 2 +- templates/initscripts/files/rc.shutdown | 17 ++++--- templates/initscripts/files/rc.subr | 6 +-- templates/initscripts/template | 2 +- 13 files changed, 60 insertions(+), 57 deletions(-) diff --git a/templates/initscripts/files/rc.d/checkfs b/templates/initscripts/files/rc.d/checkfs index 42d5404f1db..9eaf204c8cc 100755 --- a/templates/initscripts/files/rc.d/checkfs +++ b/templates/initscripts/files/rc.d/checkfs @@ -10,46 +10,48 @@ name="checkfs" start_cmd="checkfs_start" stop_cmd=":" -NETFS="nonfs,nonfs4,nosmbfs,nocifs,nocodafs,noncpfs,nosysfs,noshfs,nofuse,nofuseblk" +NETFS="nonfs,nonfs4,nosmbfs,nocifs,nocodafs,noncpfs,nosysfs,noshfs" +NETFS="$NETFS,nofuse,nofuseblk" checkfs_start() { - echo -n "=> Mounting root read-only... " + echo -n "Mounting root read-only... " mount -n -o remount,ro / show_rval FORCEFSCK= [ -f /forcefsck ] && FORCEFSCK="-- -f" - echo -n "=> Checking filesystems... " - if grep -qw quiet /proc/cmdline; then - fsck -A -T -C -a -t $NETFS $FORCEFSCK >/dev/null 2>&1 - else - fsck -A -T -C -a -t $NETFS $FORCEFSCK 2>/dev/null - fi + echo "Checking local filesystems... " + fsck -A -T -C -a -t $NETFS $FORCEFSCK 2>/dev/null fsckret=$? + echo if [ ${fsckret} -gt 1 ]; then echo "failed!" if [ $((${fsckret}&2)) -eq 2 ]; then echo - echo "********************** REBOOT REQUIRED *********************" - echo "* *" - echo "* The system will be rebooted automatically in 15 seconds. *" - echo "* *" - echo "************************************************************" + echo "************** REBOOT REQUIRED *************" echo - sleep 15 + echo " The system will be rebooted automatically" + echo " in 5 seconds." + echo + echo "********************************************" + echo + sleep 5 else echo - echo "***************** FILESYSTEM CHECK FAILED ****************" - echo "* *" - echo "* Please repair manually and reboot. Note that the root *" - echo "* file system is currently mounted read-only. To remount *" - echo "* it read-write type: mount -n -o remount,rw / *" - echo "* When you exit the maintenance shell the system will *" - echo "* reboot automatically. *" - echo "* *" - echo "************************************************************" + echo "********* FILESYSTEM CHECK FAILED ************" + echo + echo " Please repair manually and reboot. Note that" + echo " the root filesystem is currently mounted" + echo " read-only. To remount it read-write type:" + echo + echo " mount -n -o remount,rw /" + echo + echo " When you exit the maintenance shell the system" + echo " will reboot automatically." + echo + echo "************************************************" echo sulogin -p fi @@ -59,7 +61,6 @@ checkfs_start() reboot -f exit 0 fi - show_rval } load_rc_config $name diff --git a/templates/initscripts/files/rc.d/cleartmp b/templates/initscripts/files/rc.d/cleartmp index 6f3c0542913..4f66706c3d0 100755 --- a/templates/initscripts/files/rc.d/cleartmp +++ b/templates/initscripts/files/rc.d/cleartmp @@ -12,7 +12,7 @@ stop_cmd=":" cleartmp_start() { - echo -n "=> Clearing temporary files... " + echo -n "Clearing temporary files... " rm -f /etc/nologin &>/dev/null rm -f /etc/shutdownpid &>/dev/null diff --git a/templates/initscripts/files/rc.d/locale b/templates/initscripts/files/rc.d/locale index accd443ced4..a8b08356f01 100755 --- a/templates/initscripts/files/rc.d/locale +++ b/templates/initscripts/files/rc.d/locale @@ -19,35 +19,35 @@ locale_start() chmod 755 /etc/profile.d/locale.sh # Check if requested locale was already created - if $(locale -a|grep -q $LOCALE); then + if ! $(locale -a|grep -q $LOCALE.utf8); then [ ! -d /usr/lib/locale ] && mkdir -p /usr/lib/locale - echo -n "=> Building locale: $LOCALE... " - localedef -i ${LOCALE%.*} -f UTF-8 ${LOCALE} + echo -n "Building locale: $LOCALE... " + localedef -i ${LOCALE} -f UTF-8 ${LOCALE} show_rval fi # Set user defined locale [ -z "$LOCALE" ] && LOCALE="en_US" - echo -n "=> Setting locale: $LOCALE... " + echo -n "Setting locale: $LOCALE... " echo "export LANG=$LOCALE" >> /etc/profile.d/locale.sh show_rval if echo "$LOCALE" | grep -qi utf ; then if [ -n "$KEYMAP" ]; then - echo -n "=> Loading keyboard map: $KEYMAP... " + echo -n "Loading keyboard map: $KEYMAP... " loadkeys -q -u $KEYMAP show_rval fi else if [ -n "$KEYMAP" ]; then - echo -n "=> Loading keyboard map: $KEYMAP... " + echo -n "Loading keyboard map: $KEYMAP... " loadkeys -q $KEYMAP show_rval fi fi if [ -n "$CONSOLEFONT" ]; then - echo -n "=> Loading console font: $CONSOLEFONT... " + echo -n "Loading console font: $CONSOLEFONT... " # CONSOLEMAP in UTF-8 shouldn't be used if [ -n "$CONSOLEMAP" ] && echo "$LOCALE" | grep -qi utf ; then CONSOLEMAP="" diff --git a/templates/initscripts/files/rc.d/mountfs b/templates/initscripts/files/rc.d/mountfs index baaed525c47..f6398e87800 100755 --- a/templates/initscripts/files/rc.d/mountfs +++ b/templates/initscripts/files/rc.d/mountfs @@ -10,11 +10,12 @@ name="mountfs" start_cmd="mountfs_start" stop_cmd=":" -NETFS="nonfs,nonfs4,nosmbfs,nocifs,nocodafs,noncpfs,nosysfs,noshfs,nofuse,nofuseblk" +NETFS="nonfs,nonfs4,nosmbfs,nocifs,nocodafs,noncpfs,nosysfs" +NETFS="$NETFS,noshfs,nofuse,nofuseblk" mountfs_start() { - echo -n "=> Mounting local filesystems... " + echo -n "Mounting local filesystems... " mount -n -o remount,rw / rm -f /etc/mtab* # make sure / gets written to /etc/mtab diff --git a/templates/initscripts/files/rc.d/network b/templates/initscripts/files/rc.d/network index bccf9de7d36..674664656ad 100755 --- a/templates/initscripts/files/rc.d/network +++ b/templates/initscripts/files/rc.d/network @@ -21,7 +21,7 @@ network_start() { # set hostname, turn on network # - echo "=> Starting network." + echo "Starting network." # If $hostname is set, use it for my Internet name, # otherwise use /etc/myname @@ -30,7 +30,7 @@ network_start() hostname=$(cat /etc/myname) fi if [ -n "$hostname" ]; then - echo "=> Setting hostname: $hostname." + echo "Setting hostname: $hostname." hostname $hostname fi @@ -87,7 +87,7 @@ network_start() tmp="$net_interfaces" fi - echo -n '=> Configuring network interfaces:' + echo -n 'Configuring network interfaces:' for int in ${tmp}; do eval argslist=\$ifconfig_$int @@ -200,11 +200,11 @@ network_start() network_stop() { - echo "=> Stopping network." + echo "Stopping network." # down interfaces # - echo -n '=> Downing network interfaces:' + echo -n 'Downing network interfaces:' if [ "$net_interfaces" != NO ]; then if checkyesno auto_ifconfig; then tmp=$(ls /sys/class/net/eth*) diff --git a/templates/initscripts/files/rc.d/persistent_rules b/templates/initscripts/files/rc.d/persistent_rules index c26e17e0425..48ffccfaf69 100755 --- a/templates/initscripts/files/rc.d/persistent_rules +++ b/templates/initscripts/files/rc.d/persistent_rules @@ -14,13 +14,13 @@ persistent_start() { # Adding persistent network/cdrom generated rules if [ -f "/dev/.udev/tmp-rules--70-persistent-cd.rules" ]; then - echo -n "=> Adding persistent cdrom udev rules... " + echo -n "Adding persistent cdrom udev rules... " cat /dev/.udev/tmp-rules--70-persistent-cd.rules \ >> /etc/udev/rules.d/70-persistent-cd.rules show_rval fi if [ -f "/dev/.udev/tmp-rules--70-persistent-net.rules" ]; then - echo -n "=> Adding persistent network udev rules... " + echo -n "Adding persistent network udev rules... " cat /dev/.udev/tmp-rules--70-persistent-net.rules \ >> /etc/udev/rules.d/70-persistent-net.rules show_rval diff --git a/templates/initscripts/files/rc.d/random_seed b/templates/initscripts/files/rc.d/random_seed index c03555eee13..225e450430e 100755 --- a/templates/initscripts/files/rc.d/random_seed +++ b/templates/initscripts/files/rc.d/random_seed @@ -12,7 +12,7 @@ stop_cmd=":" rseed_start() { if [ -f /var/run/random-seed ]; then - echo -n "=> Initializing random seed... " + echo -n "Initializing random seed... " cat /var/run/random-seed >/dev/urandom show_rval fi diff --git a/templates/initscripts/files/rc.d/swap b/templates/initscripts/files/rc.d/swap index e5649485d1c..e3a89af8795 100755 --- a/templates/initscripts/files/rc.d/swap +++ b/templates/initscripts/files/rc.d/swap @@ -11,7 +11,7 @@ stop_cmd=":" swap_start() { - echo -n "=> Activating swap... " + echo -n "Activating swap... " swapon -a show_rval } diff --git a/templates/initscripts/files/rc.d/sysclock b/templates/initscripts/files/rc.d/sysclock index 3a78a1f190f..c4ed9193e9a 100755 --- a/templates/initscripts/files/rc.d/sysclock +++ b/templates/initscripts/files/rc.d/sysclock @@ -11,7 +11,7 @@ stop_cmd=":" sysclock_start() { - echo -n "=> Configuring system clock... " + echo -n "Configuring system clock... " [ ! -d /var/lib/hwclock ] && mkdir -p /var/lib/hwclock if [ ! -f /var/lib/hwclock/adjtime ]; then echo "0.0 0 0.0" > /var/lib/hwclock/adjtime diff --git a/templates/initscripts/files/rc.d/udev_events b/templates/initscripts/files/rc.d/udev_events index 9ae016eaba2..bc8d324eb86 100755 --- a/templates/initscripts/files/rc.d/udev_events +++ b/templates/initscripts/files/rc.d/udev_events @@ -11,7 +11,7 @@ stop_cmd=":" udev_events_start() { - echo -n "=> Waiting for udev uevents... " + echo -n "Waiting for udev uevents... " udevadm trigger udevadm settle echo "done." diff --git a/templates/initscripts/files/rc.shutdown b/templates/initscripts/files/rc.shutdown index 2e4f8834d10..3c395a82fc7 100755 --- a/templates/initscripts/files/rc.shutdown +++ b/templates/initscripts/files/rc.shutdown @@ -27,22 +27,23 @@ if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then done fi +echo # Terminate all processes -echo -n "=> Sending SIGTERM to processes... " +echo -n "Sending SIGTERM to processes... " killall5 -15 &> /dev/null sleep 5 show_rval -echo -n "=> Sending SIGKILL to processes... " +echo -n "Sending SIGKILL to processes... " killall5 -9 &> /dev/null sleep 1 show_rval -echo -n "=> Saving random seed... " +echo -n "Saving random seed... " dd if=/dev/urandom of=/var/run/random-seed count=1 bs=512 2> /dev/null show_rval -echo -n "=> Saving system clock... " +echo -n "Saving system clock... " if [ "$TIMEZONE" != "" -a -e "/usr/share/zoneinfo/$TIMEZONE" ]; then rm -f /etc/localtime cp "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime @@ -63,23 +64,23 @@ modprobe -r psmouse >/dev/null 2>&1 # Write to wtmp file before unmounting halt -w -echo -n "=> Deactivating swap... " +echo -n "Deactivating swap... " swapoff -a show_rval -echo -n "=> Unmounting filesystems... " +echo -n "Unmounting filesystems... " umount -a -r -t noramfs,notmpfs,nosysfs,noproc show_rval if [ "$USELVM" = "yes" -o "$USELVM" = "YES" ]; then if [ -x /sbin/lvm -a -d /sys/block ]; then - echo -n "=> Deactivating LVM2 groups... " + echo -n "Deactivating LVM2 groups... " lvm vgchange --ignorelockingfailure -an >/dev/null 2>&1 show_rval fi fi -echo -n "=> Remounting root filesystem read-only... " +echo -n "Remounting root filesystem read-only... " mount -n -o remount,ro / show_rval diff --git a/templates/initscripts/files/rc.subr b/templates/initscripts/files/rc.subr index a20e6b58268..921dd1bc58c 100755 --- a/templates/initscripts/files/rc.subr +++ b/templates/initscripts/files/rc.subr @@ -545,7 +545,7 @@ run_rc_command() # setup the command to run, and run it # - echo "=> Starting ${name}." + echo "Starting ${name}." if [ -n "$_chroot" ]; then _doit="\ ${_env:+env $_env }\ @@ -595,7 +595,7 @@ $command $rc_flags $command_args" # send the signal to stop # - echo "=> Stopping ${name}." + echo "Stopping ${name}." _doit="kill -${sig_stop:-TERM} $rc_pid" if [ -n "$_user" ]; then _doit="su -m $_user -c 'sh -c \"$_doit\"'" @@ -624,7 +624,7 @@ $command $rc_flags $command_args" fi exit 1 fi - echo "=> Reloading ${name} config files." + echo "Reloading ${name} config files." if ! eval $_precmd && [ -z "$rc_force" ]; then return 1 fi diff --git a/templates/initscripts/template b/templates/initscripts/template index 8792a215d09..7e10024066c 100644 --- a/templates/initscripts/template +++ b/templates/initscripts/template @@ -1,6 +1,6 @@ # Template file for 'initscripts' pkgname=initscripts -version=2009.01 +version=2009.03 build_style=custom-install short_desc="xbps base system init scripts" maintainer="Juan RP "