Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # start_udev -------------------------------------------------------------------
- #!/bin/sh
- # - if /dev is not mounted - mount as a devtmpfs (CONFIG_DEVTMPFS=y)
- # - if /dev is mounted (e.g. due to handover from initramfs or
- # 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)
- UDEVOPTS="exec,nosuid,noatime,mode=0755,nr_blocks=2048,nr_inodes=16384"
- if /bin/mountpoint -q /dev ; then
- /bin/mount -n -o remount,${UDEVOPTS} dev /dev
- else
- /bin/mount -n -t devtmpfs -o ${UDEVOPTS} dev /dev
- fi
- # mount /run directory
- /bin/mountpoint -q /run || \
- /bin/mount -n -t tmpfs -o mode=0755,nosuid,nodev,exec tmpfs /run
- # copy devcies from /lib/udev/devices
- cp -ar /lib/udev/devices/* /dev
- # launch udev daemon, make sure it's not running first
- test -z "$(/bin/pidof -s udevd)" && /sbin/udevd --daemon
- # coldplug devices and wait for the queue to be processed
- /sbin/udevadm trigger --type=subsystems --action=add
- /sbin/udevadm trigger --type=devices --action=add
- /sbin/udevadm settle
- # rc.single ---------------------------------------------------------------------
- #!/bin/bash
- #
- # /etc/rc.single: single-user startup script
- #
- # Load configuration
- . /etc/rc.conf
- if [ "$PREVLEVEL" = "2" ]; then
- # Shutdown services
- if [ "${SERVICES[*]}" ]; then
- for service in "${SERVICES[@]}"; do
- R_SERVICES=($service ${R_SERVICES[@]})
- done
- for service in "${R_SERVICES[@]}"; do
- /etc/rc.d/$service stop &> /tmp/rc.$$
- /usr/bin/logger -t $service -f /tmp/rc.$$
- /bin/rm -f /tmp/rc.$$
- done
- fi
- fi
- if [ "$PREVLEVEL" != "S" ]; then
- # Terminate all processes
- /sbin/killall5 -15
- /bin/sleep 5
- /sbin/killall5 -9
- # Start udev
- /bin/mountpoint -q /run || /bin/mount -n -t proc none /proc
- /bin/mountpoint -q /run || /bin/mount -n -t sysfs none /sys
- /sbin/start_udev
- if [ -f /etc/rc.d/$SYSLOG -a -x /etc/rc.d/$SYSLOG ]; then
- /etc/rc.d/$SYSLOG start &> /dev/null
- fi
- fi
- if [ "$RUNLEVEL" = "1" ]; then
- # Enter single-user mode
- exec /sbin/init -t1 S
- fi
- # End of file
- # rc.multi ----------------------------------------------------------------------
- #!/bin/bash
- #
- # /etc/rc.multi: multi-user startup script
- #
- # Load configuration
- . /etc/rc.conf
- # Run fixes startup file
- if [ -x /etc/rc.fix ]; then
- /etc/rc.fix
- fi
- # Start services
- if [ "$SYSLOG" -o "${SERVICES[*]}" ]; then
- echo -n "starting services:"
- if pidof -x syslogd -o $$ >/dev/null; then
- echo -n " $SYSLOG"
- else
- if [ -f /etc/rc.d/$SYSLOG -a -x /etc/rc.d/$SYSLOG ]; then
- echo -n " $SYSLOG"
- /etc/rc.d/$SYSLOG start &> /dev/null || echo -n "[ERROR]"
- fi
- fi
- for service in ${SERVICES[@]}; do
- echo -n " $service"
- /etc/rc.d/$service start &> /tmp/rc.$$ || echo -n "[ERROR]"
- /usr/bin/logger -t $service -f /tmp/rc.$$
- /bin/rm -f /tmp/rc.$$
- done
- echo
- fi
- # Run local startup script
- if [ -x /etc/rc.local ]; then
- /etc/rc.local
- fi
- # End of file
Add Comment
Please, Sign In to add comment