| Server IP : 82.208.35.60 / Your IP : 216.73.216.238 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/db/etcupdate/current/etc/rc.d/ |
Upload File : |
#!/bin/sh
# PROVIDE: var_run
# REQUIRE: mountcritlocal
# BEFORE: cleanvar
# KEYWORD: shutdown
. /etc/rc.subr
name=var_run
rcvar=var_run_enable
extra_commands="load save"
start_cmd="_var_run_start"
load_cmd="_var_run_load"
save_cmd="_var_run_save"
stop_cmd="_var_run_stop"
load_rc_config $name
# Set defaults
: ${var_run_enable:="NO"}
: ${var_run_mtree:="/var/db/mtree/BSD.var-run.mtree"}
: ${var_run_autosave:="YES"}
_var_run_load() {
test -f ${var_run_mtree} &&
mtree -U -i -q -f ${var_run_mtree} -p /var/run > /dev/null
}
_var_run_save() {
if [ ! -d $(dirname ${var_run_mtree}) ]; then
mkdir -p ${var_run_mtree}
fi
mtree -dcbj -p /var/run > ${var_run_mtree}
}
_var_run_start() {
df -ttmpfs /var/run > /dev/null 2>&1 &&
_var_run_load
}
_var_run_stop() {
df -ttmpfs /var/run > /dev/null 2>&1 &&
checkyesno var_run_autosave &&
_var_run_save
}
run_rc_command "$1"