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

Run shell command at pfsense reboot

Scheduled Pinned Locked Moved General pfSense Questions
13 Posts 7 Posters 5.9k 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.
  • M
    mariusblk
    last edited by Jan 14, 2015, 8:40 PM

    Hello guys, i've set up a server at my office to run pfsense 2.1.5, installed completed with no problems, up and running.

    Next i added some packages (unzip, wget, mongodb, openjdk7), installed Unifi Controlled for Unix for my Unifi AP's

    The Unifi Controller interface can start only by going to Shell Command and executing the following: /usr/local/openjdk7/bin/java -jar /usr/local/UniFi/lib/ace.jar start & thow the wireless AP's are working with no problem.

    I want to add the line /usr/local/openjdk7/bin/java -jar /usr/local/UniFi/lib/ace.jar start & at pfSense boot, every time system restarts it must load the Unifi Controller Interface.

    I tried adding at /usr/local/etc/rc.d a start_unifi.sh with code:

    /usr/local/openjdk7/bin/java -jar /usr/local/UniFi/lib/ace.jar start &
    

    After system reboot at the end it says: start_unifi.sh is loaded ok … done but my Unifi Controller Interface doesn't start. If i go to Shell Command and enter /usr/local/openjdk7/bin/java -jar /usr/local/UniFi/lib/ace.jar start & after a couple of minutes Controller is up

    What can i do, or what have i done wrong? I need to start the service on system boot.

    1 Reply Last reply Reply Quote 0
    • P
      ptt Rebel Alliance
      last edited by Jan 14, 2015, 9:04 PM Jan 14, 2015, 9:00 PM

      Have you tried with the "shellcmd option" option ?

      https://doc.pfsense.org/index.php/Executing_commands_at_boot_time

      1 Reply Last reply Reply Quote 0
      • D
        doktornotor Banned
        last edited by Jan 14, 2015, 9:13 PM

        @mariusblk:

        what have i done wrong?

        You installed Java on your firewall…  :'( :(

        1 Reply Last reply Reply Quote 0
        • C
          Cino
          last edited by Jan 14, 2015, 9:25 PM

          @doktornotor:

          @mariusblk:

          what have i done wrong?

          You installed Java on your firewall…  :'( :(

          LOL

          I was going to do that at one point but decided to have it run on my windows server that is up 24/7 instead

          1 Reply Last reply Reply Quote 0
          • M
            mariusblk
            last edited by Jan 14, 2015, 9:25 PM

            @ptt:

            Have you tried with the "shellcmd option" option ?

            https://doc.pfsense.org/index.php/Executing_commands_at_boot_time

            I'm not sure if i insert the <shellcmd>in the right spot … i'll try to run it</shellcmd>

            1 Reply Last reply Reply Quote 0
            • M
              mariusblk
              last edited by Jan 14, 2015, 9:29 PM

              @Cino:

              @doktornotor:

              @mariusblk:

              what have i done wrong?

              You installed Java on your firewall…  :'( :(

              LOL

              I was going to do that at one point but decided to have it run on my windows server that is up 24/7 instead

              And why is it such a bad idea, point me to something.

              1 Reply Last reply Reply Quote 0
              • D
                doktornotor Banned
                last edited by Jan 14, 2015, 9:30 PM

                @mariusblk:

                I'm not sure if i insert the <shellcmd>in the right spot … i'll try to run it</shellcmd>

                There's this Shellcmd package to solve that for you via GUI. :D

                @mariusblk:

                And why is it such a bad idea, point me to something.

                1 Reply Last reply Reply Quote 0
                • K
                  kejianshi
                  last edited by Jan 14, 2015, 9:33 PM

                  Java on my server has been flawless.

                  Java on my personal computer nags me more than a clingy GF.

                  1 Reply Last reply Reply Quote 0
                  • C
                    Cino
                    last edited by Jan 14, 2015, 9:35 PM

                    There is a shellcmd package that you can install which will insert them into the config.xml correctly.

                    Its just not good practice to run anything on a fw. But it's your fw, so you can install anything you want.. but if it conflicts with the pfsense core system, you may be able to get support from pfsense or the forum.

                    Java itself is always being updated due to security issues… I won't recommend it but play it safe... stay update with updates, and make sure its not binding to your WAN or any interface you dont want it on

                    1 Reply Last reply Reply Quote 0
                    • M
                      mariusblk
                      last edited by Jan 15, 2015, 2:06 PM

                      I installed the package with shellcommand added the line but doesn't work, on pfSense startup

                      "Starting NTP time client …. done
                      Starting DHCP Service .... done
                      "
                      and freezes. I can access webConfigurator with no problem, links are up, internet is working, java process is starting and Unifi Controller is up and running.

                      I can access server using putty and there is no problem, any hints why the visuals on pfsense server halt at that point?

                      1 Reply Last reply Reply Quote 0
                      • A
                        alfredo
                        last edited by Oct 13, 2016, 1:50 PM

                        Am having the same problem with Java/Shellcmd. The booting gets stuck at "Configuring Firewall"

                        Any Ideas?

                        Thanks

                        Alfredo.

                        1 Reply Last reply Reply Quote 0
                        • S
                          Stugots
                          last edited by Oct 13, 2016, 1:59 PM

                          I wouldn't recommend running that software on your firewall.  I run UniFi on a Raspberry Pi at home.

                          PC Engines APU2C4

                          1 Reply Last reply Reply Quote 0
                          • A
                            alfredo
                            last edited by Oct 13, 2016, 3:55 PM

                            Thanks; we're not running Unify; we're using java for a very secure internal program. pfSense can't finish booting

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post
                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                              This community forum collects and processes your personal information.
                              consent.not_received