Nanobsd and custom services?
-
I installed the ipguard-dev package on a pfsense box (nanobsd) and I can't make it launch at boot.
The package installs an rc.d script but "nanosense" removes /etc/rc.conf on every boot. So I tried using /etc/rc.conf.local but that would not start the service either.edit:
- pfSense 2.0.3 on ALIX
- "service ipguard start/stop/restart/status" works as one would expect.
- There is a message at the very end of the bootprocess, saying that IPguard (among other packages) is being started. But when I login there is no ipguard process running.
- Starting the service from the webGUI would not start the service.
- The webGUI correctly lists the service as not running.
- The webGUI correctly lists the service as running, if the service was started via "service ipguard start".
How does service management work in pfSense (especially in the nanobsd version)?
ThankYou -
These files would usually be in /usr/local/etc/rc.d have you looked there?
Steve
-
There is one file in that directory: ipguard
#! /bin/sh # PROVIDE: ipguard # REQUIRE: DAEMON # KEYWORD: shutdown # Add the following lines to /etc/rc.conf to enable ipguard: # # ipguard_enable="YES" # ipguard_interface="iface" # ipguard_flags="-u 300 -xz" . /etc/rc.subr name=ipguard rcvar=ipguard_enable start_precmd=ipguard_precmd command=/usr/local/sbin/${name} ipguard_enable=${ipguard_enable:-"NO"} ipguard_interface=${ipguard_interface:-"fxp0"} ipguard_flags=${ipguard_flags:-"-u 300 -xz"} ipguard_precmd() { command_args="$command_args ${ipguard_interface}" pidfile="/var/run/${name}_${ipguard_interface}.pid" } load_rc_config ${name} run_rc_command "$1"
And the ipguard_enable="YES" … are written into /etc/rc.conf.local. Works like a charm from the console but pfSense doesn't seem to call this at boot. Somewhere in this forum someone said that scripts in rc.d have to end in .sh for nanobsd to call them. I haven't tried to just rename the above script yet, as this system can't be rebooted all the time to just try things (it's being used). I'd like to be sure about what I am doing before making any further changes. :)
-
Sorry I didn't realise this was an existing pfSense package. Probably better to ask about this in the relevant thread.
However, is this something that has just started happening? Since 2.0.3 perhaps?
There have been issues with starting packages at boot. Packages are restarted several times at boot and it can be time critical. Check your system log to see if it is being started and how many times.
Steve
-
The package version is the same but I remember that I got a ipguard.sh in rc.d when I installed the package in pfSense 2.0.2.
I monitored the boot process. pfSense somehow has IPguard registred as a service (I know, as It tells me that it is going to start ipguard) but it fails to do so (most likely because it's missing some ipguard startup script). I'd rather like to understand how pfsense handles services in general, since it differs from freebsd's way (at least in the nanobsd version). That's why I posted here :)