How to Start Wildfly Java Application Server using Wildfly User Account to listen to all available address as a Background Process

Posted on

Introduction

This is an another article for running Wildfly Java Application Server’s service. It happens by starting Wildfly Java Application Server process. There are several articles available with similar content. Obviously, those articles are different because of a specific condition on starting or running the process. Before going further, the following are the list of those article’s link :

1. How to Start Wildfly Java Application Server in the Foreground Process .

  1. How to Start Wildfly Java Application Server in the Background Process .
  2. How to Start Wildfly Java Application Server using Wildfly User Account as a Foreground Process .

  3. How to Start Wildfly Java Application Server using Wildfly User Account as a Background Process .

  4. How to Start Wildfly Java Application Server and listening to all available address as a Foreground Process .

  5. How to Start Wildfly Java Application Server and listening to all available address as a Background Process .

  6. How to Start Wildfly Java Application Server using Wildfly User Account to listen to all available address as a Foreground Process .

The main topic of all of those articles are decribing to run Wildfly Java Application Server in this article. In this context, the differentiation is that there is an additional specific and different condition on running it. Moreover, this article is actually an extension of the previous article with the title of ‘How to Start Wildfly Java Application Server and listening to all available address as a Background Process‘. For more detail, continue on to the following section to identify the difference on starting the service.

 

Running Wildfly Java Application Server

In this article, the focus is running Wildfly Java Application Server using ‘wildfly’ user account to listen in all available addresses as a background process. The following are steps for achieving it :

1. First of all, switch to ‘root’ user account. The following is how to do it :

user@hostname:~$ sudo su - 
[sudo] password for user: 
root@hostname ~# 

2. Execute the command to run Wildfly with the specific condition. Below is the command pattern to fulfill it :

 runuser wildfly -c "/opt/wildfly-xx.x.x.Final/bin/standalone.sh -b 0.0.0.0" &

For an example, the following is the execution of the above command pattern in a real environment :

root@hostname ~# runuser wildfly -c "/opt/wildfly-17.0.1.Final/bin/standalone.sh -b 0.0.0.0" &
[1] 8265
root@hostname ~# =========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /opt/wildfly-17.0.1.Final

  JAVA: java

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

=========================================================================

16:40:43,499 INFO  [org.jboss.modules] (main) JBoss Modules version 1.9.1.Final
16:40:45,127 INFO  [org.jboss.msc] (main) JBoss MSC version 1.4.8.Final
16:40:45,135 INFO  [org.jboss.threads] (main) JBoss Threads version 2.3.3.Final
16:40:45,335 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 17.0.1.Final (WildFly Core 9.0.2.Final) starting
16:40:47,464 INFO  [org.wildfly.security] (ServerService Thread Pool -- 26) ELY00001: WildFly Elytron version 1.9.1.Final
16:40:49,640 INFO  [org.jboss.as.controller.management-deprecated] (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.
16:40:49,676 INFO  [org.jboss.as.controller.management-deprecated] (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.
16:40:49,743 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
16:40:49,760 INFO  [org.xnio] (MSC service thread 1-4) XNIO version 3.7.2.Final
16:40:49,767 INFO  [org.xnio.nio] (MSC service thread 1-4) XNIO NIO Implementation Version 3.7.2.Final
16:40:49,822 INFO  [org.jboss.remoting] (MSC service thread 1-2) JBoss Remoting version 5.0.12.Final
16:40:49,875 INFO  [org.wildfly.extension.microprofile.health.smallrye] (ServerService Thread Pool -- 61) WFLYHEALTH0001: Activating Eclipse MicroProfile Health Subsystem
16:40:49,891 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 51) WFLYCLINF0001: Activating Infinispan subsystem.
16:40:49,895 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 52) WFLYIO001: Worker 'default' has auto-configured to 16 core threads with 128 task threads based on your 8 available processors
16:40:49,903 INFO  [org.wildfly.extension.microprofile.config.smallrye._private] (ServerService Thread Pool -- 60) WFLYCONF0001: Activating WildFly MicroProfile Config Subsystem
16:40:49,906 WARN  [org.jboss.as.txn] (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.
16:40:49,921 INFO  [org.wildfly.extension.microprofile.opentracing] (ServerService Thread Pool -- 63) WFLYTRACEXT0001: Activating MicroProfile OpenTracing Subsystem
16:40:49,938 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 74) WFLYWS0002: Activating WebServices Extension
16:40:49,949 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 70) WFLYSEC0002: Activating Security Subsystem
16:40:49,956 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 64) WFLYNAM0001: Activating Naming Subsystem
16:40:49,964 INFO  [org.jboss.as.connector] (MSC service thread 1-1) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.4.16.Final)
16:40:50,009 INFO  [org.wildfly.extension.microprofile.metrics.smallrye] (ServerService Thread Pool -- 62) WFLYMETRICS0001: Activating Eclipse MicroProfile Metrics Subsystem
16:40:50,061 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 58) WFLYJSF0007: Activated the following JSF Implementations: [main]
16:40:50,148 INFO  [org.jboss.as.security] (MSC service thread 1-2) WFLYSEC0001: Current PicketBox version=5.0.3.Final
16:40:50,296 INFO  [org.jboss.as.naming] (MSC service thread 1-4) WFLYNAM0003: Starting Naming Service
16:40:50,297 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-4) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
16:40:50,416 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 43) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.4)
16:40:50,630 INFO  [org.jboss.as.jaxrs] (ServerService Thread Pool -- 53) WFLYRS0016: RESTEasy version 3.7.0.Final
16:40:50,652 INFO  [io.smallrye.metrics] (MSC service thread 1-5) Converted [2] config entries and added [4] replacements
16:40:50,654 INFO  [io.smallrye.metrics] (MSC service thread 1-5) Converted [3] config entries and added [14] replacements
16:40:51,174 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-5) WFLYJCA0018: Started Driver service with driver-name = h2
16:40:51,345 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0003: Undertow 2.0.21.Final starting
16:40:51,346 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: '[]']
16:40:51,394 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0012: Started server default-server.
16:40:51,396 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0018: Host default-host starting
16:40:51,838 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0006: Undertow HTTP listener default listening on 0.0.0.0:8080
16:40:52,604 INFO  [org.jboss.as.ejb3] (MSC service thread 1-6) 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.
16:40:52,604 INFO  [org.jboss.as.ejb3] (MSC service thread 1-7) 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.
16:40:52,970 INFO  [org.jboss.as.ejb3] (MSC service thread 1-2) WFLYEJB0493: EJB subsystem suspension complete
16:40:53,114 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
16:40:54,293 INFO  [org.jboss.as.patching] (MSC service thread 1-5) WFLYPAT0050: WildFly Full cumulative patch ID is: base, one-off patches include: none
16:40:54,317 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-6) WFLYDS0013: Started FileSystemDeploymentService for directory /opt/wildfly-17.0.1.Final/standalone/deployments
16:40:54,698 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0006: Undertow HTTPS listener https listening on 0.0.0.0:8443
16:40:55,038 INFO  [org.jboss.ws.common.management] (MSC service thread 1-5) JBWS022052: Starting JBossWS 5.3.0.Final (Apache CXF 3.3.2) 
16:40:55,164 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
16:40:55,167 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
16:40:55,167 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
16:40:55,167 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 17.0.1.Final (WildFly Core 9.0.2.Final) started in 12644ms - Started 314 of 576 services (369 services are lazy, passive or on-demand)

root@hostname ~# 

As in the above output command, Wildfly is currently running. It is running in the background because the redirection back from the output to the command line interface is done. The process is running under ‘wildfly’ user account to make it more secure. It will listen the incoming request in all of the available addresses in the machine. Actually, the representation of ‘0.0.0.0’ as the value of the ‘-b’ parameter is referring to all available addresses in the machine.

 

Checking the Wildfly Service’s status

Finally, after successfully running the process, check the status of the service. As an addition, a reference for checking it exist in the following link of article with the title of ‘How to Check Wildfly Java Application Server running service or process‘. Using the command execution in that article to check the service’s status, the process above will make Wildfly run in every available addresses. So, the addresses appear in the output of the command for checking the wildfly service’s status is the broadcast address. For an example, the following isĀ  the output appear after executing command for checking Wildfly service’s status :

root@hostname ~# ps aux | grep wildfly
root      8716  0.0  0.0  70532  2740 pts/9    S+   16:42   0:00 runuser wildfly -c /opt/wildfly-17.0.1.Final/bin/standalone.sh -b 0.0.0.0
wildfly   8717  0.0  0.0   4628  1480 ?        Ss   16:42   0:00 /bin/sh /opt/wildfly-17.0.1.Final/bin/standalone.sh -b 0.0.0.0
wildfly   8768  0.2  2.2 2250300 356512 ?      Sl   16:42   0:21 java -D[Standalone] -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -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/logging.properties -jar /opt/wildfly-17.0.1.Final/jboss-modules.jar -mp /opt/wildfly-17.0.1.Final/modules org.jboss.as.standalone -Djboss.home.dir=/opt/wildfly-17.0.1.Final -Djboss.server.base.dir=/opt/wildfly-17.0.1.Final/standalone -b 0.0.0.0
root     14028  0.0  0.0  23960  1000 pts/12   S+   18:53   0:00 grep wildfly
root@hostname ~# netstat -tulpn | grep 8080
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      8768/java           
root@hostname ~# 

In summary, as in the above output, Wildfly is currently running. It runs with ‘wildfly’ user account as the owner of the process. Moreover, it listen to all of the available addresses exist in the machine.

Leave a Reply