Navigation

    Netgate Discussion Forum
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    Nanobsd and custom services?

    General pfSense Questions
    2
    5
    1069
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      senser last edited by

      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

      1 Reply Last reply Reply Quote 0
      • stephenw10
        stephenw10 Netgate Administrator last edited by

        These files would usually be in /usr/local/etc/rc.d have you looked there?

        Steve

        1 Reply Last reply Reply Quote 0
        • S
          senser last edited by

          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. :)

          1 Reply Last reply Reply Quote 0
          • stephenw10
            stephenw10 Netgate Administrator last edited by

            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

            1 Reply Last reply Reply Quote 0
            • S
              senser last edited by

              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 :)

              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              Products

              • Platform Overview
              • TNSR
              • pfSense
              • Appliances

              Services

              • Training
              • Professional Services

              Support

              • Subscription Plans
              • Contact Support
              • Product Lifecycle
              • Documentation

              News

              • Media Coverage
              • Press
              • Events

              Resources

              • Blog
              • FAQ
              • Find a Partner
              • Resource Library
              • Security Information

              Company

              • About Us
              • Careers
              • Partners
              • Contact Us
              • Legal
              Our Mission

              We provide leading-edge network security at a fair price - regardless of organizational size or network sophistication. We believe that an open-source security model offers disruptive pricing along with the agility required to quickly address emerging threats.

              Subscribe to our Newsletter

              Product information, software announcements, and special offers. See our newsletter archive to sign up for future newsletters and to read past announcements.

              © 2021 Rubicon Communications, LLC | Privacy Policy