/etc/rc
-
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
-
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
-
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
-
So that didn't work I assume?
-
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?
-
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