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

    PhpService upgrade issue

    pfSense Packages
    3
    9
    2.3k
    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.
    • rcfaR
      rcfa
      last edited by

      I have two nearly identically configured units, both underwent a recent package upgrade marathon.
      After that, system one was fine. System two has the following crash:

      Crash report begins.  Anonymous machine information:
      
      amd64
      10.1-RELEASE-p24
      FreeBSD 10.1-RELEASE-p24 #0 f27a67c(releng/10.1)-dirty: Wed Nov  4 16:18:37 CST 2015     root@pfs22-amd64-builder:/usr/obj.RELENG_2_2.amd64/usr/pfSensesrc/src.RELENG_2_2/sys/pfSense_SMP.10
      
      Crash report details:
      
      PHP Errors:
      [28-Nov-2015 15:36:41 Etc/UTC] PHP Fatal error:  Call to undefined function phpservice_custom_php_service_status_command() in /etc/inc/service-utils.inc(207) : eval()'d code on line 1
      [28-Nov-2015 15:37:19 Etc/UTC] PHP Parse error:  syntax error, unexpected '=' in /usr/local/pkg/phpservice.php on line 7
      [28-Nov-2015 15:37:36 Etc/UTC] PHP Fatal error:  Call to undefined function phpservice_custom_php_service_status_command() in /etc/inc/service-utils.inc(207) : eval()'d code on line 1
      
      

      Further, in the dashboard service status section, I get between title and the list of services, this here:

      Fatal error: Call to undefined function phpservice_custom_php_service_status_command() in /etc/inc/service-utils.inc(207) : eval()'d code on line 1
      

      Normally, removing and reinstalling the package tends to fix issues like these. However, in this case, I can remove and re-add the phpService package as often as I want, I always get the same.
      If I remove the package, I have no crash, and the dashboard looks proper, without error messages. The moment I reinstall the phpService package, I'm back to square one.

      The phpService package isn't critical to what I do, so I can temporarily deinstall it, but obviously this seems to indicate that something else is corrupted, given that the phpService package installs just fine on the other system, and given that whatever is corrupted persists a deinstall-reinstall cycle.

      Does anyone have any idea what's going on here and how to fix it?

      Thanks!

      1 Reply Last reply Reply Quote 0
      • D
        doktornotor Banned
        last edited by

        The function is defined just fine in https://github.com/pfsense/pfsense-packages/blob/master/config/phpservice/phpservice.inc#L122. If you edit /usr/local/pkg/phpservice.xml and replace

        
        		 <custom_php_service_status_command>phpservice_custom_php_service_status_command();</custom_php_service_status_command> 
        
        

        with

        
        		 <custom_php_service_status_command>phpservice_custom_php_service_status_command</custom_php_service_status_command> 
        
        

        it might even work, no idea, noone documents this XML shit.

        1 Reply Last reply Reply Quote 0
        • rcfaR
          rcfa
          last edited by

          Hm, I'm going to try it, BUT: on the other system, things work just fine, and there the file is unmodified…
          ...so I wonder if something else is corrupted, i.e. whatever invokes this file.

          I even invoked a "reinstall all packages" on the system with the issues: no change.

          1 Reply Last reply Reply Quote 0
          • rcfaR
            rcfa
            last edited by

            To be precise: both systems have all the same packages installed, with one difference: one has snort (the one that's broken) and one as suricata.
            I don't see however, why the difference between snort and suricata should affect the phpService package installation, particularly since all I did was update packages, not alter the configuration or something.

            headscratch…

            1 Reply Last reply Reply Quote 0
            • rcfaR
              rcfa
              last edited by

              So, it gets stranger and stranger: on the seemingly OK system I started suricata: BOOM, I get the same crash and error message:

              Crash report begins.  Anonymous machine information:
              
              amd64
              10.1-RELEASE-p24
              FreeBSD 10.1-RELEASE-p24 #0 f27a67c(releng/10.1)-dirty: Wed Nov  4 16:18:37 CST 2015     root@pfs22-amd64-builder:/usr/obj.RELENG_2_2.amd64/usr/pfSensesrc/src.RELENG_2_2/sys/pfSense_SMP.10
              
              Crash report details:
              
              PHP Errors:
              [28-Nov-2015 18:59:43 Etc/UTC] PHP Fatal error:  Call to undefined function phpservice_custom_php_service_status_command() in /etc/inc/service-utils.inc(207) : eval()'d code on line 1
              
              

              Only difference: it doesn't seem to affect the dashboard display there.

              So, all I can conclude is that phpService is busted since the latest version update, so I'll just remove it on both systems until I hear it's fixed or I have spare time to play around with it.

              1 Reply Last reply Reply Quote 0
              • D
                doktornotor Banned
                last edited by

                Look. alll I can advise you is to edit the file as noted above which takes about 30 seconds.

                1 Reply Last reply Reply Quote 0
                • rcfaR
                  rcfa
                  last edited by

                  I had done that: no effect.
                  Or do I need to reboot the box after?

                  1 Reply Last reply Reply Quote 0
                  • D
                    doktornotor Banned
                    last edited by

                    No. Rebooting is useless. You could file a bug asking about how the fuck is that <custom_php_service_status_command>tag actually supposed to be used, however considering this package will go to /dev/null with pfSense 2.3, it'd be pretty much a waste of time.

                    (Now that you mention it, you'd probably need to do the same edit in config.xml, otherwise changing the XML won't have any effect, that crap is actually only parsed on install. (Another wonderful thing about these…)</custom_php_service_status_command>

                    1 Reply Last reply Reply Quote 0
                    • O
                      obiwan2k
                      last edited by

                      the bug is in /usr/local/pkg/phpservice.inc

                      the parts between
                      tmp= <<< EOF and EOF

                      strings like $filename etc. should be escaped with \ or put all the EOF stuff in a normal string.

                      in attachment is a working phpservice.inc

                      hf :)

                      phpservice.inc.zip

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