diff options
-rw-r--r-- | etc/conf.d/rc | 6 | ||||
-rwxr-xr-x | sbin/functions.sh | 19 | ||||
-rwxr-xr-x | sbin/rc-update | 9 |
3 files changed, 34 insertions, 0 deletions
diff --git a/etc/conf.d/rc b/etc/conf.d/rc index 1f38cb4..a301863 100644 --- a/etc/conf.d/rc +++ b/etc/conf.d/rc @@ -5,6 +5,12 @@ RC_PARALLEL_STARTUP="no" +# RC_BOOTLOG will generate a log of the boot messages shown on the console. +# Useful for headless machines or debugging. You need to emerge the +# app-admin/showconsole package for this to work. + +RC_BOOTLOG="no" + # # Controlling start-stop-daemon behavior diff --git a/sbin/functions.sh b/sbin/functions.sh index c6ac5d6..1cb1c08 100755 --- a/sbin/functions.sh +++ b/sbin/functions.sh @@ -515,6 +515,25 @@ get_base_ver() { echo ${ver##* } } +# Network filesystems list for common use in rc-scripts. +# This variable is used in is_net_fs and other places such as +# localmount. +NET_FS_LIST="afs cifs coda davfs gfs ncpfs nfs nfs4 ocfs2 shfs smbfs" + +# bool is_net_fs(path) +# +# return 0 if path is the mountpoint of a networked filesystem +# +# EXAMPLE: if is_net_fs / ; then ... +# +is_net_fs() { + local fstype + # /proc/mounts is always accurate + fstype=$( sed -n -e '/^rootfs/!s:.* '"$1"' \([^ ]*\).*:\1:p' /proc/mounts ) + [[ " ${NET_FS_LIST} " == *" ${fstype} "* ]] + return $? +} + # bool is_uml_sys() # # return 0 if the currently running system is User Mode Linux diff --git a/sbin/rc-update b/sbin/rc-update index 65cd011..62b2d06 100755 --- a/sbin/rc-update +++ b/sbin/rc-update @@ -15,10 +15,19 @@ usage: rc-update -a|add script runlevel2 [runlevel2 ...] rc-update -s|show [runlevel1 ...] examples: + # rc-update add sysklogd default + Adds the sysklogd script (in /etc/init.d) to the "default" runlevel. + # rc-update del sysklogd Deletes the sysklogd script from all runlevels. The original script is not deleted, just any symlinks to the script in /etc/runlevels/*. + # rc-update del sysklogd default wumpus + Delete the sysklogd script from the default and wumpus runlevels. + All other runlevels are unaffected. Again, the sysklogd script + residing in /etc/init.d is not deleted, just any symlinks in + /etc/runlevels/default and /etc/runlevels/wumpus. + # rc-update show Show all the available scripts and list at which runlevels they will execute. |