Hello,
I'm trying to install a rc.d script to run at startup and shutdown, but it only run at startup.
Reducing the script to a skeleton test, I have the following:
And in rc.conf:
Logger only register "test-start" and in /var/tmp there are only one file test-start.
What is wrong?
I'm trying to install a rc.d script to run at startup and shutdown, but it only run at startup.
Reducing the script to a skeleton test, I have the following:
Code:
#!/bin/sh -
# PROVIDE: test
# REQUIRE: FILESYSTEMS
# KEYWORD: nojail shutdown
. /etc/rc.subr
name="test"
rcvar="test_enable"
stop_cmd="test_stop"
start_cmd="test_start"
test_start()
{
logger test-start
touch /var/tmp/test-start
}
test_stop()
{
logger test-stop
touch /var/tmp/test-stop
}
load_rc_config $name
run_rc_command "$1"
And in rc.conf:
Code:
test_enable="YES"
Logger only register "test-start" and in /var/tmp there are only one file test-start.
What is wrong?