7 Replies Latest reply on Aug 10, 2017 4:53 AM by mayerw01

    Can't setup Wildfly 10 as a Service on Ubuntu 16.04

    alkoch

      Hello,

       

      I have Wildfly 10 installed and running successfully on Ubuntu 16.04.  (This is on an AWS instance running Ubuntu but I don't think that is an issue).  I need to get this running as a service.  I have found a variety of books and URLs that describe how to do this but they all are for an earlier version of Wildfly and/or an earlier version of Ubuntu and as a result none of them is correct for the current server and OS combination.

      I finally found https://dennis.gesker.com/2016/02/09/wildfly-10-on-ubuntu-15-10/ which seems to come close to working.  I already had Wildfly installed so I picked up in the instructions where we "Change ownership of directory and symbolic link to wildfly:"  The problem is as follows:

       

      wildflyuser@ip-172-31-27-23:/etc/init.d? sudo update-rc.d wildfly defaults

      wildflyuser@ip-172-31-27-23:/etc/init.d? service wildfly start

      ==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===

      Authentication is required to start 'wildfly.service'.

      Multiple identities can be used for authentication:

      1.  Ubuntu (ubuntu)

      2.  ,,, (wildflyuser)

      Choose identity to authenticate as (1-2): 2

      Password:

      ==== AUTHENTICATION COMPLETE ===

      Job for wildfly.service failed because the control process exited with error code. See "systemctl status wildfly.service" and "journalctl -xe" for details.

       

      I tried the suggested commands in the last line to see more detail but:

      wildflyuser@ip-172-31-27-23:/etc/init.d? systemctl status wildfly.service

      ? wildfly.service - LSB: WildFly Application Server

         Loaded: loaded (/etc/init.d/wildfly; bad; vendor preset: enabled)

         Active: failed (Result: exit-code) since Mon 2017-07-31 15:34:08 UTC; 20s ago

           Docs: man:systemd-sysv-generator(8)

        Process: 17041 ExecStart=/etc/init.d/wildfly start (code=exited, status=1/FAILURE)

       

       

      Can anyone tell me:

      1) What's going wrong here, OR

      2) Point me to a procedure that will let em get Wildfly running as a service?

       

      Thank you.

        • 1. Re: Can't setup Wildfly 10 as a Service on Ubuntu 16.04
          mayerw01

          Did you check your server.log?

          • 2. Re: Can't setup Wildfly 10 as a Service on Ubuntu 16.04
            alkoch

            Thanks for the response Wolfgang but there are no logs at all.  It seems that the service never even gets started.  Any other ideas?

            • 3. Re: Can't setup Wildfly 10 as a Service on Ubuntu 16.04
              mayerw01

              I understand you installed the WildFly start script into the /etc/init.d directory as it is the case for the init process (systemd usually looks into /etc/systemd/system)

              Maybe there is an issue with your wildfly start script.

              So you could try to start WildFly directly like:

                        sudo /etc/init.d/wildfly start

              • 4. Re: Can't setup Wildfly 10 as a Service on Ubuntu 16.04
                alkoch

                Hi Wolfgang,

                 

                Thanks for the suggestion.  Here's what happens:

                 

                myuser@ip-172-31-27-23:~⟫ sudo /etc/init.d/wildfly start

                [sudo] password for myuser:

                Starting wildfly (via systemctl): wildfly.serviceJob for wildfly.service failed because the control process exited with error code. See "systemctl status wildfly.service" and "journalctl -xe" for details.

                failed!

                1 myuser@ip-172-31-27-23:~⟫ systemctl status wildfly.service

                ● wildfly.service - LSB: WildFly Application Server

                   Loaded: loaded (/etc/init.d/wildfly; bad; vendor preset: enabled)

                   Active: failed (Result: exit-code) since Fri 2017-08-04 17:13:27 UTC; 17s ago

                     Docs: man:systemd-sysv-generator(8)

                  Process: 6962 ExecStart=/etc/init.d/wildfly start (code=exited, status=1/FAILURE)

                 

                I still have this "bad; vendor preset: enabled" error but I have no idea what it means.  Can you help?

                 

                Thank you for your assistance.

                • 5. Re: Can't setup Wildfly 10 as a Service on Ubuntu 16.04
                  mayerw01

                  "bad; vendor preset: enabled" as such is not an error (systemd - sudo service status includes bad; - Ask Ubuntu )

                   

                  But your "/etc/init.d/wildfly start" command exited with status=1 (generic or unspecified error).

                  Since this is comming from your start script, I'd suggest that you analyse your /etc/init.d/wildfly script and check under which conditions the status 1 is returned in the start function.

                  One reason might be that the $JBOSS_PIDFILE is still available or some file permission is missing.

                  • 6. Re: Can't setup Wildfly 10 as a Service on Ubuntu 16.04
                    alkoch

                    Hello Wolfgang,

                     

                    I am very new to Wildfly so please bear with me.  I am using the standard script with no changes as supplied by the Wildfly installation and frankly have no idea what it is doing.  I am running this under a stock Ubuntu 16.04 so I'm very surprised that this just "simply run out of the box".  I really don't know how to debug the script file.  Since this is the official JBoss site I would really think somebody would understand what has gone wrong with the default script.  I'm not sure how to proceed.  Thank you for your ongoing help.

                    • 7. Re: Can't setup Wildfly 10 as a Service on Ubuntu 16.04
                      mayerw01

                      I am not sure what you mean with the 'official JBoss site'. Under $JBOSS_HOME/docs/contrib/scripts/init.d/ you should find examples for Debian and Redhat. But there is no 'default'. And it is difficult to analyze issues if you don't understand your environment. But if you open eg wildfly-init-redhat.sh you will see that the script logs to $JBOSS_CONSOLE_LOG.

                      So if you run 'export JBOSS_USER=wildfly && /etc/init.d/wildfly  start' you might see something like:

                       

                      Starting wildfly: chown wildfly /var/run/wildfly || true

                      wildfly started with errors, please see server log for details

                       

                      In the $JBOSS_CONSOLE_LOG (eg /var/log/wildfly/console.log) you will probably find some 'permission denied' messages there.