Hello, Everybody
Well, here is what I am doing:
ls -l /usr/local/etc/rc.d
total 30
-r-xr-xr-x 1 root wheel 4744 Nov 13 11:38 apache22
-r-xr-xr-x 1 root wheel 673 Nov 13 14:27 clamav-clamd
-r-xr-xr-x 1 root wheel 722 Nov 13 14:27 clamav-freshclam
-r-xr-xr-x 1 root wheel 1057 Nov 13 14:27 clamav-milter
-r-xr-xr-x 1 root wheel 1254 Nov 13 13:01 gnugk
-r-xr-xr-x 1 root wheel 198 Nov 15 01:17 l2tpd
-r-xr-xr-x 1 root wheel 196 Nov 14 12:35 popa3d
-r-xr-xr-x 1 root wheel 1642 Nov 13 11:19 quagga
-r-xr-xr-x 1 root wheel 4371 Nov 13 14:00 samba
-r-xr-xr-x 1 root wheel 1324 Nov 14 15:20 squid
-r-xr-xr-x 1 root wheel 564 Nov 13 11:19 watchquagga
cat /usr/local/etc/rc.d/l2tpd
#!/bin/sh
#PROVIDE l2tpd
#REQUIRE NETWORKING
. /etc/rc.subr
name="l2tpd"
rcvar=`set_rcvar`
command="/usr/local/sbin/${name}"
flags=""
echo "l2tp debug"
load_rc_config $name
run_rc_command "$1"
in rc.conf:
l2tpd_enable="YES"
Then after reboot:
ps ax | grep l2tpd
667 v1 RL+ 0:00.00 grep l2tpd
i.e no l2tpd has been started.
no messages on console, either. My script just got silently skipped.
What's wrong?
--
With best regards,
Gregory Edigarov
Gregory Edigarov wrote:> Hello, Everybody > > Well, here is what I am doing: > ls -l /usr/local/etc/rc.d > total 30 > -r-xr-xr-x 1 root wheel 4744 Nov 13 11:38 apache22 > -r-xr-xr-x 1 root wheel 673 Nov 13 14:27 clamav-clamd > -r-xr-xr-x 1 root wheel 722 Nov 13 14:27 clamav-freshclam > -r-xr-xr-x 1 root wheel 1057 Nov 13 14:27 clamav-milter > -r-xr-xr-x 1 root wheel 1254 Nov 13 13:01 gnugk > -r-xr-xr-x 1 root wheel 198 Nov 15 01:17 l2tpd > -r-xr-xr-x 1 root wheel 196 Nov 14 12:35 popa3d > -r-xr-xr-x 1 root wheel 1642 Nov 13 11:19 quagga > -r-xr-xr-x 1 root wheel 4371 Nov 13 14:00 samba > -r-xr-xr-x 1 root wheel 1324 Nov 14 15:20 squid > -r-xr-xr-x 1 root wheel 564 Nov 13 11:19 watchquagga > > cat /usr/local/etc/rc.d/l2tpd > #!/bin/sh > > #PROVIDE l2tpd > #REQUIRE NETWORKING > > . /etc/rc.subr > > name="l2tpd" > rcvar=`set_rcvar` > command="/usr/local/sbin/${name}" > flags="" > echo "l2tp debug" > > load_rc_config $name > run_rc_command "$1" > > in rc.conf: > l2tpd_enable="YES" > > Then after reboot: > ps ax | grep l2tpd > 667 v1 RL+ 0:00.00 grep l2tpd > > i.e no l2tpd has been started. > no messages on console, either. My script just got silently skipped. > > What's wrong?It looks like the formatting of the PROVIDE and REQUIRE statements may be incorrect. Try: # PROVIDE: l2tpd # REQUIRE: NETWORKING (note a single space between the hash mark and PROVIDE/REQUIRE, and the colon and a single space after PROVIDE/REQUIRE) -Proto
Gregory Edigarov wrote:
> [...]
> #PROVIDE l2tpd
Be sure to get the synatx right. It must look like this:
# PROVIDE: l2tpd
The "PROVIDE" line is used to distinguish old-style scripts
from rcNG scripts. Therefore it is important that you get
the syntax of that line right, or otherwise the script will
not be recognized correctly.
That's what happened in your case: The "PROVIDE" line was
not recognized, so it was assumed to be an old-style script.
Those scripts are only executed if they are executable _and_
have a filename extension ".sh". Your script doesn't have
that extension, so it was ignored.
> #REQUIRE NETWORKING
That line needs also to be fixed (space, colon).
Best regards
Oliver
--
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.
"If you think C++ is not overly complicated, just what is a protected
abstract virtual base pure virtual private destructor, and when was the
last time you needed one?"
-- Tom Cargil, C++ Journal