rc: 2.32 -> 2.33
This commit is contained in:
parent
1fd66c9e55
commit
cc07dcce91
@ -4,6 +4,7 @@ drwxr-xr-x root/root etc/
|
|||||||
-rw-r--r-- root/root etc/rc.conf
|
-rw-r--r-- root/root etc/rc.conf
|
||||||
drwxr-xr-x root/root etc/rc.d/
|
drwxr-xr-x root/root etc/rc.d/
|
||||||
-rwxr-xr-x root/root etc/rc.fix
|
-rwxr-xr-x root/root etc/rc.fix
|
||||||
|
-rwxr-xr-x root/root etc/rc.functions
|
||||||
-rwxr-xr-x root/root etc/rc.local
|
-rwxr-xr-x root/root etc/rc.local
|
||||||
-rwxr-xr-x root/root etc/rc.modules
|
-rwxr-xr-x root/root etc/rc.modules
|
||||||
-rwxr-xr-x root/root etc/rc.multi
|
-rwxr-xr-x root/root etc/rc.multi
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
untrusted comment: verify with /etc/ports/core.pub
|
untrusted comment: verify with /etc/ports/core.pub
|
||||||
RWRJc1FUaeVeqs38PmJ6zdDzwtmlgXp9Mri3sIXmTjQ4DH9f0OCjBMNh0LQh0P+Ew4QPYRXad2jcDQ1OBNaA4R2/XB3tBmmWnwQ=
|
RWRJc1FUaeVeqtyNKaQPdAFB3EiNs8g3ale0j1r7287LM3dr23Rji+DMvLFUDtgOBJ3Ahw/lZzzMsxxIAUFjm+M1azzDL7JO6wU=
|
||||||
SHA256 (Pkgfile) = b6308712bfd76142197506e2b6b704bdff07324cd6b222c5413d0f3fb1b4c508
|
SHA256 (Pkgfile) = 38e8a61308d55462acea47cc1088dd2ede3652c24a58394acb7fa297357facb5
|
||||||
SHA256 (.footprint) = 83ecef9b904362368a7a581a43b3ea9b658bdbe8265ffae433068ee5beba15e4
|
SHA256 (.footprint) = 19fc8bf3e0efb55c6556056f3315a002bd44615fa2b465a0ba0da87536c07fbf
|
||||||
SHA256 (inittab) = 7914281a73ee7746c7c16fe63d1631f3714f63467f2655c550c5f8b7c2f1fee7
|
SHA256 (inittab) = 7914281a73ee7746c7c16fe63d1631f3714f63467f2655c550c5f8b7c2f1fee7
|
||||||
SHA256 (rc) = 58341d2b8cb66f0a786452f2da472aff8d640f94a09e42ed8f3efd62305fbee5
|
SHA256 (rc) = 0ed21debe4e7f7dfb392f83d53bc3fd8178523faec55979544851d8a0f502cde
|
||||||
SHA256 (rc.modules) = 74d94558fe68f2a4b7b0f3dc2215c291300bc416d27e6d79d95f303cfc918788
|
SHA256 (rc.modules) = 74d94558fe68f2a4b7b0f3dc2215c291300bc416d27e6d79d95f303cfc918788
|
||||||
SHA256 (rc.single) = 14a7487258f3b5f2406a860c34666abacf23eb37962d80fce66e496dd111061a
|
SHA256 (rc.single) = ebdc5f7c5329006330df1df24a162ac55bd109d0d98774ecff463153af770ca0
|
||||||
SHA256 (rc.multi) = a8115a0c3ddd98a5ac1f6dc9d1f23e7d1c0d2db65f709f59deadac312ed6a618
|
SHA256 (rc.multi) = dd0f790d027c702946da714d6d264fb9a590a634149ef8632822ce8ba3c6d854
|
||||||
SHA256 (rc.local) = e39147ee4d402b2fea96639185d6055b361b1a44090653acf5790b51db6acdd1
|
SHA256 (rc.local) = e39147ee4d402b2fea96639185d6055b361b1a44090653acf5790b51db6acdd1
|
||||||
SHA256 (rc.fix) = 0d2eef2326f8660e70e047192c82a0cb865bc8c933e12ffe5b817e8cd536f5b0
|
SHA256 (rc.fix) = be4133cd59017158b44e78d7ac53953986d8e9828866d0f7f71564ff71b9b406
|
||||||
SHA256 (rc.shutdown) = 284122ae86248cf93e9806b6e1d3ffca9ad2ee3978434581b491e39887b14ec9
|
SHA256 (rc.functions) = a2a2f82705999b53a0b9a903c7cd2d5d874185d00fb4dc2125172906886d8268
|
||||||
SHA256 (rc.conf) = 37c3b0dd2a76fe6fbdec9ec90bfbfa2e8e7db9cece2fceec1f4899aa1e3e14a5
|
SHA256 (rc.shutdown) = e2c65c427369b10466788d06cfdda35709e0b25d8a0be9f08033a521893607b4
|
||||||
|
SHA256 (rc.conf) = 6863f0708d70eb4531bb53a5a1adce7dad17e1acf373cc8b42055aa168491ee1
|
||||||
|
34
rc/Pkgfile
34
rc/Pkgfile
@ -3,22 +3,24 @@
|
|||||||
# Maintainer: CRUX System Team, core-ports at crux dot nu
|
# Maintainer: CRUX System Team, core-ports at crux dot nu
|
||||||
|
|
||||||
name=rc
|
name=rc
|
||||||
version=2.32
|
version=2.33
|
||||||
release=2
|
release=1
|
||||||
source=(inittab rc rc.modules rc.single rc.multi rc.local rc.fix rc.shutdown rc.conf)
|
source=(inittab rc rc.modules rc.single rc.multi rc.local rc.fix
|
||||||
|
rc.functions rc.shutdown rc.conf)
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
install -d $PKG/etc/rc.d
|
install -d $PKG/etc/rc.d
|
||||||
install -m 644 inittab $PKG/etc
|
install -m 644 inittab $PKG/etc
|
||||||
install -m 755 rc $PKG/etc
|
install -m 755 rc $PKG/etc
|
||||||
install -m 755 rc.modules $PKG/etc
|
install -m 755 rc.modules $PKG/etc
|
||||||
install -m 755 rc.single $PKG/etc
|
install -m 755 rc.single $PKG/etc
|
||||||
install -m 755 rc.multi $PKG/etc
|
install -m 755 rc.multi $PKG/etc
|
||||||
install -m 755 rc.local $PKG/etc
|
install -m 755 rc.local $PKG/etc
|
||||||
install -m 755 rc.fix $PKG/etc
|
install -m 755 rc.fix $PKG/etc
|
||||||
install -m 755 rc.shutdown $PKG/etc
|
install -m 755 rc.shutdown $PKG/etc
|
||||||
install -m 644 rc.conf $PKG/etc
|
install -m 755 rc.functions $PKG/etc
|
||||||
install -d $PKG/var/log $PKG/var/lib/urandom
|
install -m 644 rc.conf $PKG/etc
|
||||||
touch $PKG/var/log/boot $PKG/var/lib/urandom/seed
|
install -d $PKG/var/log $PKG/var/lib/urandom
|
||||||
chmod 640 $PKG/var/log/boot $PKG/var/lib/urandom/seed
|
touch $PKG/var/log/boot $PKG/var/lib/urandom/seed
|
||||||
|
chmod 640 $PKG/var/log/boot $PKG/var/lib/urandom/seed
|
||||||
}
|
}
|
||||||
|
132
rc/rc
132
rc/rc
@ -3,45 +3,90 @@
|
|||||||
# /etc/rc: system boot script
|
# /etc/rc: system boot script
|
||||||
#
|
#
|
||||||
|
|
||||||
echo "The system is coming up. Please wait."
|
printf "%s\n" "The system is coming up. Please wait."
|
||||||
|
|
||||||
# Load configuration
|
# Load configuration
|
||||||
. /etc/rc.conf
|
. /etc/rc.conf
|
||||||
|
# Load functions
|
||||||
|
. /etc/rc.functions
|
||||||
|
|
||||||
# Start udev
|
# Setup a working environment with eudev
|
||||||
/bin/mount -t proc none /proc
|
# - if /dev is not mounted - mount as a devtmpfs (CONFIG_DEVTMPFS=y)
|
||||||
/bin/mount -t sysfs none /sys
|
# - if /dev is mounted (e.g. due to handover from initramfs or
|
||||||
/sbin/start_udev
|
# CONFIG_DEVTMPFS_MOUNT=y), remount with specific options
|
||||||
|
# - some video drivers require exec access in /dev, thus it's set here
|
||||||
|
# - for completness, we add few sanity limits (2k non-empty files, 16k inodes)
|
||||||
|
|
||||||
|
printinfo "\nMounting /proc.."
|
||||||
|
if ! /bin/mountpoint -q /proc; then
|
||||||
|
/bin/mount -t proc none /proc || { printf "$(BOLD "$(RED)")" "[ERROR]"; exit 1; }
|
||||||
|
fi
|
||||||
|
|
||||||
|
printinfo "\nMounting /sys.."
|
||||||
|
if ! /bin/mountpoint -q /sys; then
|
||||||
|
/bin/mount -t sysfs none /sys || { printf "$(BOLD "$(RED)")" "[ERROR]"; exit 1; }
|
||||||
|
fi
|
||||||
|
|
||||||
|
printinfo "\nMounting /run.."
|
||||||
|
if ! /bin/mountpoint -q /run ; then
|
||||||
|
/bin/mount -n -t tmpfs -o mode="0755,nosuid,nodev,exec" tmpfs /run || { printf "$(BOLD "$(RED)")" "[ERROR]"; exit 1; }
|
||||||
|
fi
|
||||||
|
|
||||||
|
printinfo "\nMounting /dev.."
|
||||||
|
UDEVOPTS="exec,nosuid,noatime,mode=0755,nr_blocks=2048,nr_inodes=16384"
|
||||||
|
if ! /bin/mountpoint -q /dev; then
|
||||||
|
/bin/mount -n -t devtmpfs -o ${UDEVOPTS} dev /dev || { printf "$(BOLD "$(RED)")" "[ERROR]"; exit 1; }
|
||||||
|
else
|
||||||
|
/bin/mount -n -o remount,${UDEVOPTS} dev /dev || { printf "$(BOLD "$(RED)")" "[ERROR]"; exit 1; }
|
||||||
|
fi
|
||||||
|
|
||||||
|
printinfo "\nMounting /dev/pts.."
|
||||||
|
if ! /bin/mountpoint -q /dev/pts; then
|
||||||
|
/bin/mkdir -m 755 /dev/pts
|
||||||
|
/bin/mount -t devpts -o noexec,nosuid,gid=tty,mode=0620 devpts /dev/pts || { printf "$(BOLD "$(RED)")" "[ERROR]"; exit 1; }
|
||||||
|
fi
|
||||||
|
|
||||||
|
printinfo "\nMounting /dev/shm.."
|
||||||
|
if ! /bin/mountpoint -q /dev/shm; then
|
||||||
|
/bin/mkdir -m 1777 /dev/shm
|
||||||
|
/bin/mount shm -t tmpfs -o defaults,exec,rw /dev/shm || { printf "$(BOLD "$(RED)")" "[ERROR]"; exit 1; }
|
||||||
|
fi
|
||||||
|
|
||||||
|
printinfo "\nStarting udev.."
|
||||||
|
/sbin/start_udev || { printf "$(BOLD "$(RED)")" "[ERROR]"; exit 1; }
|
||||||
|
|
||||||
# Create device-mapper device nodes and scan for LVM volume groups
|
# Create device-mapper device nodes and scan for LVM volume groups
|
||||||
if [ -x /sbin/lvm ]; then
|
if [ -x /sbin/lvm ]; then
|
||||||
/sbin/vgscan --mknodes --ignorelockingfailure
|
printinfo "Found lvm, creating device nodes and lvm volumes"
|
||||||
/sbin/vgchange --sysinit -a y
|
/sbin/vgscan --mknodes --ignorelockingfailure || printf "$(BOLD "$(RED)")" "[ERROR]"
|
||||||
|
/sbin/vgchange --sysinit -a y || printf "$(BOLD "$(RED)")" "[ERROR]"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Mount root read-only
|
# Mount root read-only
|
||||||
/bin/mount -o remount,ro /
|
printinfo "\nMounting / in read-only mode.."
|
||||||
|
/bin/mount -o remount,ro / || { printf "$(BOLD "$(RED)")" "[ERROR]"; exit 1; }
|
||||||
|
|
||||||
if [ -f /forcefsck ]; then
|
if [ -f /forcefsck ]; then
|
||||||
FORCEFSCK="-f"
|
printinfo "\n/forcefsck detected, setting force flag to fsck"
|
||||||
|
FORCEFSCK="-f"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check filesystems
|
# Check filesystems
|
||||||
|
printinfo "\nChecking filesystems.."
|
||||||
/sbin/fsck $FORCEFSCK -A -T -C -a
|
/sbin/fsck $FORCEFSCK -A -T -C -a
|
||||||
if [ $? -gt 1 ]; then
|
if [ $? -gt 1 ]; then
|
||||||
echo
|
printf "\n%s$(BOLD "$(RED)")%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n" \
|
||||||
echo "*************** FILESYSTEM CHECK FAILED ******************"
|
"***************" " FILESYSTEM CHECK FAILED " "******************" \
|
||||||
echo "* *"
|
"* *" \
|
||||||
echo "* Please repair manually and reboot. Note that the root *"
|
"* Please repair manually and reboot. Note that the root *" \
|
||||||
echo "* file system is currently mounted read-only. To remount *"
|
"* file system is currently mounted read-only. To remount *" \
|
||||||
echo "* it read-write type: mount -n -o remount,rw / *"
|
"* it read-write type: mount -n -o remount,rw / *" \
|
||||||
echo "* When you exit the maintainance shell the system will *"
|
"* When you exit the maintenance shell the system will *" \
|
||||||
echo "* reboot automatically. *"
|
"* reboot automatically. *" \
|
||||||
echo "* *"
|
"* *" \
|
||||||
echo "************************************************************"
|
"************************************************************"
|
||||||
echo
|
|
||||||
/sbin/sulogin -p
|
/sbin/sulogin -p
|
||||||
echo "Automatic reboot in progress..."
|
printf "%s\n" "Automatic reboot in progress..."
|
||||||
/bin/umount -a -r
|
/bin/umount -a -r
|
||||||
/bin/mount -o remount,ro /
|
/bin/mount -o remount,ro /
|
||||||
/sbin/reboot -f
|
/sbin/reboot -f
|
||||||
@ -49,31 +94,39 @@ if [ $? -gt 1 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Mount local filesystems
|
# Mount local filesystems
|
||||||
/bin/mount -o remount,rw /
|
printinfo "\nMounting / in read-write mode.."
|
||||||
/bin/mount -a -O no_netdev
|
/bin/mount -o remount,rw / || printf "$(BOLD "$(RED)")" "[ERROR]"
|
||||||
|
|
||||||
|
printinfo "\nMounting other filesystems (excl. network devices)..\t"
|
||||||
|
/bin/mount -a -O no_netdev || printf "$(BOLD "$(RED)")" "[ERROR]"
|
||||||
|
|
||||||
# Create user dir in /run
|
# Create user dir in /run
|
||||||
/bin/mkdir -m 0755 /run/user
|
printinfo "\nCreating /run/user.."
|
||||||
|
/bin/mkdir -m 0755 /run/user || printf "$(BOLD "$(RED)")" "[ERROR]"
|
||||||
|
|
||||||
# Activate swap
|
# Activate swap
|
||||||
/sbin/swapon -a
|
printinfo "\nMounting swap.."
|
||||||
|
/sbin/swapon -a || printf "$(BOLD "$(RED)")" "[ERROR]"
|
||||||
|
|
||||||
# Clean up misc files
|
# Clean up misc files
|
||||||
: > /run/utmp
|
printinfo "\nDeleting temporary files.."
|
||||||
/bin/rm -rf /forcefsck /fastboot /etc/nologin /etc/shutdownpid
|
: > /run/utmp || printf "$(BOLD "$(RED)")" "[ERROR]"
|
||||||
(cd /var/lock && /usr/bin/find . ! -type d -delete)
|
/bin/rm -rf /forcefsck /fastboot /etc/nologin /etc/shutdownpid || printf "$(BOLD "$(RED)")" "[ERROR]"
|
||||||
(cd /tmp && /usr/bin/find . ! -name . -delete)
|
(cd /var/lock && /usr/bin/find . ! -type d -delete) || printf "$(BOLD "$(RED)")" "[ERROR]"
|
||||||
/bin/mkdir -m 1777 /tmp/.ICE-unix /tmp/.X11-unix
|
(cd /tmp && /usr/bin/find . ! -name . -delete) || printf "$(BOLD "$(RED)")" "[ERROR]"
|
||||||
|
/bin/mkdir -m 1777 /tmp/.ICE-unix /tmp/.X11-unix || printf "$(BOLD "$(RED)")" "[ERROR]"
|
||||||
|
|
||||||
# Set kernel variables
|
# Set kernel variables
|
||||||
/sbin/sysctl -p > /dev/null
|
printinfo "\nSetting kernel variables.."
|
||||||
|
/sbin/sysctl -p > /dev/null || printf "$(BOLD "$(RED)")" "[ERROR]"
|
||||||
|
|
||||||
# Update shared library links
|
# Update shared library links
|
||||||
/sbin/ldconfig
|
printinfo "\nUpdating shared library links.."
|
||||||
|
/sbin/ldconfig || printf "$(BOLD "$(RED)")" "[ERROR]"
|
||||||
|
|
||||||
# Configure host name
|
# Configure host name
|
||||||
if [ "$HOSTNAME" ]; then
|
if [ "$HOSTNAME" ]; then
|
||||||
echo "hostname: $HOSTNAME"
|
printf "\n$(BOLD "%s") %s\n" "Hostname:" "$HOSTNAME"
|
||||||
/bin/hostname "$HOSTNAME"
|
/bin/hostname "$HOSTNAME"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -86,20 +139,25 @@ if [ "$TIMEZONE" ]; then
|
|||||||
fi
|
fi
|
||||||
/sbin/hwclock --hctosys
|
/sbin/hwclock --hctosys
|
||||||
|
|
||||||
|
# Default language
|
||||||
|
printf "$(BOLD "%s") %s\n" "LANG:" "${LANG:-C.UTF-8}"
|
||||||
|
export LANG
|
||||||
|
|
||||||
# Load console font
|
# Load console font
|
||||||
if [ "$FONT" ]; then
|
if [ "$FONT" ]; then
|
||||||
echo "font: $FONT"
|
printf "$(BOLD "%s") %s\n" "Font:" "$FONT"
|
||||||
/usr/bin/setfont "$FONT"
|
/usr/bin/setfont "$FONT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Load console keymap
|
# Load console keymap
|
||||||
if [ "$KEYMAP" ]; then
|
if [ "$KEYMAP" ]; then
|
||||||
echo "keyboard: $KEYMAP"
|
printf "$(BOLD "%s") %s\n" "Keyboard:" "$KEYMAP"
|
||||||
/usr/bin/loadkeys -q "$KEYMAP"
|
/usr/bin/loadkeys -q "$KEYMAP"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Screen blanks after 15 minutes idle time
|
# Screen timeout, defaults to 15m
|
||||||
/usr/bin/setterm -blank 15
|
printf "$(BOLD "%s") %s\n" "Screen Timeout:" "${BLANKTIME:-15}"
|
||||||
|
/usr/bin/setterm -blank "${BLANKTIME:-15}"
|
||||||
|
|
||||||
# Run module initialization script
|
# Run module initialization script
|
||||||
if [ -x /etc/rc.modules ]; then
|
if [ -x /etc/rc.modules ]; then
|
||||||
|
@ -2,11 +2,14 @@
|
|||||||
# /etc/rc.conf: system configuration
|
# /etc/rc.conf: system configuration
|
||||||
#
|
#
|
||||||
|
|
||||||
FONT=default
|
BLANKTIME=15
|
||||||
KEYMAP=us
|
|
||||||
TIMEZONE=UTC
|
|
||||||
HOSTNAME=host
|
HOSTNAME=host
|
||||||
|
KEYMAP=us
|
||||||
|
LANG=C.UTF-8
|
||||||
SYSLOG=sysklogd
|
SYSLOG=sysklogd
|
||||||
|
TIMEZONE=UTC
|
||||||
|
USE_COLOR=false
|
||||||
|
VERBOSE=false
|
||||||
SERVICES=(lo net crond)
|
SERVICES=(lo net crond)
|
||||||
|
|
||||||
# End of file
|
# End of file
|
||||||
|
10
rc/rc.fix
10
rc/rc.fix
@ -7,15 +7,15 @@
|
|||||||
# X11 font-related checks
|
# X11 font-related checks
|
||||||
#######################################################################
|
#######################################################################
|
||||||
if [ -d /usr/share/fonts/X11 ]; then
|
if [ -d /usr/share/fonts/X11 ]; then
|
||||||
for i in `/bin/ls -d /usr/share/fonts/X11/*`; do
|
for i in $(/bin/ls -d /usr/share/fonts/X11/*); do
|
||||||
if [ ! -f $i/fonts.dir ]; then
|
if [ ! -f "$i/fonts.dir" ]; then
|
||||||
mkfontdir $i &> /dev/null
|
mkfontdir "$i" &> /dev/null
|
||||||
mkfontscale $i &> /dev/null
|
mkfontscale "$i" &> /dev/null
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d /var/cache/fontconfig ] && [ -z "`/bin/ls /var/cache/fontconfig/`" ]; then
|
if [ -d /var/cache/fontconfig ] && [ -z "$(/bin/ls /var/cache/fontconfig/)" ]; then
|
||||||
fc-cache --system-only &> /dev/null
|
fc-cache --system-only &> /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
30
rc/rc.functions
Normal file
30
rc/rc.functions
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# /etc/rc.functions: functions to be used by the system boot script
|
||||||
|
#
|
||||||
|
|
||||||
|
RED() {
|
||||||
|
case $USE_COLOR in
|
||||||
|
true) printf '\033[31m%s\033[0m' "$1";;
|
||||||
|
false) printf '%s' "$1";;
|
||||||
|
*) printf '%s' "$1";;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
GREEN() {
|
||||||
|
case $USE_COLOR in
|
||||||
|
true) printf '\033[32m%s\033[0m' "$1";;
|
||||||
|
false) printf '%s' "$1";;
|
||||||
|
*) printf '%s' "$1";;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
BOLD() {
|
||||||
|
printf '\033[1m%s\033[0m' "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
printinfo() {
|
||||||
|
if [ "$VERBOSE" = true ]; then
|
||||||
|
printf '%b' "$1"
|
||||||
|
fi
|
||||||
|
}
|
20
rc/rc.multi
20
rc/rc.multi
@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
# Load configuration
|
# Load configuration
|
||||||
. /etc/rc.conf
|
. /etc/rc.conf
|
||||||
|
# Load functions
|
||||||
|
. /etc/rc.functions
|
||||||
|
|
||||||
# Run fixes startup file
|
# Run fixes startup file
|
||||||
if [ -x /etc/rc.fix ]; then
|
if [ -x /etc/rc.fix ]; then
|
||||||
@ -12,19 +14,19 @@ if [ -x /etc/rc.fix ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Start services
|
# Start services
|
||||||
if [ "$SYSLOG" -o "${SERVICES[*]}" ]; then
|
if [ "$SYSLOG" ] || [ "${SERVICES[*]}" ]; then
|
||||||
echo -n "starting services:"
|
printf "$(BOLD "Starting services:")"
|
||||||
if [ -f /etc/rc.d/$SYSLOG -a -x /etc/rc.d/$SYSLOG ]; then
|
if [ -f /etc/rc.d/$SYSLOG ] && [ -x /etc/rc.d/$SYSLOG ]; then
|
||||||
echo -n " $SYSLOG"
|
printf " %s" "$SYSLOG"
|
||||||
/etc/rc.d/$SYSLOG start &> /dev/null || echo -n "[ERROR]"
|
/etc/rc.d/$SYSLOG start &> /dev/null || printf "$(BOLD "$(RED "[ERROR]")")"
|
||||||
fi
|
fi
|
||||||
for service in ${SERVICES[@]}; do
|
for service in "${SERVICES[@]}"; do
|
||||||
echo -n " $service"
|
printf " %s" "$service"
|
||||||
/etc/rc.d/"$service" start &> /tmp/rc.$$ || echo -n "[ERROR]"
|
/etc/rc.d/"$service" start &> /tmp/rc.$$ || printf "$(BOLD "$(RED "[ERROR]")")"
|
||||||
/usr/bin/logger -t "$service" -f /tmp/rc.$$
|
/usr/bin/logger -t "$service" -f /tmp/rc.$$
|
||||||
/bin/rm -f /tmp/rc.$$
|
/bin/rm -f /tmp/rc.$$
|
||||||
done
|
done
|
||||||
echo
|
printf "\n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run local startup script
|
# Run local startup script
|
||||||
|
@ -5,24 +5,29 @@
|
|||||||
|
|
||||||
# Load configuration
|
# Load configuration
|
||||||
. /etc/rc.conf
|
. /etc/rc.conf
|
||||||
|
# Load functions
|
||||||
|
. /etc/rc.functions
|
||||||
|
|
||||||
# Set linefeed mode to avoid staircase effect
|
# Set linefeed mode to avoid staircase effect
|
||||||
/bin/stty onlcr
|
/bin/stty onlcr
|
||||||
|
|
||||||
echo "The system is coming down. Please wait."
|
printf "\n%s\n" "The system is coming down. Please wait."
|
||||||
|
|
||||||
if [ "$PREVLEVEL" = "2" ]; then
|
if [ "$PREVLEVEL" = "2" ]; then
|
||||||
# Shutdown services
|
# Shutdown services
|
||||||
|
printf "$(BOLD "Stopping services:")"
|
||||||
if [ "${SERVICES[*]}" ]; then
|
if [ "${SERVICES[*]}" ]; then
|
||||||
for service in "${SERVICES[@]}"; do
|
for service in "${SERVICES[@]}"; do
|
||||||
R_SERVICES=($service ${R_SERVICES[@]})
|
R_SERVICES=("$service" "${R_SERVICES[@]}")
|
||||||
done
|
done
|
||||||
for service in "${R_SERVICES[@]}"; do
|
for service in "${R_SERVICES[@]}"; do
|
||||||
/etc/rc.d/$service stop &> /tmp/rc.$$
|
printf " %s" "$service"
|
||||||
|
/etc/rc.d/$service stop &> /tmp/rc.$$ || printf "$(BOLD "$(RED "[ERROR]")")"
|
||||||
/usr/bin/logger -t $service -f /tmp/rc.$$
|
/usr/bin/logger -t $service -f /tmp/rc.$$
|
||||||
/bin/rm -f /tmp/rc.$$
|
/bin/rm -f /tmp/rc.$$
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
printf '\n'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Terminate all processes
|
# Terminate all processes
|
||||||
|
10
rc/rc.single
10
rc/rc.single
@ -5,16 +5,18 @@
|
|||||||
|
|
||||||
# Load configuration
|
# Load configuration
|
||||||
. /etc/rc.conf
|
. /etc/rc.conf
|
||||||
|
# Load functions
|
||||||
|
. /etc/rc.functions
|
||||||
|
|
||||||
if [ "$PREVLEVEL" = "2" ]; then
|
if [ "$PREVLEVEL" = "2" ]; then
|
||||||
# Shutdown services
|
# Shutdown services
|
||||||
if [ "${SERVICES[*]}" ]; then
|
if [ "${SERVICES[*]}" ]; then
|
||||||
for service in "${SERVICES[@]}"; do
|
for service in "${SERVICES[@]}"; do
|
||||||
R_SERVICES=($service ${R_SERVICES[@]})
|
R_SERVICES=("$service ${R_SERVICES[@]}")
|
||||||
done
|
done
|
||||||
for service in "${R_SERVICES[@]}"; do
|
for service in "${R_SERVICES[@]}"; do
|
||||||
/etc/rc.d/$service stop &> /tmp/rc.$$
|
/etc/rc.d/"$service" stop &> /tmp/rc.$$
|
||||||
/usr/bin/logger -t $service -f /tmp/rc.$$
|
/usr/bin/logger -t "$service" -f /tmp/rc.$$
|
||||||
/bin/rm -f /tmp/rc.$$
|
/bin/rm -f /tmp/rc.$$
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
@ -36,7 +38,7 @@ if [ "$PREVLEVEL" != "N" ]; then
|
|||||||
# Start udev
|
# Start udev
|
||||||
/sbin/start_udev
|
/sbin/start_udev
|
||||||
|
|
||||||
if [ -f /etc/rc.d/$SYSLOG -a -x /etc/rc.d/$SYSLOG ]; then
|
if [ -f /etc/rc.d/$SYSLOG ] && [ -x /etc/rc.d/$SYSLOG ]; then
|
||||||
/etc/rc.d/$SYSLOG start &> /dev/null
|
/etc/rc.d/$SYSLOG start &> /dev/null
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user