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

    Reboot question

    Scheduled Pinned Locked Moved General pfSense Questions
    5 Posts 2 Posters 783 Views 2 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.
    • C Offline
      Cobrax2
      last edited by

      hi guys
      i want to make a script that reboots at some event the box
      looking over the net i've seen people using rc.stop_pckg command before the actual reboot command
      is it necessary? in the log i saw that it does stop the processes but the system has time to restart some of them before the actual shutdown. doesn't this cause some issues?
      thank you

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

        Take a look at /etc/rc.initial.reboot

        C 1 Reply Last reply Reply Quote 0
        • C Offline
          Cobrax2 @stephenw10
          last edited by

          @stephenw10
          thanks
          so i should use system_reboot_sync(), right?

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

            Yes or just system_reboot(), both are in system.inc so include that.

            Or just replicate the parts of system_reboot_cleanup() you might need. Which is basically just stop packages unless you are running captive portal. Then just use /etc/rc.reboot.

            Steve

            C 1 Reply Last reply Reply Quote 0
            • C Offline
              Cobrax2 @stephenw10
              last edited by

              @stephenw10 thank you again!

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