diff options
author | Roy Marples <roy@marples.name> | 2007-07-25 20:58:23 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-07-25 20:58:23 +0000 |
commit | 075e80b358b3ea10c9a66caf6dd38c4ddc89f82c (patch) | |
tree | 21ffbe2ad35c5da99b05d5a961fe0d391af29310 /init.d | |
parent | af2d9995d78c0ac019f047e235eba71e421b83cf (diff) |
Merge some of reb's OpenBSD fixes in
Diffstat (limited to 'init.d')
-rwxr-xr-x | init.d/bootmisc | 9 | ||||
-rwxr-xr-x | init.d/checkroot | 7 | ||||
-rwxr-xr-x | init.d/localmount | 22 |
3 files changed, 23 insertions, 15 deletions
diff --git a/init.d/bootmisc b/init.d/bootmisc index 6be844e1..f0508f59 100755 --- a/init.d/bootmisc +++ b/init.d/bootmisc @@ -53,7 +53,8 @@ start() { find /var/lock -type f -print0 | xargs -0 rm -f -- # Clean up /var/run and create /var/run/utmp so we can login. - for x in $(find /var/run ! -type d ! -name utmp ! -name innd.pid ! -name random-seed ! -name ld-elf.so.hints); do + for x in $(find /var/run ! -type d ! -name utmp ! -name innd.pid \ + ! -name random-seed ! -name ld-elf.so.hints ! -name ld.so.hints); do [ ! -f "${x}" ] && continue # Do not remove pidfiles of already running daemons case "${x}" in @@ -66,9 +67,9 @@ start() { done # Reset pam_console permissions if we are actually using it - if [ -x /sbin/pam_console_apply -a ! -c /dev/.devfsd ] ; then - if [ -n $(grep -v -e '^[[:space:]]*#' /etc/pam.d/* | grep 'pam_console') ] ; then - /sbin/pam_console_apply -r + if [ -x /sbin/pam_console_apply ] && ! [ -c /dev/.devfsd ] ; then + if grep -v -e '^[[:space:]]*#' /etc/pam.d/* | grep -q 'pam_console.so' ; then + pam_console_apply -r fi fi diff --git a/init.d/checkroot b/init.d/checkroot index a35d4586..72a59388 100755 --- a/init.d/checkroot +++ b/init.d/checkroot @@ -32,8 +32,11 @@ do_mtab() { } do_fsck() { - local retval=0 opts="-F" - [ "${RC_UNAME}" = "Linux" ] && opts="-T -C0" + local retval=0 opts= + case "${RC_UNAME}" in + FreeBSD) opts="-F";; + Linux) opts="-T -C0";; + esac # Don't bother doing a fsck on these if [ -n "${CDBOOT}" ] || is_net_fs / || is_union_fs / ; then diff --git a/init.d/localmount b/init.d/localmount index ff841a2e..7e20c3df 100755 --- a/init.d/localmount +++ b/init.d/localmount @@ -21,9 +21,9 @@ start() { mount -at "${types}" eend $? "Some local filesystem failed to mount" - # Change the mount options of already mounted paritions + # Change the mount options of already mounted partitions # This is needed when /usr is separate and coming back from single user - if [ "${RC_UNAME}" != "Linux" ] ; then + if [ "${RC_UNAME}" = "FreeBSD" ] ; then mount -uao fstab -t "${types},linprocfs" fi @@ -34,13 +34,17 @@ start() { chmod 700 "${dumpdir}" fi - # Don't quote ${KERNEL_DUMP_DEVICE}, so that if it's unset, savecore - # will check on the partitions listed in fstab without errors in the - # output - if savecore -C "${dumpdir}" ${KERNEL_DUMP_DEVICE} >/dev/null ; then - local savecoreopts="${dumpdir} ${KERNEL_DUMP_DEVICE}" - [ "${KERNEL_DUMP_COMPRESS}" = "yes" ] \ - && savecoreopts="-z ${savecoreopts}" + if [ "${RC_UNAME}" = "FreeBSD" ] ; then + # Don't quote ${KERNEL_DUMP_DEVICE}, so that if it's unset, + # savecore will check on the partitions listed in fstab + # without errors in the output + savecore -C "${dumpdir}" ${KERNEL_DUMP_DEVICE} >/dev/null + else + ls "${dumpdir}"/bsd* > /dev/null 2>&1 + fi + if [ $? = 0 ] ; then + local sopts="${dumpdir} ${KERNEL_DUMP_DEVICE}" + [ "${KERNEL_DUMP_COMPRESS}" = "yes" ] && sopts="-z ${sopts}" ebegin "Saving kernel core dump in" "${dumpdir}" savecore ${savecoreopts} >/dev/null eend $? |