wabash icon indicating copy to clipboard operation
wabash copied to clipboard

Unable to start php7.0-fpm service, wabash crashes.

Open valeryan opened this issue 7 years ago • 9 comments

I am trying to use wabash to setup my WSL instance for web development. I was able to startup nginx and mysql without problem but I get an error when I try to add php to the config.

I get an error dialog that states Error, unknown message, or garbled channel: serror php7.0-fpm.

This is my config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <section name="ArkaneSystems.Wabash.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    </sectionGroup>
  </configSections>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
  </startup>
  <applicationSettings>
    <ArkaneSystems.Wabash.Properties.Settings>
      <setting name="Services" serializeAs="Xml">
        <value>
          <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <string>rsyslog</string>
            <string>binfmt-support</string>
            <string>dbus</string>
            <string>cron</string>
            <string>atd</string>
            <string>mysql</string>
            <string>nginx</string>
            <string>php7.0-fpm</string>
          </ArrayOfString>
        </value>
      </setting>
    </ArkaneSystems.Wabash.Properties.Settings>
  </applicationSettings>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <!-- BEGIN: Added by PostSharp -->
      <dependentAssembly xmlns="urn:schemas-microsoft-com:asm.v1">
        <assemblyIdentity name="PostSharp" publicKeyToken="b13fd38b8f9c99d7" culture="neutral" />
        <bindingRedirect oldVersion="3.0.0.0-4.3.21.0" newVersion="4.3.21.0" />
      </dependentAssembly>
      <!-- END: Added by PostSharp -->
    </assemblyBinding>
  </runtime>
</configuration>

valeryan avatar Mar 06 '17 18:03 valeryan

Same here. I noticed that the same error comes up for a service that doesn't exist (php7.0-fpm does exist, and works when started in the terminal).

unleashit avatar Apr 12 '17 05:04 unleashit

Just a note: I am going to look into this, but I may not be able to get to it particularly soon as I've been up against some pretty tight deadlines this last month and it doesn't look like they're going away soon. Sorry, folks.

In the meantime... pull requests gratefully accepted? :)

cerebrate avatar Apr 12 '17 15:04 cerebrate

I would take a stab at it but I was not able to get all the postsharp stuff to work. Its not something I use. However, I would guess the issue is in the DaemonManager.cs. When the php service starts it only has output if start up fails. Most services will exit and output something like [OK] but php just starts silently. In your switch statement if you can't find a valid message after startup you default to unknown and Die. I would consider creating a configurable list of services that do not exit have and use alternate behavior where you accept a non exit, no output as success and any thing else as a failure.

I would try to test this idea out but I can't build the project because of the postsharp stuff.

valeryan avatar Apr 12 '17 15:04 valeryan

I think this is relevant to this issue. http://askubuntu.com/questions/792940/no-output-from-service-start-stop-restart-command

It states that the no output is/should be the normal operation of most services.

valeryan avatar Apr 12 '17 16:04 valeryan

Unfortunately, I'm also pretty useless on the pull request front as I'm mainly a Javascript guy. But I think valeryan is on to something, and that the behavior of the status messages is different with the php service (non existent) for some reason. As a user, that would seem like a bug in Ubuntu, but that's for another place.

Thanks for your work. Aside from this minor issue, Wabash for me the difference of using WLS or not. I tend to be very close happy on my windows (which meant bye bye webserver, database, etc. every time :/)

Side note: one nice feature for a rainy day would be to add an option to the task icon to suppress notifications (only thing stopping me from checking "start with windows").

unleashit avatar Apr 12 '17 19:04 unleashit

By the looks of things, the issue comes from here.

Would it be destructive to change

default:
    // error, unknown, or garbled message
    try
    {
        this.wabashd.Kill () ;
    }
    catch
    {
        // ignored; if we can't kill it, or its already dead, we can't do anything.
    }

to:

default:
    this.owner.Message ("No response from daemon.") ;
    break;

?

I'd mess around with it but I don't know how to compile.

Log1x avatar May 28 '17 22:05 Log1x

this might be related to php-fpm in Ubuntu trying to create its pid file in /run/php, but this directory does not exist when WSL is reinitialized. as a workaround, change the pid config value in /etc/php/7.*/fpm/php-fpm.conf to use /run instead.

heldchen avatar Jul 15 '17 10:07 heldchen

@heldchen I will give that a try, however php7 starts fine. The problem is that wabash can't start it.

valeryan avatar Jul 18 '17 03:07 valeryan

@valeryan I've created a replacement /usr/bin/start-wabashd script that acts a drop-in replacement of the wabashd daemon: https://github.com/cerebrate/wabashd/issues/2 (for reasons unrelated to your issue - I needed to get rid of the mono dependencies in my WSL install).

in this version, the response to the Wabash strt command (used to start a service) does not error out when a service start does not generate output. that might help with your php problem.

heldchen avatar Aug 05 '17 17:08 heldchen