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

    Shell scripts at /usr/local/etc/rc.d - when will they be executed?

    Scheduled Pinned Locked Moved Development
    2 Posts 2 Posters 63 Views 3 Watching
    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.
    • luckman212L Offline
      luckman212 LAYER 8
      last edited by luckman212

      This section of the pfSense Docs says:

      Any shell script can be placed in the /usr/local/etc/rc.d/ directory. The firewall will execute every shell script ending in .sh in this directory at boot time and also during certain system events (e.g. interface link changes, IP address changes, and gateway events).

      Is it documented somewhere exactly which system events these are, and what scripts will be triggered?

      GertjanG 1 Reply Last reply Reply Quote 0
      • GertjanG Offline
        Gertjan @luckman212
        last edited by Gertjan

        @luckman212

        I use a manually added FreeBSD package, 'munin' that came with a file to be placed in /usr/local/etc/rc.d/
        As per pfSense needs, I renamed it - added the .sh extension, and now the munin process get started at boot, and stopped at shutdown.
        I made this install many years ago, and as far as I know, the script only executes during boot and system shutdown.
        Not for network or other events etc.

        If FreeBSD would look like a Debian system (or clone) using init or systemd I could tell you way more, and I even think pfSEnse isn'tv really FreeBSD (no surprise, at it is, and it isn't ^^).
        Look at the kea script for an example, the first 3 / 4 lines.

        Afaik, pfSense it self, see here /etc/, all de rc...... files - for example rc.bootup - will all all these files.

        pfSense handle the hardware and software system events, and call whatever is needed, if system processes like 'unbound' needed to be restarted.

        So :

        and also during certain system events (e.g. interface link changes, IP address changes, and gateway events).

        never saw that happening with my own processes - as pfSense isn't really aware that these are running ones the system is up.

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

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