From a9aec71a176d39a01e691b22156ca1a1dc49034c Mon Sep 17 00:00:00 2001 From: ccsmart Date: Sat, 16 Jul 2005 12:17:13 +0000 Subject: Moved populate-volatile to suggested place. --- .../initscripts-1.0/openslug/populate-volatile.sh | 64 ---------------------- .../initscripts/initscripts-1.0/openslug/volatiles | 29 ---------- .../initscripts-1.0/populate-volatile.sh | 64 ++++++++++++++++++++++ packages/initscripts/initscripts-1.0/volatiles | 29 ++++++++++ 4 files changed, 93 insertions(+), 93 deletions(-) delete mode 100755 packages/initscripts/initscripts-1.0/openslug/populate-volatile.sh delete mode 100644 packages/initscripts/initscripts-1.0/openslug/volatiles create mode 100755 packages/initscripts/initscripts-1.0/populate-volatile.sh create mode 100644 packages/initscripts/initscripts-1.0/volatiles (limited to 'packages/initscripts') diff --git a/packages/initscripts/initscripts-1.0/openslug/populate-volatile.sh b/packages/initscripts/initscripts-1.0/openslug/populate-volatile.sh deleted file mode 100755 index 311a2764da..0000000000 --- a/packages/initscripts/initscripts-1.0/openslug/populate-volatile.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh - -. /etc/default/rcS -CFGFILE="/etc/default/volatiles" - -[ "${VERBOSE}" != "no" ] && echo "Populating volatile Filesystems." - -cat ${CFGFILE} | grep -v "^#" | \ -while read LINE; do - TTYPE=`echo ${LINE} | cut -d " " -f 1` - TUSER=`echo ${LINE} | cut -d " " -f 2` - TGROUP=`echo ${LINE} | cut -d " " -f 3` - TMODE=`echo ${LINE} | cut -d " " -f 4` - TNAME=`echo ${LINE} | cut -d " " -f 5` - - [ "${VERBOSE}" != "no" ] && echo "Checking for -${TNAME}-." - - [ "${TTYPE}" = "l" ] && { - [ -e "${TNAME}" ] && { - echo "Cannot create link over existing -${TNAME}-." >&2 - } || { - TSOURCE=`echo ${LINE} | cut -d " " -f 6` - [ "${VERBOSE}" != "no" ] && echo "Creating link -${TNAME}- pointing to -${TSOURCE}-." - ln -s "${TSOURCE}" "${TNAME}" - } - continue - } - - [ -L "${TNAME}" ] && { - [ "${VERBOSE}" != "no" ] && echo "Found link." - NEWNAME=`ls -l "${TNAME}" | sed -e 's/^.*-> \(.*\)$/\1/'` - echo ${NEWNAME} | grep -v "^/" >/dev/null && { - TNAME="`echo ${TNAME} | sed -e 's@\(.*\)/.*@\1@'`/${NEWNAME}" - [ "${VERBOSE}" != "no" ] && echo "Converted relative linktarget to absolute path -${TNAME}-." - } || { - TNAME="${NEWNAME}" - [ "${VERBOSE}" != "no" ] && echo "Using absolute link target -${TNAME}-." - } - } - - [ -e "${TNAME}" ] && { - [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping." - continue - } - - case "${TTYPE}" in - "f") [ "${VERBOSE}" != "no" ] && echo "Creating file -${TNAME}-." - touch "${TNAME}" - ;; - "d") [ "${VERBOSE}" != "no" ] && echo "Creating directory -${TNAME}-." - mkdir -p "${TNAME}" - # Add check to see if there's an entry in fstab to mount. - ;; - *) [ "${VERBOSE}" != "no" ] && echo "Invalid type -${TTYPE}-." - continue - ;; - esac - - chown ${TUSER} ${TNAME} || echo "Failed to set owner -${TUSER}- for -${TNAME}-." >&2 - chgrp ${TGROUP} ${TNAME} || echo "Failed to set group -${TGROUP}- for -${TNAME}-." >&2 - chmod ${TMODE} ${TNAME} || echo "Failed to set mode -${TMODE}- for -${TNAME}-." >&2 - - done - diff --git a/packages/initscripts/initscripts-1.0/openslug/volatiles b/packages/initscripts/initscripts-1.0/openslug/volatiles deleted file mode 100644 index 45d373cedc..0000000000 --- a/packages/initscripts/initscripts-1.0/openslug/volatiles +++ /dev/null @@ -1,29 +0,0 @@ -# This configuration file lists filesystem objects that should get verified -# during startup and be created if missing. -# -# Every line must either be a comment starting with # -# or a definition of format: -# [] -# where the items are separated by whitespace ! -# -# : d|f|l : (d)irectory|(f)ile|(l)ink -# -# A linking example: -# l root root 0777 /var/test /tmp/testfile -# f root root 0644 /var/test -# -d root root 0775 /var -d root root 0755 /var/backups -d root root 0755 /var/cache -d root root 0755 /var/lib -d root root 0755 /var/lib/misc -d root root 2775 /var/local -d root root 1777 /var/lock -d root root 0755 /var/lock/subsys -d root root 0755 /var/log -d root root 0755 /var/run -d root root 0755 /var/spool -d root root 1777 /var/tmp -f root root 0664 /var/run/utmp -f root root 0664 /var/log/wtmp -f root root 0664 /var/log/lastlog diff --git a/packages/initscripts/initscripts-1.0/populate-volatile.sh b/packages/initscripts/initscripts-1.0/populate-volatile.sh new file mode 100755 index 0000000000..311a2764da --- /dev/null +++ b/packages/initscripts/initscripts-1.0/populate-volatile.sh @@ -0,0 +1,64 @@ +#!/bin/sh + +. /etc/default/rcS +CFGFILE="/etc/default/volatiles" + +[ "${VERBOSE}" != "no" ] && echo "Populating volatile Filesystems." + +cat ${CFGFILE} | grep -v "^#" | \ +while read LINE; do + TTYPE=`echo ${LINE} | cut -d " " -f 1` + TUSER=`echo ${LINE} | cut -d " " -f 2` + TGROUP=`echo ${LINE} | cut -d " " -f 3` + TMODE=`echo ${LINE} | cut -d " " -f 4` + TNAME=`echo ${LINE} | cut -d " " -f 5` + + [ "${VERBOSE}" != "no" ] && echo "Checking for -${TNAME}-." + + [ "${TTYPE}" = "l" ] && { + [ -e "${TNAME}" ] && { + echo "Cannot create link over existing -${TNAME}-." >&2 + } || { + TSOURCE=`echo ${LINE} | cut -d " " -f 6` + [ "${VERBOSE}" != "no" ] && echo "Creating link -${TNAME}- pointing to -${TSOURCE}-." + ln -s "${TSOURCE}" "${TNAME}" + } + continue + } + + [ -L "${TNAME}" ] && { + [ "${VERBOSE}" != "no" ] && echo "Found link." + NEWNAME=`ls -l "${TNAME}" | sed -e 's/^.*-> \(.*\)$/\1/'` + echo ${NEWNAME} | grep -v "^/" >/dev/null && { + TNAME="`echo ${TNAME} | sed -e 's@\(.*\)/.*@\1@'`/${NEWNAME}" + [ "${VERBOSE}" != "no" ] && echo "Converted relative linktarget to absolute path -${TNAME}-." + } || { + TNAME="${NEWNAME}" + [ "${VERBOSE}" != "no" ] && echo "Using absolute link target -${TNAME}-." + } + } + + [ -e "${TNAME}" ] && { + [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping." + continue + } + + case "${TTYPE}" in + "f") [ "${VERBOSE}" != "no" ] && echo "Creating file -${TNAME}-." + touch "${TNAME}" + ;; + "d") [ "${VERBOSE}" != "no" ] && echo "Creating directory -${TNAME}-." + mkdir -p "${TNAME}" + # Add check to see if there's an entry in fstab to mount. + ;; + *) [ "${VERBOSE}" != "no" ] && echo "Invalid type -${TTYPE}-." + continue + ;; + esac + + chown ${TUSER} ${TNAME} || echo "Failed to set owner -${TUSER}- for -${TNAME}-." >&2 + chgrp ${TGROUP} ${TNAME} || echo "Failed to set group -${TGROUP}- for -${TNAME}-." >&2 + chmod ${TMODE} ${TNAME} || echo "Failed to set mode -${TMODE}- for -${TNAME}-." >&2 + + done + diff --git a/packages/initscripts/initscripts-1.0/volatiles b/packages/initscripts/initscripts-1.0/volatiles new file mode 100644 index 0000000000..45d373cedc --- /dev/null +++ b/packages/initscripts/initscripts-1.0/volatiles @@ -0,0 +1,29 @@ +# This configuration file lists filesystem objects that should get verified +# during startup and be created if missing. +# +# Every line must either be a comment starting with # +# or a definition of format: +# [] +# where the items are separated by whitespace ! +# +# : d|f|l : (d)irectory|(f)ile|(l)ink +# +# A linking example: +# l root root 0777 /var/test /tmp/testfile +# f root root 0644 /var/test +# +d root root 0775 /var +d root root 0755 /var/backups +d root root 0755 /var/cache +d root root 0755 /var/lib +d root root 0755 /var/lib/misc +d root root 2775 /var/local +d root root 1777 /var/lock +d root root 0755 /var/lock/subsys +d root root 0755 /var/log +d root root 0755 /var/run +d root root 0755 /var/spool +d root root 1777 /var/tmp +f root root 0664 /var/run/utmp +f root root 0664 /var/log/wtmp +f root root 0664 /var/log/lastlog -- cgit v1.2.3