Start WildFly with nohup standalone full - java

I want to start the WildFly 11 using the standalone-full.xml instead standalone.xml.
So I have to execute the command:
sh standalone.sh -c standalone-full.xml
inside folder wildfly-11.0.0.Final/bin/.
But if I want to start the WildFly in silence mode with nohup, it doesn't start with parameter -c standalone-full.xml.
I tried with:
nohup ./standalone.sh -b 0.0.0.0 -c standalone-full.xml >/dev/null 2>&1 &
But it does not work.
What is the correct command to start WildFly with standalone-full.xml in silence mode in Linux?
Server information: cat /etc/*-release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.4 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.4"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.4 (Maipo)"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.4:GA:server"
Thanks.

Use the below cammand.
nohup sh standalone.sh -c standalone-full.xml > /dev/null &

Related

karaf client(./client) failed to get session in 4.3.6 when run as wrapper service on ubuntu

I am trying to upgrade my java code to Java 17 and karaf 4.3.6 from java 8 /karaf 4.2.x.
Karaf is run as wrapper service while deploying on ubuntu.
While setting up i need to run folllowing command
sh_with_monitoring "echo 'feature:install war' | #{get_property("#{server.environment}","nil","KARAFINSTALLDIR")}/apache-karaf/bin/client -u #{get_property("#{server.environment}","pwd","KARAF_ADMIN_USERNAME")} -p #{get_property("#{server.environment}","pwd","KARAF_ADMIN_PASSWORD")} -b"
But while running ./client it failed to get session
./client -u karafqa -p karafqa
Logging in as karafqa
Failed to get the session.
Not only through script i am not able to run same command on server prompt.
I have tried ./client -a -h -u -p options also. But nothing work.
Same command is working perfectly fine with java 8 and karaf 4.2.x
Any help would be highly appreciated

Can't start tomcat as service in redhat

I'm new to Linux but having spent a whole day I Installed Java and Tomcat. My goal is to host an App with this Linux box. I know it all works fine from my windows based machine, but it is my laptop so I'm planning to use the Linux Box as my dedicated server.
I am following this tutorial . From this tutorial I have executed the following command :
cd /etc/init.d
vi tomcat
#!/bin/bash
# description: Tomcat Start Stop Restart
# processname: tomcat
# chkconfig: 234 20 80
JAVA_HOME=/usr/java/jdk1.7.0_05
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CATALINA_HOME=/usr/share/apache-tomcat-7.0.29
case $1 in
start)
sh $CATALINA_HOME/bin/startup.sh
;;
stop)
sh $CATALINA_HOME/bin/shutdown.sh
;;
restart)
sh $CATALINA_HOME/bin/shutdown.sh
sh $CATALINA_HOME/bin/startup.sh
;;
esac
exit 0
chmod 755 tomcat
chkconfig --add tomcat
chkconfig --level 234 tomcat on
chkconfig --list tomcat
service tomcat start
After this command , tomcat is started at port 8082 . But when I restart pc , the tomcat is not started with boot of PC .
How can I do this ?
Since you use Red Hat you can use systemd for services.
Create a file /etc/systemd/system/tomcat.service:
[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target
[Service]
Type=forking
Environment=JAVA_HOME=/usr/java/jdk1.7.0_05
Environment=CATALINA_PID=/usr/share/apache-tomcat-7.0.29/temp/tomcat.pid
Environment=CATALINA_HOME=/usr/share/apache-tomcat-7.0.29
Environment=CATALINA_BASE=/usr/share/apache-tomcat-7.0.29
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Duser.timezone=UTC -Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'
ExecStart=/usr/share/apache-tomcat-7.0.29/bin/startup.sh
ExecStop=/bin/kill -15 $MAINPID
User=tomcat
Group=tomcat
[Install]
WantedBy=multi-user.target
I specified the script to start after syslog and network are enabled.
As we can see systemd handles the tomcat as a daemon and kills the PID.
With User and Group we specify the user and the group that the process should be run as.
Systemd will handle the upstart process and kill it using the PID.
To enable it to run then issue:
systemctl enable tomcat
systemctl start tomcat
Try to use this command instead:
sudo systemctl enable tomcat

How to Install Selenium as a Unix daemon?

How to put the following commands to run in the background as a service on Ubuntu?
Start the hub
java -jar selenium-server-standalone-2.48.2.jar -role hub &
Start the nodes
java -jar selenium-server-standalone-2.48.2.jar -role node -hub http://localhost:4444/grid/register &
Whenever I close my ssh session can not access the selenium grid service even putting '&' character at the end of each command. Would someone give me a help?
I've tried to make selenium-server-standalone running as a service, but it failed to launch browser (I've tried chrome and firefox).
So it is better to do as Mahsum Akbas says.
Here is an example of how you could make it as a service:
bash - Start Java jar by service (linux)...
But it will not launch real browsers.
I was using jenkins service to launch real browser, but it failed too.
I had success in launching tests using headless browser. But there was the problem with some tests were failing.
And also, you could try this
EDITED: I've achieved it in such way using systemd:
sudo vim /etc/systemd/system/selenium-server-hub.service
[Unit]
Description=Selenium Server Standalone hub
StartLimitIntervalSec=5
After=syslog.target
[Service]
Type=simple
Restart=always
RestartSec=8
User=spacer
ExecStart=/bin/bash -c "export DISPLAY=:10 && /usr/bin/java -jar /home/spacer/seleniumserver/selenium-server.jar -role hub"
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
sudo vim /etc/systemd/system/selenium-server-hub.service
[Unit]
Description=Selenium Server node
StartLimitIntervalSec=0
After=selenium-server-hub.target
[Service]
Type=simple
Restart=always
RestartSec=8
User=spacer
ExecStart=/bin/bash -c "export DISPLAY=:10 && /usr/bin/java -Dwebdriver.chrome.driver=/bin/chromedriver -jar /home/spacer/seleniumserver/selenium-server.jar -role node -hub 'http://192.168.0.101:4444/grid/register/'"
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
I connect to my linux server through RDP and it opens display :10. Your display could be different.
You could check your displays by command:
ps e | grep -Po " DISPLAY=[\.0-9A-Za-z:]* " | sort -u
PS: Chrome and Firefox are starting, even though chromedriver could not be started when I was launching selenium-server hub and node from terminal as usual.
you can use nohup command. so, you can redirect output to nohup file and there will not be kill session after disconnect ssh.
nohup java -jar selenium-server-standalone-2.48.2.jar -role hub &
nohup java -jar selenium-server-standalone-2.48.2.jar -role node -hub http://localhost:4444/grid/register &

apache tomcat not starting while service tomcat start

I am using RHEL 7 os with this i am using apache tomcat6. while try to start it using this command i am getting this message as:
Starting tomcat6: /etc/init.d/tomcat6: line 70: checkpid: command not found
and at line number 70 the code is as:
if checkpid $kpid 2>&1; then
echo "process allready running"
return -1
else
echo "lock file found but no process running for pid $kpid, continuing"
fi
after this execute the command i got process id for tomcat by this command:
[root#localhost ~]# ps -ef | grep tomcat
root 14074 13882 0 01:50 pts/1 00:00:00 grep --color=auto tomcat
but my war file is not deployed and also localhost:8080 is not working.

Java VisualVM not able to connect to Jboss

Java VisualVM not able to connect Jboss server, when jboss server running with option -b 0.0.0.0.
jboss run script - run.sh -c web -b 0.0.0.0
When i try to run jboss with this like - run.sh -c web -b {MyIp}
then Java VisualVM is able to connect jboss server.
Can any one help me how to connect while jboss running with first option ( -b 0.0.0.0)
I am using this configuration in run.conf file in jboss
JAVA_OPTS="$JAVA_OPTS -XX:PermSize=256m -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=8077 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
Add this to JAVA_OPTS
JAVA_OPTS="$JAVA_OPTS -XX:PermSize=256m -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=8077 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname=0.0.0.0"
instead of 0.0.0.0 use your system IP.

Categories