How to Start Wildfly Java Application Server in the Background Process

Posted on

This is an article for completing the previous article in this link. It is an article about starting Wildfly Java Application Server. There is an additional information in this article. Instead of just starting the Wildfly Java Application Server in the foreground process, it will run in the background process. The command for executing the process is actually the same with the one exist in this link.. The only differentiation relies on the additional parameter in the command execution. The following is the command pattern :

/opt/wildfly-xx.x.x.Final/bin/ &

As in the above command pattern, there is one additional character acts as the parameter for running the command in the background process. Using the above command pattern, just execute the command as follows for an example :

user@hostname:~$ /opt/wildfly-17.0.1.Final/bin/ &
[1] 15965
user@hostname:~$ =========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /opt/wildfly-17.0.1.Final

  JAVA: /opt/jdk1.8.0_202/bin/java

  JAVA_OPTS:  -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true 


21:56:36,537 INFO  [org.jboss.modules] (main) JBoss Modules version 1.9.1.Final
21:56:36,859 INFO  [org.jboss.msc] (main) JBoss MSC version 1.4.8.Final
21:56:36,872 INFO  [org.jboss.threads] (main) JBoss Threads version 2.3.3.Final
21:56:36,969 INFO  [] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 17.0.1.Final (WildFly Core 9.0.2.Final) starting
21:56:37,632 INFO  [] (ServerService Thread Pool -- 21) ELY00001: WildFly Elytron version 1.9.1.Final
21:56:38,108 INFO  [] (Controller Boot Thread) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/core-service=management/management-interface=http-interface' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
21:56:38,191 INFO  [] (ServerService Thread Pool -- 36) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/subsystem=undertow/server=default-server/https-listener=https' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
21:56:38,282 INFO  [] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
21:56:38,303 INFO  [org.xnio] (MSC service thread 1-3) XNIO version 3.7.2.Final
21:56:38,315 INFO  [org.xnio.nio] (MSC service thread 1-3) XNIO NIO Implementation Version 3.7.2.Final
21:56:38,402 INFO  [] (ServerService Thread Pool -- 43) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.4)
21:56:38,413 INFO  [org.jboss.remoting] (MSC service thread 1-1) JBoss Remoting version 5.0.12.Final
21:56:38,457 INFO  [] (ServerService Thread Pool -- 51) WFLYCLINF0001: Activating Infinispan subsystem.
21:56:38,478 INFO  [] (ServerService Thread Pool -- 52) WFLYIO001: Worker 'default' has auto-configured to 16 core threads with 128 task threads based on your 8 available processors
21:56:38,562 INFO  [] (ServerService Thread Pool -- 53) WFLYRS0016: RESTEasy version 3.7.0.Final
21:56:38,566 INFO  [] (MSC service thread 1-2) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.4.16.Final)
21:56:38,567 INFO  [org.wildfly.extension.microprofile.config.smallrye._private] (ServerService Thread Pool -- 60) WFLYCONF0001: Activating WildFly MicroProfile Config Subsystem
21:56:38,578 INFO  [] (ServerService Thread Pool -- 61) WFLYHEALTH0001: Activating Eclipse MicroProfile Health Subsystem
21:56:38,581 INFO  [] (MSC service thread 1-6) WFLYJCA0018: Started Driver service with driver-name = h2
21:56:38,582 INFO  [] (ServerService Thread Pool -- 58) WFLYJSF0007: Activated the following JSF Implementations: [main]
21:56:38,586 INFO  [org.wildfly.extension.microprofile.opentracing] (ServerService Thread Pool -- 63) WFLYTRACEXT0001: Activating MicroProfile OpenTracing Subsystem
21:56:38,598 INFO  [] (ServerService Thread Pool -- 64) WFLYNAM0001: Activating Naming Subsystem
21:56:38,604 INFO  [] (ServerService Thread Pool -- 70) WFLYSEC0002: Activating Security Subsystem
21:56:38,655 INFO  [org.wildfly.extension.microprofile.metrics.smallrye] (ServerService Thread Pool -- 62) WFLYMETRICS0001: Activating Eclipse MicroProfile Metrics Subsystem
21:56:38,661 WARN  [] (ServerService Thread Pool -- 72) WFLYTX0013: The node-identifier attribute on the /subsystem=transactions is set to the default value. This is a danger for environments running multiple servers. Please make sure the attribute value is unique.
21:56:38,658 INFO  [] (MSC service thread 1-4) WFLYSEC0001: Current PicketBox version=5.0.3.Final
21:56:38,716 INFO  [] (MSC service thread 1-8) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
21:56:38,727 INFO  [] (MSC service thread 1-1) WFLYNAM0003: Starting Naming Service
21:56:38,737 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-8) WFLYUT0003: Undertow 2.0.21.Final starting
21:56:38,751 INFO  [] (ServerService Thread Pool -- 74) WFLYWS0002: Activating WebServices Extension
21:56:38,753 INFO  [io.smallrye.metrics] (MSC service thread 1-6) Converted [2] config entries and added [4] replacements
21:56:38,758 INFO  [io.smallrye.metrics] (MSC service thread 1-6) Converted [3] config entries and added [14] replacements
21:56:39,020 INFO  [] (MSC service thread 1-8) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 32 (per class), which is derived from the number of CPUs on this host.
21:56:39,021 INFO  [] (MSC service thread 1-7) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 128 (per class), which is derived from thread worker pool sizing.
21:56:39,074 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 73) WFLYUT0014: Creating file handler for path '/opt/wildfly-17.0.1.Final/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
21:56:39,083 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0012: Started server default-server.
21:56:39,085 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0018: Host default-host starting
21:56:39,264 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0006: Undertow HTTP listener default listening on
21:56:39,339 INFO  [] (MSC service thread 1-1) WFLYEJB0493: EJB subsystem suspension complete
21:56:39,414 INFO  [] (MSC service thread 1-5) WFLYPAT0050: WildFly Full cumulative patch ID is: base, one-off patches include: none
21:56:39,442 WARN  [] (MSC service thread 1-2) WFLYDM0111: Keystore /opt/wildfly-17.0.1.Final/standalone/configuration/application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
21:56:39,461 INFO  [] (MSC service thread 1-1) WFLYDS0013: Started FileSystemDeploymentService for directory /opt/wildfly-17.0.1.Final/standalone/deployments
21:56:39,502 INFO  [] (MSC service thread 1-1) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
21:56:39,639 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-5) WFLYUT0006: Undertow HTTPS listener https listening on
21:56:40,171 INFO  [] (MSC service thread 1-7) JBWS022052: Starting JBossWS 5.3.0.Final (Apache CXF 3.3.2) 
21:56:40,295 INFO  [] (Controller Boot Thread) WFLYSRV0212: Resuming server
21:56:40,297 INFO  [] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on
21:56:40,297 INFO  [] (Controller Boot Thread) WFLYSRV0051: Admin console listening on
21:56:40,297 INFO  [] (Controller Boot Thread) WFLYSRV0025: WildFly Full 17.0.1.Final (WildFly Core 9.0.2.Final) started in 4124ms - Started 314 of 576 services (369 services are lazy, passive or on-demand)


The output will change into the normal bash prompt command line interface after typing ‘Enter’ button in the keyboard after successfully starting the process. As an addition, the process is still running although the command line interface is no longer available.  Try to close the command line interface where there exist the command execution. Check the process in another command line interface whether it is still running and available or not. Do the following command to check the Wildfly Java Application Server’s service or process :

root@hostname ~# netstat -tulpn | grep 8080
tcp        0      0*               LISTEN      16010/java          
root@hostname ~# 

The above command is a command to check whether the port for Wildfly Java Application Server is listening for incoming request. It is the outcome result of running the Wildfly Java Application Server. As in the above output, it is currently listening. It is an indication that informs it indirectly.

root@hostname:~# ps aux | grep wildfly
root    15965  0.0  0.0   4632  1740 pts/3    S    21:56   0:00 /bin/sh /opt/wildfly-17.0.1.Final/bin/
root    16010 79.7  2.2 2233612 367560 pts/3  Sl   21:56   0:15 /opt/jdk1.8.0_202/bin/java -D[Standalone] -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Dorg.jboss.boot.log.file=/opt/wildfly-17.0.1.Final/standalone/log/server.log -Dlogging.configuration=file:/opt/wildfly-17.0.1.Final/standalone/configuration/ -jar /opt/wildfly-17.0.1.Final/jboss-modules.jar -mp /opt/wildfly-17.0.1.Final/modules -Djboss.home.dir=/opt/wildfly-17.0.1.Final -Djboss.server.base.dir=/opt/wildfly-17.0.1.Final/standalone
root    16155  0.0  0.0  23964  1084 pts/3    S+   21:56   0:00 grep --color=auto wildfly

The above output is also another way to check whether the process is running or not. It is a command to check the active Wildfly process. Fortunately, according to the above output, the process is still running.