Executing a Script before shutdown/rebooting



  • Hello,

    is there a way to execute a script before shutdown/reboot or before the network driver are initialized?

    I am facing the following problem:
    PFsense/FreeBSD does not support the IntelX553 driver https://downloadcenter.intel.com/download/14688/Intel-Network-Adapters-Driver-for-PCIe-10-Gigabit-Network-Connections-Under-FreeBSD
    So I compiled the driver manually and copied it to /boot/kernel/if_ix.ko. After this pfsense recognizes the networkinterface.
    But after an upgrade the networkdrivers are overwritten and after a reboot, pfsense does not recognize the networkinterface.
    If pfsense does not recognize a networkinterface it automatically shutsdown.

    I have written a shell script, that replaces the networkdriver, if the md5sum is not matching. The script works fine, but it does get executed too late.

    What I have tried:

    • Inserted the Script /usr/local/etc/rc.d/*.sh  but pfsense shutsdown, before the script gets executed

    • Tried it with the earlyshellcmd  but pfsense shutsdown, before the script gets executed.

    • Tried it with a conjob @reboot /root/inteldriver.sh  but pfsense shutsdown, before it gets executed.

    • Changed flags to the networkdriver: chflags schg /boot/kernel/if_ix.ko but the driver gets overwritten somehow.

    • Modified the script to be useable with rc.d, but pfsense modified the startup mechanism and the script will not be executed.

    Is there a solution besides, buying a new server or not to update pfsense?


  • Banned

    Boot into single user mode and update the driver by hand, petition the FreeBSD developers to include the driver. Add another NIC to the device, so pfSense does find at least one network interface.


Log in to reply