diff options
| author | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2007-04-06 02:27:02 +0000 |
|---|---|---|
| committer | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2007-04-06 02:27:02 +0000 |
| commit | 70cb12f264591067e5e348a0a34b451bf5c1b61b (patch) | |
| tree | 4ee993e86835d9121b6e14210c1db11b2324ba9d | |
| parent | ceef0c312c45e7c90d77464504d7d03f844353a1 (diff) | |
Notes
| -rw-r--r-- | etc/defaults/rc.conf | 3 | ||||
| -rwxr-xr-x | etc/rc.d/Makefile | 3 | ||||
| -rwxr-xr-x | etc/rc.d/mountd | 5 | ||||
| -rw-r--r-- | etc/rc.d/zfs | 33 | ||||
| -rw-r--r-- | share/man/man5/rc.conf.5 | 9 |
5 files changed, 51 insertions, 2 deletions
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf index 908d93e1d71a..fac7743be763 100644 --- a/etc/defaults/rc.conf +++ b/etc/defaults/rc.conf @@ -52,6 +52,9 @@ local_startup="/usr/local/etc/rc.d /usr/X11R6/etc/rc.d" # startup script dirs. script_name_sep=" " # Change if your startup scripts' names contain spaces rc_conf_files="/etc/rc.conf /etc/rc.conf.local" +# ZFS support +zfs_enable="NO" # Set to YES to automatically mount ZFS file systems + # Experimental - test before enabling gbde_autoattach_all="NO" # YES automatically mounts gbde devices from fstab gbde_devices="NO" # Devices to automatically attach (list, or AUTO) diff --git a/etc/rc.d/Makefile b/etc/rc.d/Makefile index aca2e20e1c32..ebc59a12b93c 100755 --- a/etc/rc.d/Makefile +++ b/etc/rc.d/Makefile @@ -40,7 +40,8 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKING SERVERS \ var virecover \ watchdogd wpa_supplicant \ ypbind yppasswdd ypserv \ - ypset ypupdated ypxfrd + ypset ypupdated ypxfrd \ + zfs .if ${MK_OPENSSH} != "no" FILES+= sshd diff --git a/etc/rc.d/mountd b/etc/rc.d/mountd index 438945126167..5edbb85c76b9 100755 --- a/etc/rc.d/mountd +++ b/etc/rc.d/mountd @@ -36,6 +36,11 @@ mountd_precmd() checkyesno weak_mountd_authentication && rc_flags="-n" fi fi + + if checkyesno zfs_enable ; then + rc_flags="${rc_flags} /etc/exports /etc/zfs/exports" + fi + rm -f /var/db/mountdtab ( umask 022 ; > /var/db/mountdtab ) return 0 diff --git a/etc/rc.d/zfs b/etc/rc.d/zfs new file mode 100644 index 000000000000..093f4c6c151a --- /dev/null +++ b/etc/rc.d/zfs @@ -0,0 +1,33 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: zfs +# REQUIRE: mountcritlocal +# KEYWORD: nojail shutdown + +. /etc/rc.subr + +name="zfs" +rcvar="zfs_enable" +start_cmd="zfs_start" +stop_cmd="zfs_stop" +required_modules="zfs" + +zfs_start() +{ + zfs mount -a + zfs volinit + zfs share -a +} + +zfs_stop() +{ + zfs unshare -a + zfs volfini + zfs unmount -a +} + +load_rc_config $name +run_rc_command "$1" diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index 459e34461694..3caf681c5a50 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 4, 2007 +.Dd April 6, 2007 .Dt RC.CONF 5 .Os .Sh NAME @@ -1276,6 +1276,13 @@ By default, the files specified are .Pa /etc/rc.conf and .Pa /etc/rc.conf.local +.It Va zfs_enable +.Pq Vt bool +If set to +.Dq Li YES , +.Pa /etc/rc.d/zfs +will attempt to automatically mount ZFS file systems and initialize ZFS volumes +(ZVOLs). .It Va gbde_autoattach_all .Pq Vt bool If set to |
