From 2ea2a520a34705b5e02430657c88f05a8189e5e6 Mon Sep 17 00:00:00 2001 From: Xin Li Date: Fri, 16 Dec 2011 13:30:53 -0800 Subject: [PATCH 16/65] Allow an user defined mtree to be used to initialize /tmp. Saner ordering of startup scripts. --- etc/rc.d/cleartmp | 3 +++ etc/rc.d/newsyslog | 2 +- etc/rc.d/sshd | 3 ++- etc/rc.d/syslogd | 4 ++-- etc/rc.d/tmp | 2 +- etc/rc.d/watchdogd | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/etc/rc.d/cleartmp b/etc/rc.d/cleartmp index 0d84987..07b32e9 100755 --- a/etc/rc.d/cleartmp +++ b/etc/rc.d/cleartmp @@ -54,6 +54,9 @@ cleartmp_start() # Create X related directories with proper permissions. mkdir -m 1777 ${x11_socket_dirs} fi + if [ -n "${cleartmp_mtree}" ]; then + /usr/sbin/mtree -deU -f ${cleartmp_mtree} -p /tmp > /dev/null + fi } load_rc_config $name diff --git a/etc/rc.d/newsyslog b/etc/rc.d/newsyslog index ab8f2d3..dc86f7a 100755 --- a/etc/rc.d/newsyslog +++ b/etc/rc.d/newsyslog @@ -4,7 +4,7 @@ # # PROVIDE: newsyslog -# REQUIRE: cleanvar mountcritremote +# REQUIRE: cleanvar cleartmp . /etc/rc.subr diff --git a/etc/rc.d/sshd b/etc/rc.d/sshd index 9f00199..b5a12e0 100755 --- a/etc/rc.d/sshd +++ b/etc/rc.d/sshd @@ -4,7 +4,8 @@ # # PROVIDE: sshd -# REQUIRE: LOGIN cleanvar +# REQUIRE: NETWORKING cleanvar ldconfig +# BEFORE: SERVERS # KEYWORD: shutdown . /etc/rc.subr diff --git a/etc/rc.d/syslogd b/etc/rc.d/syslogd index 5dcd3e9..0df8ed3 100755 --- a/etc/rc.d/syslogd +++ b/etc/rc.d/syslogd @@ -4,8 +4,8 @@ # # PROVIDE: syslogd -# REQUIRE: mountcritremote cleanvar newsyslog -# BEFORE: SERVERS +# REQUIRE: newsyslog hostname watchdogd +# BEFORE: netif . /etc/rc.subr diff --git a/etc/rc.d/tmp b/etc/rc.d/tmp index dfb439e..60a2c9d 100755 --- a/etc/rc.d/tmp +++ b/etc/rc.d/tmp @@ -28,7 +28,7 @@ # # PROVIDE: tmp -# REQUIRE: mountcritremote +# REQUIRE: zfs . /etc/rc.subr diff --git a/etc/rc.d/watchdogd b/etc/rc.d/watchdogd index e852126..8caab5c 100755 --- a/etc/rc.d/watchdogd +++ b/etc/rc.d/watchdogd @@ -28,7 +28,7 @@ # # PROVIDE: watchdogd -# REQUIRE: DAEMON cleanvar +# REQUIRE: cleanvar # KEYWORD: nojail shutdown . /etc/rc.subr -- 1.7.8.3