From 5faa9c0367e8d6b1ee1c45f1ebeffd3e53ef35e8 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Mon, 25 Jul 2011 01:00:53 +0100 Subject: Turn the init.d scripts into autoconf config files This change ensures the paths used by the provided init scripts always reference the prefixes provided at configure time. The @sbindir@ and @sysconfdir@ prefixes will be correctly replaced at build time. Signed-off-by: Brian Behlendorf Closes #336 --- etc/init.d/zfs.lsb | 132 ----------------------------------------------------- 1 file changed, 132 deletions(-) delete mode 100644 etc/init.d/zfs.lsb (limited to 'etc/init.d/zfs.lsb') diff --git a/etc/init.d/zfs.lsb b/etc/init.d/zfs.lsb deleted file mode 100644 index ce541a9cd..000000000 --- a/etc/init.d/zfs.lsb +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# -# zfs This script will mount/umount the zfs filesystems. -# -# chkconfig: 2345 01 99 -# description: This script will mount/umount the zfs filesystems during -# system boot/shutdown. Configuration of which filesystems -# should be mounted is handled by the zfs 'mountpoint' and -# 'canmount' properties. See the zfs(8) man page for details. -# It is also responsible for all userspace zfs services. -# -### BEGIN INIT INFO -# Provides: zfs -# Required-Start: $local_fs -# Required-Stop: $local_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Should-Stop: -# Short-Description: Mount/umount the zfs filesystems -# Description: ZFS is an advanced filesystem designed to simplify managing -# and protecting your data. This service mounts the ZFS -# filesystems and starts all related zfs services. -### END INIT INFO - -# Source function library. -. /lib/lsb/init-functions - -# Source zfs configuration. -[ -f /etc/defaults/zfs ] && . /etc/defaults/zfs - -RETVAL=0 - -LOCKFILE=/var/lock/zfs -CACHEFILE=/etc/zfs/zpool.cache -ZPOOL=/sbin/zpool -ZFS=/sbin/zfs - -[ -x $ZPOOL ] || exit 1 -[ -x $ZFS ] || exit 2 - -start() -{ - [ -f $LOCKFILE ] && return 3 - - # Requires selinux policy which has not been written. - if [ -r "/selinux/enforce" ] && - [ "$(cat /selinux/enforce)" = "1" ]; then - - log_failure_msg "SELinux ZFS policy required" - return 4 - fi - - # Delay until all required block devices are present. - udevadm settle - - # Load the zfs module stack - /sbin/modprobe zfs - - # Ensure / exists in /etc/mtab, if not update mtab accordingly. - # This should be handled by rc.sysinit but lets be paranoid. - awk '$2 == "/" { exit 1 }' /etc/mtab - RETVAL=$? - if [ $RETVAL -eq 0 ]; then - /bin/mount -f / - fi - - # Import all pools described by the cache file, and then mount - # all filesystem based on their properties. - if [ -f $CACHEFILE ] ; then - log_begin_msg "Importing ZFS pools" - $ZPOOL import -c $CACHEFILE -aN 2>/dev/null - log_end_msg $? - - log_begin_msg "Mounting ZFS filesystems" - $ZFS mount -a - log_end_msg $? - - log_begin_msg "Exporting ZFS filesystems" - $ZFS share -a - log_end_msg $? - fi - - touch $LOCKFILE -} - -stop() -{ - [ ! -f $LOCKFILE ] && return 3 - - log_begin_msg "Unmounting ZFS filesystems" - $ZFS umount -a - log_end_msg $? - - rm -f $LOCKFILE -} - -status() -{ - [ ! -f $LOCKFILE ] && return 3 - - $ZPOOL status && echo && $ZPOOL list -} - -case "$1" in - start) - start - RETVAL=$? - ;; - stop) - stop - RETVAL=$? - ;; - status) - status - RETVAL=$? - ;; - restart) - stop - start - ;; - condrestart) - if [ -f $LOCKFILE ]; then - stop - start - fi - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart}" - ;; -esac - -exit $RETVAL -- cgit v1.2.3