View Single Post
  #1   (View Single Post)  
Old 15th October 2008
Xtender's Avatar
Xtender Xtender is offline
New User
 
Join Date: Jul 2008
Posts: 4
Question rc.d startup script problem

hello!

i've tried to create my own statup script, but it doesn't work at startup. it works when run from within /usr/local/etc/rc.d/ directory manually, but not at startup.

i was trying to follow this guide: http://www.freebsd.org/doc/en_US.ISO...ing/index.html

Here is the script:
Code:
80# cat /usr/local/etc/rc.d/test
#!/bin/sh
. /etc/rc.subr
name="test"
rcvar=`set_rcvar`
start_cmd="${name}_start"
stop_cmd=":"
test_start()
{
/usr/bin/touch /var/log/`date "+%H-%M-%S"`-test.log
}
load_rc_config $name
run_rc_command "$1"
I have added test_enable="YES" to /etc/rc.conf:
Code:
80# ./test rcvar
# test
test_enable=YES
It works when invoked manually (well, started at 23:40):
Code:
80# ./test start && ls /var/log/ | grep test
23-40-22-test.log
It just doesn't work upon startup What am i missing?

Thank you!
Reply With Quote