diff options
author | Christian Heim <phreak@gentoo.org> | 2005-09-03 18:13:27 +0000 |
---|---|---|
committer | Christian Heim <phreak@gentoo.org> | 2005-09-03 18:13:27 +0000 |
commit | 883e2c3d019587e3fe404a7ce851d791953f7c8b (patch) | |
tree | 6f1494ae6042467bd2977241bdffc8e669ae0aa6 /init.d | |
parent | We don't have TERMINALS in vservers, serial consoles, three-finger-salute, de... (diff) | |
download | baselayout-vserver-883e2c3d019587e3fe404a7ce851d791953f7c8b.tar.gz baselayout-vserver-883e2c3d019587e3fe404a7ce851d791953f7c8b.tar.bz2 baselayout-vserver-883e2c3d019587e3fe404a7ce851d791953f7c8b.zip |
Removing unneeded init-scripts
svn path=/baselayout-vserver/trunk/; revision=12
Diffstat (limited to 'init.d')
-rwxr-xr-x | init.d/checkfs | 54 | ||||
-rwxr-xr-x | init.d/checkroot | 124 | ||||
-rwxr-xr-x | init.d/clock | 144 | ||||
-rwxr-xr-x | init.d/consolefont | 68 | ||||
-rwxr-xr-x | init.d/keymaps | 79 | ||||
-rwxr-xr-x | init.d/localmount | 47 | ||||
l--------- | init.d/net.eth0 | 1 | ||||
-rwxr-xr-x | init.d/netmount | 93 | ||||
-rwxr-xr-x | init.d/numlock | 34 | ||||
-rwxr-xr-x | init.d/urandom | 37 |
10 files changed, 0 insertions, 681 deletions
diff --git a/init.d/checkfs b/init.d/checkfs deleted file mode 100755 index dbdfd0a..0000000 --- a/init.d/checkfs +++ /dev/null @@ -1,54 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -depend() { - need checkroot modules -} - -start() { - local retval=0 - - # Start RAID/LVM/EVMS/DM volumes for /usr, /var, etc. - # NOTE: this should be done *before* mounting anything - [[ -z ${CDBOOT} ]] && start_volumes - - # Setup dm-crypt mappings if any - start_addon dm-crypt - - if [[ -f /fastboot ]] || [[ -n ${CDBOOT} ]] ; then - rm -f /fastboot - else - ebegin "Checking all filesystems" - if [[ -f /forcefsck ]] ; then - ewarn "A full fsck has been forced" - fsck -C -R -A -a -f - retval=$? - rm -f /forcefsck - else - fsck -C -T -R -A -a - retval=$? - fi - if [[ ${retval} -eq 0 ]] ; then - eend 0 - elif [[ ${retval} -ge 1 && ${retval} -le 3 ]] ; then - ewend 1 "Filesystem errors corrected." - # Everything should be ok, so return a pass - return 0 - else - if [[ ${RC_FORCE_AUTO} == "yes" ]] ; then - eend 2 "Fsck could not correct all errors, rerunning" - fsck -C -T -R -A -a -y - retval=$? - fi - - if [[ ${retval} -gt 3 ]] ; then - eend 2 "Fsck could not correct all errors, manual repair needed" - /sbin/sulogin ${CONSOLE} - fi - fi - fi -} - - -# vim:ts=4 diff --git a/init.d/checkroot b/init.d/checkroot deleted file mode 100755 index 613f88a..0000000 --- a/init.d/checkroot +++ /dev/null @@ -1,124 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -depend() { - before * -} - -start() { - local retval=0 - - if [[ ! -f /fastboot && -z ${CDBOOT} ]] && ! is_net_fs / ; then - if touch -c / >& /dev/null ; then - ebegin "Remounting root filesystem read-only" - mount -n -o remount,ro / - eend $? - fi - - if [[ -f /forcefsck ]] || get_bootparam "forcefsck" ; then - ebegin "Checking root filesystem (full fsck forced)" - fsck -C -a -f / - # /forcefsck isn't deleted because checkfs needs it. - # it'll be deleted in that script. - retval=$? - else - # Obey the fs_passno setting for / (see fstab(5)) - # - find the / entry - # - make sure we have 6 fields - # - see if fs_passno is something other than 0 - if [[ -n $(awk '($1 ~ /^(\/|UUID|LABEL)/ && $2 == "/" \ - && NF == 6 && $6 != 0) { print }' /etc/fstab) ]] - then - ebegin "Checking root filesystem" - fsck -C -T -a / - retval=$? - else - ebegin "Skipping root filesystem check (fstab's passno == 0)" - retval=0 - fi - fi - - if [[ ${retval} -eq 0 ]] ; then - eend 0 - elif [[ ${retval} -eq 1 ]] ; then - ewend 1 "Filesystem repaired" - elif [[ ${retval} -eq 2 || ${retval} -eq 3 ]] ; then - ewend 1 "Filesystem repaired, but reboot needed!" - echo -ne "\a"; sleep 1; echo -ne "\a"; sleep 1 - echo -ne "\a"; sleep 1; echo -ne "\a"; sleep 1 - ewarn "Rebooting in 10 seconds ..." - sleep 10 - einfo "Rebooting" - /sbin/reboot -f - else - if [[ ${RC_FORCE_AUTO} == "yes" ]] ; then - eend 2 "Rerunning fsck in force mode" - fsck -y -C -T -a / - else - eend 2 "Filesystem couldn't be fixed :(" - /sbin/sulogin ${CONSOLE} - fi - einfo "Unmounting filesystems" - /bin/mount -a -o remount,ro &> /dev/null - einfo "Rebooting" - /sbin/reboot -f - fi - fi - - # Should we mount root rw ? - if mount -vf -o remount / 2> /dev/null | \ - awk '{ if ($6 ~ /rw/) exit 0; else exit 1; }' - then - ebegin "Remounting root filesystem read/write" - mount -n -o remount,rw / &> /dev/null - if [[ $? -ne 0 ]] ; then - eend 2 "Root filesystem could not be mounted read/write :(" - if [[ ${RC_FORCE_AUTO} != "yes" ]] ; then - /sbin/sulogin ${CONSOLE} - fi - else - eend 0 - fi - fi - - if [[ ${BOOT} == "yes" ]] ; then - local x= - local y= - - # - # Create /etc/mtab - # - - # Don't create mtab if /etc is readonly - if ! touch /etc/mtab 2> /dev/null ; then - ewarn "Skipping /etc/mtab initialization (ro root?)" - return 0 - fi - - # Clear the existing mtab - > /etc/mtab - - # Add the entry for / to mtab - mount -f / - - # Don't list root more than once - awk '$2 != "/" {print}' /proc/mounts >> /etc/mtab - - # Now make sure /etc/mtab have additional info (gid, etc) in there - for x in $(awk '{ print $2 }' /proc/mounts | sort -u) ; do - for y in $(awk '{ print $2 }' /etc/fstab) ; do - if [[ ${x} == ${y} ]] ; then - mount -f -o remount $x - continue - fi - done - done - - # Remove stale backups - rm -f /etc/mtab~ /etc/mtab~~ - fi -} - - -# vim:ts=4 diff --git a/init.d/clock b/init.d/clock deleted file mode 100755 index 2ce9616..0000000 --- a/init.d/clock +++ /dev/null @@ -1,144 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -opts="save" - -depend() { - need localmount -} - -setupopts() { - if is_uml_sys ; then - TBLURB="UML" - fakeit=1 - elif is_vserver_sys ; then - TBLURB="VServer" - fakeit=1 - elif is_xenU_sys ; then - TBLURB="xen" - fakeit=1 - elif grep -q ' cobd$' /proc/devices ; then - TBLURB="coLinux" - fakeit=1 - elif [[ ${CLOCK} == "UTC" ]] ; then - myopts="--utc" - TBLURB="UTC" - else - myopts="--localtime" - TBLURB="Local Time" - fi - [[ ${fakeit} -eq 1 ]] && return 0 - - if [[ ${readonly} == "yes" ]] ; then - myadj="--noadjfile" - else - myadj="--adjust" - fi - - if [[ ${SRM} == "yes" ]] ; then - myopts="${myopts} --srm" - fi - if [[ ${ARC} == "arc" ]] ; then - myopts="${myopts} --arc" - fi - myopts="${myopts} ${CLOCK_OPTS}" - - # Make sure user isn't using rc.conf anymore. - if grep -qs ^CLOCK= /etc/rc.conf ; then - ewarn "CLOCK should not be set in /etc/rc.conf but in /etc/conf.d/clock" - fi -} - -start() { - local myopts="" - local myadj="" - local TBLURB="" fakeit=0 - local errstr="" - local readonly="no" - local ret=0 - - if ! touch /etc/adjtime 2>/dev/null ; then - readonly="yes" - elif [[ ! -s /etc/adjtime ]] ; then - echo "0.0 0 0.0" > /etc/adjtime - fi - - setupopts - - if [[ ${fakeit} -ne 1 && ! -e /dev/rtc ]] ; then - local x - einfon "Waiting for /dev/rtc to appear" - for x in $(seq 10) ; do - if [[ ! -e /dev/rtc ]] ; then - echo -n "." - sleep 1 - else - echo - fi - done - fi - - ebegin "Setting system clock to hardware clock [${TBLURB}]" - if [[ ${fakeit} -eq 1 ]] ; then - ret=0 - - elif [[ -x /sbin/hwclock ]] ; then - # Since hwclock always exit's with a 0, need to check its output. - errstr=$(/sbin/hwclock ${myadj} ${myopts} 2>&1 >/dev/null) - errstr="${errstr}$(/sbin/hwclock --hctosys ${myopts} 2>&1 >/dev/null)" - - if [[ -n ${errstr} ]] ; then - ewarn "${errstr}" - ret=1 - else - ret=0 - fi - errstr="Failed to set system clock to hardware clock" - else - ret=1 - errstr="/sbin/hwclock not found" - fi - eend ${ret} "${errstr}" -} - -stop() { - # Don't tweak the hardware clock on LiveCD halt. - [[ -n ${CDBOOT} ]] && return 0 - - [[ ${CLOCK_SYSTOHC} != "yes" ]] && return 0 - - local myopts="" - local TBLURB="" - local errstr="" - local ret=0 - - setupopts - - ebegin "Syncing system clock to hardware clock [${TBLURB}]" - if [[ ${fakeit} -eq 1 ]] ; then - ret=0 - - elif [[ -x /sbin/hwclock ]] ; then - errstr=$(/sbin/hwclock --systohc ${myopts} 2>&1 >/dev/null) - - if [[ -n ${errstr} ]] ; then - ret=1 - else - ret=0 - fi - errstr="Failed to sync clocks" - else - ret=1 - errstr="/sbin/hwclock not found" - fi - eend ${ret} "${errstr}" -} - -save() { - CLOCK_SYSTOHC="yes" - stop -} - - -# vim:ts=4 diff --git a/init.d/consolefont b/init.d/consolefont deleted file mode 100755 index 35daa11..0000000 --- a/init.d/consolefont +++ /dev/null @@ -1,68 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -depend() { - need localmount - need keymaps # sets up terminal encoding scheme - after hotplug -} - -start() { - if is_uml_sys ; then - ebegin "Setting user font" - eend 0 - return 0 - elif [[ -z ${CONSOLEFONT} ]] ; then - ebegin "Using the default console font" - eend 0 - return 0 - fi - - local x= - local param= - local sf_param= - local retval=1 - - # Get additional parameters - if [[ -n ${CONSOLETRANSLATION} ]] ; then - param="-m ${CONSOLETRANSLATION}" - fi - - # Set the console font - local errmsg="" - ebegin "Setting user font" - if [[ -x /bin/setfont ]] ; then - # We patched setfont to have --tty support ... - if [[ -n $(setfont --help 2>&1 | grep -e '--tty') || \ - -n $(setfont --help 2>&1 | grep -e '-C') ]] - then - if [[ -n $(setfont --help 2>&1 | grep -e '--tty') ]] ; then - sf_param="--tty=" - else - sf_param="-C " - fi - local ttydev= - [[ -d /dev/vc ]] \ - && ttydev=/dev/vc/ \ - || ttydev=/dev/tty - - for x in $(seq 1 "${RC_TTY_NUMBER}") ; do - /bin/setfont ${CONSOLEFONT} ${param} \ - ${sf_param}/${ttydev}${x} > /dev/null - retval=$? - done - else - /bin/setfont ${CONSOLEFONT} ${param} > /dev/null - retval=$? - fi - errmsg="Failed to set user font" - else - retval=1 - errmsg="/bin/setfont not found" - fi - eend ${retval} "${errmsg}" -} - - -# vim:ts=4 diff --git a/init.d/keymaps b/init.d/keymaps deleted file mode 100755 index 255abd2..0000000 --- a/init.d/keymaps +++ /dev/null @@ -1,79 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -depend() { - need localmount -} - -checkconfig() { - if [[ -z ${KEYMAP} ]] ; then - eerror "You need to setup KEYMAP in /etc/conf.d/keymaps first" - return 1 - fi - - # Make sure user isn't using rc.conf anymore - if grep -qs ^KEYMAP= /etc/rc.conf ; then - ewarn "KEYMAP should not be set in /etc/rc.conf but in /etc/conf.d/keymaps" - fi -} - -start() { - if is_uml_sys ; then - ebegin "Loading key mappings" - eend 0 - return 0 - fi - - local WINDOWKEYS_KEYMAP= - - checkconfig || return 1 - - # Force linux keycodes for PPC. - if [[ -f /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes ]] ; then - echo 1 > /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes - fi - - # Turn on unicode if user wants it - if [[ ${UNICODE} == "yes" ]] ; then - /usr/bin/kbd_mode -u - fi - - ebegin "Loading key mappings" - if [[ -x /bin/loadkeys ]] ; then - [[ ${SET_WINDOWKEYS} == "yes" ]] && WINDOWKEYS_KEYMAP="windowkeys" - /bin/loadkeys -q ${WINDOWKEYS_KEYMAP} ${KEYMAP} \ - ${EXTENDED_KEYMAPS} > /dev/null - eend $? "Error loading key mappings" - else - eend 1 "/bin/loadkeys not found" - return 1 - fi - - # Set terminal encoding to either ASCII or UNICODE. - # See utf-8(7) for more information. - local termencoding="" termmsg="" - if [[ ${UNICODE} == "yes" ]] ; then - local dumpkey_opts="" - [[ -n ${DUMPKEYS_CHARSET} ]] && dumpkey_opts="-c ${DUMPKEYS_CHARSET}" - - dumpkeys ${dumpkey_opts} | loadkeys --unicode - termencoding=$'\033%G' - termmsg="UTF-8" - else - termencoding=$'\033(K' - termmsg="ASCII" - fi - local n ttydev="" - [[ -d /dev/vc ]] \ - && ttydev=/dev/vc/ \ - || ttydev=/dev/tty - ebegin "Setting terminal encoding to ${termmsg}" - for n in $(seq 1 "${RC_TTY_NUMBER}") ; do - echo -n -e ${termencoding} > ${ttydev}${n} - done - eend 0 -} - - -# vim:ts=4 diff --git a/init.d/localmount b/init.d/localmount deleted file mode 100755 index fc49539..0000000 --- a/init.d/localmount +++ /dev/null @@ -1,47 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -depend() { - need checkfs -} - -start() { - # Mount local filesystems in /etc/fstab. - ebegin "Mounting local filesystems" - mount -at noproc,noshm,no${NET_FS_LIST// /,no} >/dev/null - eend $? "Some local filesystem failed to mount" - - # Make sure we insert usbcore if its a module - if [[ -f /proc/modules && ! -d /proc/bus/usb ]] ; then - # >/dev/null to hide errors from non-USB users - modprobe usbcore &> /dev/null - fi - - # Check what USB fs the kernel support. Currently - # 2.5+ kernels, and later 2.4 kernels have 'usbfs', - # while older kernels have 'usbdevfs'. - local usbfs=$(grep -Fow usbfs /proc/filesystems || - grep -Fow usbdevfs /proc/filesystems) - - if [[ -n ${usbfs} ]] && \ - [[ -e /proc/bus/usb && ! -e /proc/bus/usb/devices ]] - then - ebegin "Mounting USB device filesystem (${usbfs})" - usbgid=$(awk -F: '/^usb:/{print $3; exit}' /etc/group) - mount -t ${usbfs} usbfs /proc/bus/usb \ - ${usbgid:+-o devmode=0664,devgid=${usbgid}} - eend $? "Failed to mount USB device filesystem" - fi - - # Swap on loopback devices, and other weirdnesses - ebegin "Activating (possibly) more swap" - /sbin/swapon -a - eend $? - - # Start dm-crypt mappings, if any - start_addon dm-crypt -} - - -# vim:ts=4 diff --git a/init.d/net.eth0 b/init.d/net.eth0 deleted file mode 120000 index 3843c79..0000000 --- a/init.d/net.eth0 +++ /dev/null @@ -1 +0,0 @@ -net.lo
\ No newline at end of file diff --git a/init.d/netmount b/init.d/netmount deleted file mode 100755 index 104bfd8..0000000 --- a/init.d/netmount +++ /dev/null @@ -1,93 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -depend() { - local myneed="net" - local myuse="" - - # Only have Portmap as a dependency if there is a nfs mount in fstab - # that should be mounted at boot time. Also filter out comments. - local nfsmounts=$(awk '!/^#/ && ($3=="nfs" || $3=="nfs4") && $4 !~ /noauto/ { print $0 }' /etc/fstab) - - if [ -n "${nfsmounts}" ] - then - myneed="${myneed} portmap" - myuse="${myuse} nfs nfsmount" - fi - - need ${myneed} - use ${myuse} -} - -start() { - local rcfilesystems="" - - # Only try to mount NFS filesystems if portmap was started. - # This is to fix "hang" problems for new users who do not - # add portmap to the default runlevel. - if [ -L "${svcdir}/started/portmap" ] - then - rcfilesystems="${NET_FS_LIST// /,}" # convert to comma-separated - else - rcfilesystems=" ${NET_FS_LIST} " - rcfilesystems=${rcfilesystems// nfs /} # remove nfs - rcfilesystems=${rcfilesystems// nfs4 /} # remove nfs4 - rcfilesystems=${rcfilesystems# } # remove front and - rcfilesystems=${rcfilesystems% } # back spaces - rcfilesystems=${rcfilesystems// /,} # convert to comma-separated - fi - - ebegin "Mounting network filesystems" - mount -at ${rcfilesystems} >/dev/null - - if [ "$?" -ne 0 ] - then - ewend 1 "Could not mount all network filesystems!" - else - eend 0 - fi - - return 0 -} - -stop() { - local ret - ebegin "Unmounting network filesystems" - [ -z "$(umount -art ${NET_FS_LIST// /,} 2>&1)" ] - ret=$? - eend ${ret} "Failed to simply unmount filesystems" - [ ${ret} -eq 0 ] && return 0 - - # `umount -a` will fail if the filesystems are in use. - # Here we use fuser to kill off processes that are using - # the filesystems so that we can unmount properly. - # We will gradually use harsher kill signals so that the - # processes know we aren't screwing around here ;). - declare -a siglist=( "TERM" "KILL" "KILL" ) - local retry=0 - local remaining="go" - - while [ -n "${remaining}" -a ${retry} -lt 3 ] - do - # Populate $remaining with a newline-delimited list of network - # filesystems. Mount points have spaces swapped for '\040' (see - # fstab(5)) so we have to translate them back to spaces. - remaining="$(awk '$3 ~ /'${NET_FS_LIST// /|}'/ { if ($2 != "/") print $2 }' /proc/mounts | sort -r)" - # Since we have to worry about the spaces being quoted properly, - # we'll use `set --` and then "$@" to get the correct result. - IFS=$'\n' - set -- ${remaining//\\040/ } - unset IFS - [ -z "${remaining}" ] && break - - # try to unmount again - ebegin $'\t'"Unmounting network filesystems (retry #$((retry+1)))" - /bin/fuser -k -${siglist[$((retry++))]} -m "$@" &>/dev/null - sleep 5 - umount "$@" &>/dev/null - eend $? $'\t'"Failed to unmount filesystems" - done -} - -# vim:ts=4 diff --git a/init.d/numlock b/init.d/numlock deleted file mode 100755 index 22654f0..0000000 --- a/init.d/numlock +++ /dev/null @@ -1,34 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -depend() { - need localmount -} - -start() { - ebegin "Enabling numlock on ttys" - local dev - [[ -d /dev/vc ]] \ - && dev=/dev/vc/ \ - || dev=/dev/tty - for tty in $(seq 1 "${RC_TTY_NUMBER}") ; do - setleds -D +num < ${dev}${tty} &> /dev/null - done - eend $? "Failed to enable numlock" -} - -stop() { - ebegin "Disabling numlock on ttys" - local dev - [[ -d /dev/vc ]] \ - && dev=/dev/vc/ \ - || dev=/dev/tty - for tty in $(seq 1 "${RC_TTY_NUMBER}") ; do - setleds -D -num < ${dev}${tty} &> /dev/null - done - eend $? "Failed to disable numlock" -} - - -# vim:ts=4 diff --git a/init.d/urandom b/init.d/urandom deleted file mode 100755 index 368130d..0000000 --- a/init.d/urandom +++ /dev/null @@ -1,37 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -depend() { - need localmount -} - -start() { - [[ -c /dev/urandom ]] || return - if [[ -f /var/run/random-seed ]] ; then - cat /var/run/random-seed > /dev/urandom - fi - if ! rm -f /var/run/random-seed &> /dev/null ; then - ewarn "Skipping /var/run/random-seed initialization (ro root?)" - return 0 - fi - ebegin "Initializing random number generator" - umask 077 - dd if=/dev/urandom of=/var/run/random-seed count=1 &> /dev/null - eend $? "Error initializing random number generator" - umask 022 -} - -stop() { - [[ -n ${CDBOOT} ]] && return 0 - - ebegin "Saving random seed" - # Carry a random seed from shut-down to start-up; - # see documentation in linux/drivers/char/random.c - umask 077 - dd if=/dev/urandom of=/var/run/random-seed count=1 &> /dev/null - eend $? "Failed to save random seed" -} - - -# vim:ts=4 |