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

    Executing a Script before shutdown/rebooting

    Scheduled Pinned Locked Moved General pfSense Questions
    2 Posts 2 Posters 353 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.
    • F
      fraubergmaier
      last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • GrimsonG
        Grimson Banned
        last edited by

        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.

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