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

    /etc/rc

    Scheduled Pinned Locked Moved General pfSense Questions
    6 Posts 2 Posters 964 Views
    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.
    • ghostshellG
      ghostshell
      last edited by

      I have a command to auto start the LCD upon reboot/bootup in etc/rc. Below is the command and when I just rebooted pfsense it did nothing, when I went into the shell and ran the same command minus the ending it worked just fine.

      Command: /etc/customlcd.sh start 2>&1 >/dev/null &

      When i stop and start it via shell i run just /etc/customlcd.sh start/stop

      I have an upgrade available and once I do that I will try out the shellcmd package, but wonder why the rc is not working when i have used that method for a long time

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

        You should use /usr/local/etc/rc.d for custom startup scripts. pfSense doesn't use the usual FreeBSD locations for that.

        https://docs.netgate.com/pfsense/en/latest/development/executing-commands-at-boot-time.html#shell-script-option

        Steve

        1 Reply Last reply Reply Quote 0
        • ghostshellG
          ghostshell
          last edited by

          Thanks, I added a script to rc.d after the reboot before posting just in case that was it after going a quick google search at that documentation came up

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

            So that didn't work I assume?

            ghostshellG 1 Reply Last reply Reply Quote 0
            • ghostshellG
              ghostshell @stephenw10
              last edited by

              @stephenw10

              Have not rebooted since, need to do a pf update and I am guessing that will wipe out the sh script i added? Also out of the 2 options, did install shellcmd, would it be a better practice to use shellcmd or stick with adding a quick simple sh script to /usr/local/etc/rc.d?

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

                If you use a shellcmd that gets stored in the config file and hence can be retsored and is never lost at an update etc.
                If that command calls a custom script that might be lost though. You can use the filer package to store that in the config so it's all restored however.

                Steve

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.