use systemd

This commit is contained in:
Dietmar Maurer 2015-03-15 15:38:33 +01:00
parent 9959b4fc3a
commit 2335fd5207
4 changed files with 21 additions and 171 deletions

View File

@ -13,7 +13,7 @@ REVISION := $(shell dpkg-parsechangelog \
META_DISTDIR := $(CURDIR)/$(META_NAME)-$(VERSION)/
%:
dh $@ --with autoreconf,dkms
dh $@ --with autoreconf,dkms,systemd
override_dh_auto_configure:
@# Embed the downstream version in the module.
@ -27,6 +27,8 @@ override_dh_auto_configure:
--bindir=/bin \
--sbindir=/sbin \
--libdir=/lib \
--with-systemdunitdir=/lib/systemd/system \
--with-systemdpresetdir=/lib/systemd/system-preset \
--with-udevdir=/lib/udev \
--with-config=user
@ -88,19 +90,25 @@ override_dh_install:
override_dh_installdocs:
dh_installdocs --link-doc=zfs-doc
#override_dh_systemd_enable:
# dh_systemd_enable -pzfsutils --name
#override_dh_systemd_start:
# dh_systemd_start -pcorosync-pve --name corosync --no-start
override_dh_installinit:
@# Install debian/zfsutils.zfs.default as /etc/default/zfs.
dh_installinit --name=zfs
# @# Install debian/zfsutils.zfs.default as /etc/default/zfs.
# dh_installinit --name=zfs
@# Install the /etc/init.d/zfs-mount script.
@# Debian runs local mounts at sysv sequences [10..12] [08..09].
dh_installinit --name=zfs-mount \
--no-restart-on-upgrade --no-start -- defaults 13 07
# @# Install the /etc/init.d/zfs-mount script.
# @# Debian runs local mounts at sysv sequences [10..12] [08..09].
# dh_installinit --name=zfs-mount \
# --no-restart-on-upgrade --no-start -- defaults 13 07
@# Debian runs nfs-kernel-server at sysv sequence 17 01,
@# iscsitarget at 02 01, and samba at 01 02.
dh_installinit --name=zfs-share \
--no-restart-on-upgrade --no-start -- defaults 18 00
# @# Debian runs nfs-kernel-server at sysv sequence 17 01,
# @# iscsitarget at 02 01, and samba at 01 02.
# dh_installinit --name=zfs-share \
# --no-restart-on-upgrade --no-start -- defaults 18 00
override_dh_installudev:

View File

@ -1,4 +1,6 @@
../tree/zfsutils/* /
sbin
lib/udev
lib/systemd
usr/share/man
etc/zfs/zed.d/zed.rc

View File

@ -1,80 +0,0 @@
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: zvol zfs
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Mount ZFS filesystems
# Description: Run the `zfs mount -a` or `zfs umount -a` command.
# This init script is deprecated and should be disabled in the
# /etc/default/zfs options file. Instead, use the zfs-mount
# package for Debian or the zfs-mountall package for Ubuntu
### END INIT INFO
PATH=/sbin:/bin
. /lib/lsb/init-functions
. /lib/init/vars.sh
[ -f /etc/default/zfs ] && . /etc/default/zfs
do_start()
{
log_begin_msg "Mounting ZFS filesystems"
log_progress_msg "filesystems"
zfs mount -a
RET=$?
if [ $RET != 0 ] ; then
log_end_msg $RET
exit $RET
fi
log_end_msg 0
}
do_stop()
{
log_begin_msg "Unmounting ZFS filesystems"
log_progress_msg "filesystems"
zfs unmount -a
RET=$?
# Ignore a non-zero `zfs` result so that a busy ZFS instance
# does not hang the system during shutdown.
if [ $RET != 0 ] ; then
log_end_msg $RET
fi
log_end_msg 0
}
case "$1" in
(start)
case "$ZFS_MOUNT" in
([Oo][Ff][Ff]|[Nn][Oo]|'')
exit 0
;;
esac
do_start
;;
(stop)
case "$ZFS_UNMOUNT" in
([Oo][Ff][Ff]|[Nn][Oo]|'')
exit 0
;;
esac
do_stop
;;
(force-reload|reload|restart|status)
# no-op
;;
(*)
[ -n "$1" ] && echo "Error: Unknown command $1."
echo "Usage: $0 {start|stop}"
exit 3
;;
esac

View File

@ -1,80 +0,0 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: shareiscsi sharenfs sharesmb zfs-share
# Required-Start: $local_fs $network $remote_fs
# Required-Stop: $local_fs $network $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Should-Start: iscsi iscsitarget istgt nfs-kernel-server samba
# Should-Stop: iscsi iscsitarget istgt nfs-kernel-server samba
# Short-Description: Network share OpenZFS datasets.
# Description: Run the `zfs share -a` or `zfs unmount -a` commands
# for controlling iSCSI, NFS, or CIFS network shares.
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
. /lib/lsb/init-functions
. /lib/init/vars.sh
[ -f /etc/default/zfs ] && . /etc/default/zfs
do_start()
{
log_begin_msg "Sharing OpenZFS filesystems"
log_progress_msg "filesystems"
zfs share -a
RET=$?
if [ $RET != 0 ] ; then
log_end_msg $RET
exit $RET
fi
log_end_msg 0
}
do_stop()
{
log_begin_msg "Unsharing OpenZFS filesystems"
log_progress_msg "filesystems"
zfs unshare -a
RET=$?
# Ignore a non-zero `zfs` result so that a busy OpenZFS instance
# does not hang the system during shutdown.
if [ $RET != 0 ] ; then
log_end_msg $RET
fi
log_end_msg 0
}
case "$1" in
(start)
case "$ZFS_SHARE" in
([Oo][Ff][Ff]|[Nn][Oo]|'')
exit 0
;;
esac
do_start
;;
(stop)
case "$ZFS_UNSHARE" in
([Oo][Ff][Ff]|[Nn][Oo]|'')
exit 0
;;
esac
do_stop
;;
(force-reload|reload|restart|status)
# no-op
;;
(*)
[ -n "$1" ] && echo "Error: Unknown command $1."
echo "Usage: $0 {start|stop}"
exit 3
;;
esac