|
FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
||||
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" Code:
80# ./test rcvar # test test_enable=YES Code:
80# ./test start && ls /var/log/ | grep test 23-40-22-test.log Thank you! |
|
||||
Try using the full path of 'date': /bin/date
You should also add rcorder(8) keywords. It should at least be: Code:
#!/bin/sh # PROVIDE: test # REQUIRE: DAEMON . /etc/rc.subr name="test" rcvar=`set_rcvar` load_rc_config ${name} : ${test_enable="NO"} start_cmd="${name}_start" stop_cmd=":" test_start() { /usr/bin/touch /var/log/`/bin/date "+%H-%M-%S"`-test.log } run_rc_command "$1" Last edited by BSDKaffee; 15th October 2008 at 11:52 PM. |
|
||||
Scripts ending in .sh are considered "old-style" scripts, and are run in alphabetical order after all "new-style" scripts.
Scripts without .sh are treated as "new-style" scripts, and are parsed by rcorder(8) before being executed. rcorder requires some header comments to determine what the script depends on and when it can be run. You can view how rcorder sees things by running: # rcorder /etc/rc.d/* /usr/local/etc/rc.d/* If you don't see your script listed there, then rcorder doesn't know about it. You're missing all the rcorder headers. |
|
|||
Just out of curiosity, what are the permissions on your rc script?
|
|
|||
hmm, okay, my theory of not being executable just went out the window.
|
|
|||
Now, now, you can't expect me to take into consideration every little pixel on the screen, can you?
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
firefox startup very slow. | bsdnewbie999 | OpenBSD General | 5 | 6th May 2009 05:30 AM |
dhclient at startup | bsdnewbie999 | OpenBSD General | 3 | 31st March 2009 03:55 AM |
Tightvnc startup script not loading fonts - permission denied | master-richie | FreeBSD Ports and Packages | 2 | 3rd August 2008 09:29 PM |
Beep on startup? | matt | Programming | 1 | 16th July 2008 08:33 AM |
Problem: periodic script 800.loginfail | anomie | FreeBSD Security | 1 | 5th May 2008 08:57 PM |