initscripts: misc changes, bump to 2009-03.
--HG-- extra : convert_revision : 97fb9127cb91659331f1574a19a8871fed30a0ab
This commit is contained in:
parent
a4ee56a799
commit
a3190ec48c
13 changed files with 60 additions and 57 deletions
|
@ -10,46 +10,48 @@ name="checkfs"
|
||||||
start_cmd="checkfs_start"
|
start_cmd="checkfs_start"
|
||||||
stop_cmd=":"
|
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()
|
checkfs_start()
|
||||||
{
|
{
|
||||||
echo -n "=> Mounting root read-only... "
|
echo -n "Mounting root read-only... "
|
||||||
mount -n -o remount,ro /
|
mount -n -o remount,ro /
|
||||||
show_rval
|
show_rval
|
||||||
|
|
||||||
FORCEFSCK=
|
FORCEFSCK=
|
||||||
[ -f /forcefsck ] && FORCEFSCK="-- -f"
|
[ -f /forcefsck ] && FORCEFSCK="-- -f"
|
||||||
|
|
||||||
echo -n "=> Checking filesystems... "
|
echo "Checking local filesystems... "
|
||||||
if grep -qw quiet /proc/cmdline; then
|
fsck -A -T -C -a -t $NETFS $FORCEFSCK 2>/dev/null
|
||||||
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
|
|
||||||
fsckret=$?
|
fsckret=$?
|
||||||
|
echo
|
||||||
if [ ${fsckret} -gt 1 ]; then
|
if [ ${fsckret} -gt 1 ]; then
|
||||||
echo "failed!"
|
echo "failed!"
|
||||||
if [ $((${fsckret}&2)) -eq 2 ]; then
|
if [ $((${fsckret}&2)) -eq 2 ]; then
|
||||||
echo
|
echo
|
||||||
echo "********************** REBOOT REQUIRED *********************"
|
echo "************** REBOOT REQUIRED *************"
|
||||||
echo "* *"
|
|
||||||
echo "* The system will be rebooted automatically in 15 seconds. *"
|
|
||||||
echo "* *"
|
|
||||||
echo "************************************************************"
|
|
||||||
echo
|
echo
|
||||||
sleep 15
|
echo " The system will be rebooted automatically"
|
||||||
|
echo " in 5 seconds."
|
||||||
|
echo
|
||||||
|
echo "********************************************"
|
||||||
|
echo
|
||||||
|
sleep 5
|
||||||
else
|
else
|
||||||
echo
|
echo
|
||||||
echo "***************** FILESYSTEM CHECK FAILED ****************"
|
echo "********* FILESYSTEM CHECK FAILED ************"
|
||||||
echo "* *"
|
echo
|
||||||
echo "* Please repair manually and reboot. Note that the root *"
|
echo " Please repair manually and reboot. Note that"
|
||||||
echo "* file system is currently mounted read-only. To remount *"
|
echo " the root filesystem is currently mounted"
|
||||||
echo "* it read-write type: mount -n -o remount,rw / *"
|
echo " read-only. To remount it read-write type:"
|
||||||
echo "* When you exit the maintenance shell the system will *"
|
echo
|
||||||
echo "* reboot automatically. *"
|
echo " mount -n -o remount,rw /"
|
||||||
echo "* *"
|
echo
|
||||||
echo "************************************************************"
|
echo " When you exit the maintenance shell the system"
|
||||||
|
echo " will reboot automatically."
|
||||||
|
echo
|
||||||
|
echo "************************************************"
|
||||||
echo
|
echo
|
||||||
sulogin -p
|
sulogin -p
|
||||||
fi
|
fi
|
||||||
|
@ -59,7 +61,6 @@ checkfs_start()
|
||||||
reboot -f
|
reboot -f
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
show_rval
|
|
||||||
}
|
}
|
||||||
|
|
||||||
load_rc_config $name
|
load_rc_config $name
|
||||||
|
|
|
@ -12,7 +12,7 @@ stop_cmd=":"
|
||||||
|
|
||||||
cleartmp_start()
|
cleartmp_start()
|
||||||
{
|
{
|
||||||
echo -n "=> Clearing temporary files... "
|
echo -n "Clearing temporary files... "
|
||||||
|
|
||||||
rm -f /etc/nologin &>/dev/null
|
rm -f /etc/nologin &>/dev/null
|
||||||
rm -f /etc/shutdownpid &>/dev/null
|
rm -f /etc/shutdownpid &>/dev/null
|
||||||
|
|
|
@ -19,35 +19,35 @@ locale_start()
|
||||||
chmod 755 /etc/profile.d/locale.sh
|
chmod 755 /etc/profile.d/locale.sh
|
||||||
|
|
||||||
# Check if requested locale was already created
|
# 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
|
[ ! -d /usr/lib/locale ] && mkdir -p /usr/lib/locale
|
||||||
echo -n "=> Building locale: $LOCALE... "
|
echo -n "Building locale: $LOCALE... "
|
||||||
localedef -i ${LOCALE%.*} -f UTF-8 ${LOCALE}
|
localedef -i ${LOCALE} -f UTF-8 ${LOCALE}
|
||||||
show_rval
|
show_rval
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set user defined locale
|
# Set user defined locale
|
||||||
[ -z "$LOCALE" ] && LOCALE="en_US"
|
[ -z "$LOCALE" ] && LOCALE="en_US"
|
||||||
echo -n "=> Setting locale: $LOCALE... "
|
echo -n "Setting locale: $LOCALE... "
|
||||||
echo "export LANG=$LOCALE" >> /etc/profile.d/locale.sh
|
echo "export LANG=$LOCALE" >> /etc/profile.d/locale.sh
|
||||||
show_rval
|
show_rval
|
||||||
|
|
||||||
if echo "$LOCALE" | grep -qi utf ; then
|
if echo "$LOCALE" | grep -qi utf ; then
|
||||||
if [ -n "$KEYMAP" ]; then
|
if [ -n "$KEYMAP" ]; then
|
||||||
echo -n "=> Loading keyboard map: $KEYMAP... "
|
echo -n "Loading keyboard map: $KEYMAP... "
|
||||||
loadkeys -q -u $KEYMAP
|
loadkeys -q -u $KEYMAP
|
||||||
show_rval
|
show_rval
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ -n "$KEYMAP" ]; then
|
if [ -n "$KEYMAP" ]; then
|
||||||
echo -n "=> Loading keyboard map: $KEYMAP... "
|
echo -n "Loading keyboard map: $KEYMAP... "
|
||||||
loadkeys -q $KEYMAP
|
loadkeys -q $KEYMAP
|
||||||
show_rval
|
show_rval
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$CONSOLEFONT" ]; then
|
if [ -n "$CONSOLEFONT" ]; then
|
||||||
echo -n "=> Loading console font: $CONSOLEFONT... "
|
echo -n "Loading console font: $CONSOLEFONT... "
|
||||||
# CONSOLEMAP in UTF-8 shouldn't be used
|
# CONSOLEMAP in UTF-8 shouldn't be used
|
||||||
if [ -n "$CONSOLEMAP" ] && echo "$LOCALE" | grep -qi utf ; then
|
if [ -n "$CONSOLEMAP" ] && echo "$LOCALE" | grep -qi utf ; then
|
||||||
CONSOLEMAP=""
|
CONSOLEMAP=""
|
||||||
|
|
|
@ -10,11 +10,12 @@ name="mountfs"
|
||||||
start_cmd="mountfs_start"
|
start_cmd="mountfs_start"
|
||||||
stop_cmd=":"
|
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()
|
mountfs_start()
|
||||||
{
|
{
|
||||||
echo -n "=> Mounting local filesystems... "
|
echo -n "Mounting local filesystems... "
|
||||||
mount -n -o remount,rw /
|
mount -n -o remount,rw /
|
||||||
rm -f /etc/mtab*
|
rm -f /etc/mtab*
|
||||||
# make sure / gets written to /etc/mtab
|
# make sure / gets written to /etc/mtab
|
||||||
|
|
|
@ -21,7 +21,7 @@ network_start()
|
||||||
{
|
{
|
||||||
# set hostname, turn on network
|
# set hostname, turn on network
|
||||||
#
|
#
|
||||||
echo "=> Starting network."
|
echo "Starting network."
|
||||||
|
|
||||||
# If $hostname is set, use it for my Internet name,
|
# If $hostname is set, use it for my Internet name,
|
||||||
# otherwise use /etc/myname
|
# otherwise use /etc/myname
|
||||||
|
@ -30,7 +30,7 @@ network_start()
|
||||||
hostname=$(cat /etc/myname)
|
hostname=$(cat /etc/myname)
|
||||||
fi
|
fi
|
||||||
if [ -n "$hostname" ]; then
|
if [ -n "$hostname" ]; then
|
||||||
echo "=> Setting hostname: $hostname."
|
echo "Setting hostname: $hostname."
|
||||||
hostname $hostname
|
hostname $hostname
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ network_start()
|
||||||
tmp="$net_interfaces"
|
tmp="$net_interfaces"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n '=> Configuring network interfaces:'
|
echo -n 'Configuring network interfaces:'
|
||||||
for int in ${tmp}; do
|
for int in ${tmp}; do
|
||||||
eval argslist=\$ifconfig_$int
|
eval argslist=\$ifconfig_$int
|
||||||
|
|
||||||
|
@ -200,11 +200,11 @@ network_start()
|
||||||
|
|
||||||
network_stop()
|
network_stop()
|
||||||
{
|
{
|
||||||
echo "=> Stopping network."
|
echo "Stopping network."
|
||||||
|
|
||||||
# down interfaces
|
# down interfaces
|
||||||
#
|
#
|
||||||
echo -n '=> Downing network interfaces:'
|
echo -n 'Downing network interfaces:'
|
||||||
if [ "$net_interfaces" != NO ]; then
|
if [ "$net_interfaces" != NO ]; then
|
||||||
if checkyesno auto_ifconfig; then
|
if checkyesno auto_ifconfig; then
|
||||||
tmp=$(ls /sys/class/net/eth*)
|
tmp=$(ls /sys/class/net/eth*)
|
||||||
|
|
|
@ -14,13 +14,13 @@ persistent_start()
|
||||||
{
|
{
|
||||||
# Adding persistent network/cdrom generated rules
|
# Adding persistent network/cdrom generated rules
|
||||||
if [ -f "/dev/.udev/tmp-rules--70-persistent-cd.rules" ]; then
|
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 \
|
cat /dev/.udev/tmp-rules--70-persistent-cd.rules \
|
||||||
>> /etc/udev/rules.d/70-persistent-cd.rules
|
>> /etc/udev/rules.d/70-persistent-cd.rules
|
||||||
show_rval
|
show_rval
|
||||||
fi
|
fi
|
||||||
if [ -f "/dev/.udev/tmp-rules--70-persistent-net.rules" ]; then
|
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 \
|
cat /dev/.udev/tmp-rules--70-persistent-net.rules \
|
||||||
>> /etc/udev/rules.d/70-persistent-net.rules
|
>> /etc/udev/rules.d/70-persistent-net.rules
|
||||||
show_rval
|
show_rval
|
||||||
|
|
|
@ -12,7 +12,7 @@ stop_cmd=":"
|
||||||
rseed_start()
|
rseed_start()
|
||||||
{
|
{
|
||||||
if [ -f /var/run/random-seed ]; then
|
if [ -f /var/run/random-seed ]; then
|
||||||
echo -n "=> Initializing random seed... "
|
echo -n "Initializing random seed... "
|
||||||
cat /var/run/random-seed >/dev/urandom
|
cat /var/run/random-seed >/dev/urandom
|
||||||
show_rval
|
show_rval
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -11,7 +11,7 @@ stop_cmd=":"
|
||||||
|
|
||||||
swap_start()
|
swap_start()
|
||||||
{
|
{
|
||||||
echo -n "=> Activating swap... "
|
echo -n "Activating swap... "
|
||||||
swapon -a
|
swapon -a
|
||||||
show_rval
|
show_rval
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ stop_cmd=":"
|
||||||
|
|
||||||
sysclock_start()
|
sysclock_start()
|
||||||
{
|
{
|
||||||
echo -n "=> Configuring system clock... "
|
echo -n "Configuring system clock... "
|
||||||
[ ! -d /var/lib/hwclock ] && mkdir -p /var/lib/hwclock
|
[ ! -d /var/lib/hwclock ] && mkdir -p /var/lib/hwclock
|
||||||
if [ ! -f /var/lib/hwclock/adjtime ]; then
|
if [ ! -f /var/lib/hwclock/adjtime ]; then
|
||||||
echo "0.0 0 0.0" > /var/lib/hwclock/adjtime
|
echo "0.0 0 0.0" > /var/lib/hwclock/adjtime
|
||||||
|
|
|
@ -11,7 +11,7 @@ stop_cmd=":"
|
||||||
|
|
||||||
udev_events_start()
|
udev_events_start()
|
||||||
{
|
{
|
||||||
echo -n "=> Waiting for udev uevents... "
|
echo -n "Waiting for udev uevents... "
|
||||||
udevadm trigger
|
udevadm trigger
|
||||||
udevadm settle
|
udevadm settle
|
||||||
echo "done."
|
echo "done."
|
||||||
|
|
|
@ -27,22 +27,23 @@ if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
# Terminate all processes
|
# Terminate all processes
|
||||||
echo -n "=> Sending SIGTERM to processes... "
|
echo -n "Sending SIGTERM to processes... "
|
||||||
killall5 -15 &> /dev/null
|
killall5 -15 &> /dev/null
|
||||||
sleep 5
|
sleep 5
|
||||||
show_rval
|
show_rval
|
||||||
|
|
||||||
echo -n "=> Sending SIGKILL to processes... "
|
echo -n "Sending SIGKILL to processes... "
|
||||||
killall5 -9 &> /dev/null
|
killall5 -9 &> /dev/null
|
||||||
sleep 1
|
sleep 1
|
||||||
show_rval
|
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
|
dd if=/dev/urandom of=/var/run/random-seed count=1 bs=512 2> /dev/null
|
||||||
show_rval
|
show_rval
|
||||||
|
|
||||||
echo -n "=> Saving system clock... "
|
echo -n "Saving system clock... "
|
||||||
if [ "$TIMEZONE" != "" -a -e "/usr/share/zoneinfo/$TIMEZONE" ]; then
|
if [ "$TIMEZONE" != "" -a -e "/usr/share/zoneinfo/$TIMEZONE" ]; then
|
||||||
rm -f /etc/localtime
|
rm -f /etc/localtime
|
||||||
cp "/usr/share/zoneinfo/$TIMEZONE" /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
|
# Write to wtmp file before unmounting
|
||||||
halt -w
|
halt -w
|
||||||
|
|
||||||
echo -n "=> Deactivating swap... "
|
echo -n "Deactivating swap... "
|
||||||
swapoff -a
|
swapoff -a
|
||||||
show_rval
|
show_rval
|
||||||
|
|
||||||
echo -n "=> Unmounting filesystems... "
|
echo -n "Unmounting filesystems... "
|
||||||
umount -a -r -t noramfs,notmpfs,nosysfs,noproc
|
umount -a -r -t noramfs,notmpfs,nosysfs,noproc
|
||||||
show_rval
|
show_rval
|
||||||
|
|
||||||
if [ "$USELVM" = "yes" -o "$USELVM" = "YES" ]; then
|
if [ "$USELVM" = "yes" -o "$USELVM" = "YES" ]; then
|
||||||
if [ -x /sbin/lvm -a -d /sys/block ]; 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
|
lvm vgchange --ignorelockingfailure -an >/dev/null 2>&1
|
||||||
show_rval
|
show_rval
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n "=> Remounting root filesystem read-only... "
|
echo -n "Remounting root filesystem read-only... "
|
||||||
mount -n -o remount,ro /
|
mount -n -o remount,ro /
|
||||||
show_rval
|
show_rval
|
||||||
|
|
||||||
|
|
|
@ -545,7 +545,7 @@ run_rc_command()
|
||||||
|
|
||||||
# setup the command to run, and run it
|
# setup the command to run, and run it
|
||||||
#
|
#
|
||||||
echo "=> Starting ${name}."
|
echo "Starting ${name}."
|
||||||
if [ -n "$_chroot" ]; then
|
if [ -n "$_chroot" ]; then
|
||||||
_doit="\
|
_doit="\
|
||||||
${_env:+env $_env }\
|
${_env:+env $_env }\
|
||||||
|
@ -595,7 +595,7 @@ $command $rc_flags $command_args"
|
||||||
|
|
||||||
# send the signal to stop
|
# send the signal to stop
|
||||||
#
|
#
|
||||||
echo "=> Stopping ${name}."
|
echo "Stopping ${name}."
|
||||||
_doit="kill -${sig_stop:-TERM} $rc_pid"
|
_doit="kill -${sig_stop:-TERM} $rc_pid"
|
||||||
if [ -n "$_user" ]; then
|
if [ -n "$_user" ]; then
|
||||||
_doit="su -m $_user -c 'sh -c \"$_doit\"'"
|
_doit="su -m $_user -c 'sh -c \"$_doit\"'"
|
||||||
|
@ -624,7 +624,7 @@ $command $rc_flags $command_args"
|
||||||
fi
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "=> Reloading ${name} config files."
|
echo "Reloading ${name} config files."
|
||||||
if ! eval $_precmd && [ -z "$rc_force" ]; then
|
if ! eval $_precmd && [ -z "$rc_force" ]; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Template file for 'initscripts'
|
# Template file for 'initscripts'
|
||||||
pkgname=initscripts
|
pkgname=initscripts
|
||||||
version=2009.01
|
version=2009.03
|
||||||
build_style=custom-install
|
build_style=custom-install
|
||||||
short_desc="xbps base system init scripts"
|
short_desc="xbps base system init scripts"
|
||||||
maintainer="Juan RP <xtraeme@gmail.com>"
|
maintainer="Juan RP <xtraeme@gmail.com>"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue