Index: etc/rc.d/hostid =================================================================== --- etc/rc.d/hostid (wersja 195455) +++ etc/rc.d/hostid (kopia robocza) @@ -28,8 +28,7 @@ # # PROVIDE: hostid -# REQUIRE: root -# BEFORE: mountcritlocal +# BEFORE: fsck # KEYWORD: nojail . /etc/rc.subr @@ -68,7 +67,7 @@ esac } -hostid_reset() +hostid_generate() { # First look for UUID in hardware. uuid=`hostid_hardware` @@ -76,12 +75,17 @@ # If not found, fall back to software-generated UUID. uuid=`uuidgen` fi + hostid_set $uuid +} + +hostid_reset() +{ + hostid_generate # Store newly generated UUID in ${hostid_file}. echo $uuid > ${hostid_file} if [ $? -ne 0 ]; then warn "could not store hostuuid in ${hostid_file}." fi - hostid_set $uuid } hostid_start() @@ -91,7 +95,7 @@ hostid_set `cat ${hostid_file}` else # No hostid file, generate UUID. - hostid_reset + hostid_generate fi } Index: etc/rc.d/zfs =================================================================== --- etc/rc.d/zfs (wersja 195455) +++ etc/rc.d/zfs (kopia robocza) @@ -23,21 +23,11 @@ zfs_start_main() { - zfs volinit zfs mount -a zfs share -a if [ ! -r /etc/zfs/exports ]; then touch /etc/zfs/exports fi - # Enable swap on ZVOLs with property org.freebsd:swap=on. - zfs list -H -o org.freebsd:swap,name -t volume | \ - while read state name; do - case "${state}" in - [oO][nN]) - swapon /dev/zvol/${name} - ;; - esac - done } zfs_start() @@ -58,18 +48,8 @@ zfs_stop_main() { - # Disable swap on ZVOLs with property org.freebsd:swap=on. - zfs list -H -o org.freebsd:swap,name -t volume | \ - while read state name; do - case "${state}" in - [oO][nN]) - swapoff /dev/zvol/${name} - ;; - esac - done zfs unshare -a zfs unmount -a - zfs volfini } zfs_stop() Index: etc/rc.d/Makefile =================================================================== --- etc/rc.d/Makefile (wersja 195455) +++ etc/rc.d/Makefile (kopia robocza) @@ -13,7 +13,7 @@ fsck ftp-proxy ftpd \ gbde geli geli2 gssd \ hcsecd \ - hostapd hostid hostname \ + hostapd hostid hostid_save hostname \ inetd initrandom \ ip6addrctl ip6fw ipfilter ipfs ipfw ipmon \ ipnat ipsec ipxrouted \ @@ -40,7 +40,7 @@ watchdogd wpa_supplicant \ ypbind yppasswdd ypserv \ ypset ypupdated ypxfrd \ - zfs + zfs zvol .if ${MK_OPENSSH} != "no" FILES+= sshd Index: etc/rc.d/hostid_save =================================================================== --- etc/rc.d/hostid_save (wersja 0) +++ etc/rc.d/hostid_save (wersja 0) @@ -0,0 +1,29 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: hostid_save +# REQUIRE: root +# BEFORE: mountcritlocal +# KEYWORD: nojail + +. /etc/rc.subr + +name="hostid_save" +start_cmd="hostid_save" +stop_cmd=":" +rcvar="hostid_enable" + +hostid_save() +{ + if [ ! -r ${hostid_file} ]; then + $SYSCTL_N kern.hostuuid > ${hostid_file} + if [ $? -ne 0 ]; then + warn "could not store hostuuid in ${hostid_file}." + fi + fi +} + +load_rc_config $name +run_rc_command "$1" Zmiany atrybutów dla: etc/rc.d/hostid_save ___________________________________________________________________ Dodane: svn:executable + * Index: etc/rc.d/zvol =================================================================== --- etc/rc.d/zvol (wersja 0) +++ etc/rc.d/zvol (wersja 0) @@ -0,0 +1,48 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: zvol +# REQUIRE: hostid +# BEFORE: fsck +# KEYWORD: nojail + +. /etc/rc.subr + +name="zvol" +rcvar="zfs_enable" +start_cmd="zvol_start" +stop_cmd="zvol_stop" +required_modules="zfs" + +zvol_start() +{ + zfs volinit + # Enable swap on ZVOLs with property org.freebsd:swap=on. + zfs list -H -o org.freebsd:swap,name -t volume | \ + while read state name; do + case "${state}" in + [oO][nN]) + swapon /dev/zvol/${name} + ;; + esac + done +} + +zvol_stop() +{ + # Disable swap on ZVOLs with property org.freebsd:swap=on. + zfs list -H -o org.freebsd:swap,name -t volume | \ + while read state name; do + case "${state}" in + [oO][nN]) + swapoff /dev/zvol/${name} + ;; + esac + done + zfs volfini +} + +load_rc_config $name +run_rc_command "$1" Zmiany atrybutów dla: etc/rc.d/zvol ___________________________________________________________________ Dodane: svn:executable + *