JBoss5 and JBoss7 installation conflict same Linux Machine - linux

I had a properly working JBoss7 installation, but recently on my machine my team mate installed JBoss5.1.0GA, Since then i am facing two problems and still unable to resolve them.
Whene ever i stop the jboss with init.d script. I get this error.
[root ~]# service jboss stop
Stopping jboss-as: [ OK ]
[root ~]# *** JBossAS process (25571) received KILL signal ***
grep: /var/run/jboss-as/jboss-as-standalone.pid: No such file or directory
Could there be any conflict with the processID file that jboss generates to check weather server is running or not.
I doubt that there is a conflict with another JBoss5 Installation.
Second Issue is I am unable to connect with the server via jboss-cli.sh
[root bin]# sh jboss-cli.sh
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /] connect localhost
The controller is not available at localhost:9999
[disconnected /] connect localhost
One thing i want you to check, the ps auxwww |grep jboss commands result
I can see two process , is this any conflict ? With PId
root 25970 0.0 0.0 161476 1960 pts/0 S 07:58 0:00 su - jboss -c LAUNCH_JBOSS_IN_BACKGROUND=1 JBOSS_PIDFILE=/var/run/jboss-as/jboss-as-standalone.pid /usr/share/jboss-as/bin/standalone.sh -c standalone.xml
jboss 25973 0.0 0.0 106096 1344 ? Ss 07:58 0:00 /bin/sh /usr/share/jboss-as/bin/standalone.sh -c standalone.xml
jboss 26022 8.7 8.7 1027368 342776 ? Sl 07:58 0:45 /usr/java/jdk1.7.0_25/bin/java -D[Standalone] -server -XX:+TieredCompilation -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml -Dspring.profiles.active=dev -Dorg.jboss.boot.log.file=/usr/share/jboss-as/standalone/log/boot.log -Dlogging.configuration=file:/usr/share/jboss-as/standalone/configuration/logging.properties -jar /usr/share/jboss-as/jboss-modules.jar -mp /usr/share/jboss-as/modules -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -Djboss.home.dir=/usr/share/jboss-as -c standalone.xml
root 26365 0.0 0.0 103244 848 pts/0 S+ 08:07 0:00 grep jboss
I can see multiple process started with command sh standalone.sh command.
Is this the interference ?

If there is no PID file, then you might have a permissions issue on /var/run/jboss-as
You should also check JBOSS_HOME/standalone/log/console.log to see if there are any errors there

Replying after a long time, but we were successfully able to run two instances of JBoss, with using Port Binding Offset and while connecting via Jboss-cli.sh provide your incremented Port.
If you set port.binding.offset=2 then connect to port 10001 i.2 9999+2

Related

How to kill locked Node process in WSL

Running my web application in WSL is occasionally getting stuck, I am able to close the script. But the process in the background is stuck and has my files locked.
Detailed info
The Web application is running with webpack dev server listening on changes in the code. When doing git operations, sometimes the files are locked and I cannot perform changes.
I can see the process by running
$ps aux
The process is taking a lot of memory.
I tried killing the process with
$kill -9 604
$pkill -f node
$kill -SIGKILL 604
But none of them works
I even try to kill the process from Task Manager but its still there.
(Windows Subsystem for Linux running on Windows 10)
Hello same problem on win11
sudo kill -9 2769
mike 2769 1.5 5.7 13169872 1914268 ? Z 11:54 7:42 /home/mike/.nvm/versions/node/v14.17.4/bin/node /mnt/d/dev/repo/mikecodeur/react-course-app/example/react-fundamentals/node_modules/react-scripts/scripts/start.js
mike 2907 0.1 0.0 0 0 ? Z 11:54 0:36 [node] <defunct>

What starts this docker process on my laptop?

Every time I boot up my Lubuntu 16.04 laptop I can see I have a running docker container:
$ ps -ef | grep docker
root 1724 1 3 21:17 ? 00:01:30 /usr/bin/dockerd -H fd://
root 1774 1724 0 21:17 ? 00:00:04 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc
root 4750 1774 0 21:17 ? 00:00:00 docker-containerd-shim 72541a4648b890132985daf2357d1130b8b5208cf12ede607b93ab2987629719 /var/run/docker/libcontainerd/72541a4648b890132985daf2357d1130b8b5208cf12ede607b93ab2987629719 docker-runc
stephane 10755 1793 0 22:07 pts/0 00:00:00 grep docker
It serves a Jenkins application on the port 80 and requesting localhost/ in the browser redirects to http://localhost/login?from=%2F and shows a Jenkins warning page:
Unlock Jenkins
To ensure Jenkins is securely set up by the administrator, a password has been written to the log (not sure where to find it?) and this file on the server:
A wget request shows:
$ wget localhost/
--2017-05-23 22:09:55-- http://localhost/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
2017-05-23 22:09:55 ERROR 403: Forbidden.
How can I know which service is firing up this docker process ?
I looked in the /etc/init.d/ directory:
$ l /etc/init.d/
alsa-utils* checkroot-bootclean.sh* halt* mattermostd* nginxd* rc* single* uuidd*
anacron* checkroot.sh* hostname.sh* mountall-bootclean.sh* ntp* rc.local* skeleton whoopsie*
apachedsd* console-setup* httpd* mountall.sh* ondemand* rcS* ssh* x11-common*
apparmor* cron* hwclock.sh* mountdevsubfs.sh* openvpn* README tomcatd*
apport* cups* irqbalance* mountkernfs.sh* php-fpm* reboot* udev*
avahi-daemon* cups-browsed* keyboardd* mountnfs-bootclean.sh* plymouth* redis* ufw*
bluetooth* dbus* killprocs* mountnfs.sh* plymouth-log* resolvconf* umountfs*
bootmisc.sh* docker* kmod* mysqld* postfix* rsync* umountnfs.sh*
cgroupfs-mount* dropboxd* lightdm* networking* pppd-dns* rsyslog* umountroot*
checkfs.sh* grub-common* mariadbd* network-manager* procps* sendsigs* urandom*
The /etc/init.d/docker is mine and removing it from the directory, a reboot still comes up with a running docker process.
I removed the /etc/init.d/docker file, rebooted, and there is a docker process:
$ ps -ef | grep docker
root 1560 1 5 22:15 ? 00:00:06 /usr/bin/dockerd -H fd://
root 1645 1560 0 22:15 ? 00:00:00 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc
root 4644 1645 0 22:15 ? 00:00:00 docker-containerd-shim 069db46cca05d43c35f05ff50aaa836507cbf69e4e3d9443b6b859d0edb5b076 /var/run/docker/libcontainerd/069db46cca05d43c35f05ff50aaa836507cbf69e4e3d9443b6b859d0edb5b076 docker-runc
stephane 5520 1741 0 22:17 pts/0 00:00:00 grep docker
So I looked up for anything docker in all these files, but found nothing named docker:
$ cd /etc/init.d/
[stephane#stephane-ThinkPad-X301 init.d]
$ grep.sh docker
[stephane#stephane-ThinkPad-X301 init.d]
This docker process is there every time I start my laptop, even when off line.
What starts this docker process ?
Lubuntu 16.04 comes with systemd by default. At some point you must have started up a jenkins instance in docker - it's hard to tell exactly what started the process initially. However, systemd would be what is currently causing it to start. In order to stop it from running, run the following commands:
systemctl status docker <- Find out of systemctl thinks docker is running.
It'll likely show something like this:
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2017-05-21 22:59:46 EDT; 1 day 17h ago
Docs: http://docs.docker.com
Main PID: 1314 (dockerd-current)
Tasks: 14 (limit: 8192)
CGroup: /system.slice/docker.service
└─1314 /usr/bin/dockerd-current --add-runtime oci=/usr/libexec/docker/docker-runc-current --default-runtime=oci --containerd /run/containerd.sock --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-current --selinux-enabled --log-driver=journald
To stop it, run systemctl stop docker and then systemctl disable docker. As a last resort if this doesn't work, you can run systemctl mask docker.
Docker is being started by systemd in your environment. You can disable the entire engine by running:
sudo systemctl disable docker
sudo systemctl stop docker
You can also stop only the container that is running (the shim and Jenkins application):
sudo docker ps # lists the running containers along with their container id
sudo docker update --restart=no $container_id
sudo docker stop $container_id
If you know that you do not need this container and want to permanently delete it, you can run this instead of the above two last commands:
sudo docker rm -f $container_id
The -f switch also stops the container if it's currently running.
Edit: from your comment, your container is running under swarm mode which is redeploying it. To stop that first find the stack or service that is running it.
sudo docker stack ls
sudo docker service ls
If you see a stack listed, you can remove that with:
sudo docker stack rm $stack_name
If there are no stacks listed, or they don't apply to this container, you can delete the service with:
sudo docker service rm $service_name

Cannot access apiserver on kubernetes v1.2.0

Tried installing kubernetes v1.2.0 on azure environment but after installation cannot access kube apis at port 8080.
Following services are running :
root 1473 0.2 0.5 536192 42812 ? Ssl 09:22 0:00 /home/weave/weaver --port 6783 --name 22:95:7a:6e:30:ed --nickname kube-00 --datapath datapath --ipalloc-range 10.32.0.0/12 --dns-effective-listen-address 172.17.42.1 --dns-listen-address 172.17.42.1:53 --http-addr 127.0.0.1:6784
root 1904 0.1 0.2 30320 20112 ? Ssl 09:22 0:00 /opt/kubernetes/server/bin/kube-proxy --master=http://kube-00:8080 --logtostderr=true
root 1907 0.0 0.0 14016 2968 ? Ss 09:22 0:00 /bin/bash -c until /opt/kubernetes/server/bin/kubectl create -f /etc/kubernetes/addons/; do sleep 2; done
root 1914 0.2 0.3 35888 22212 ? Ssl 09:22 0:00 /opt/kubernetes/server/bin/kube-scheduler --logtostderr=true --master=127.0.0.1:8080
root 3129 2.2 0.3 42488 25192 ? Ssl 09:27 0:00 /opt/kubernetes/server/bin/kube-controller-manager --master=127.0.0.1:8080 --logtostderr=true
curl -v http://localhost:8080 returns error
Rebuilt URL to: http://localhost:8080/
Trying 127.0.0.1...
connect to 127.0.0.1 port 8080 failed: Connection refused
Failed to connect to localhost port 8080: Connection refused
Closing connection 0 curl: (7) Failed to connect to localhost port 8080: Connection refused
Same works fine with v1.1.2.
I'm using following guidelines https://github.com/kubernetes/kubernetes/tree/master/docs/getting-started-guides/coreos/azure and updated line https://github.com/kubernetes/kubernetes/blob/master/docs/getting-started-guides/coreos/azure/cloud_config_templates/kubernetes-cluster-main-nodes-template.yml#L187 to user version v1.2.0.
The services you show running do not include the apiserver. For a quick breakdown I can explain what each service does that you show running.
Weave: This is a software overlay network and assigns IP addresses to your pods.
kube-proxy: This runs on your worker nodes allow pods to run and route traffic between exposed services.
kubectl create: Kubectl is actually the management cli tool but in this case using -f /etc/kubernetes/addons/; sleep 2 is watching the /etc/kubernetes/addons/ folder and automatically creating any objects (pods, replication controllers, services, etc.) that are put in that folder.
kube-scheduler: Responsible for scheduling pods onto nodes. Uses policies and rules.
kube-controller-manager: Manages the state of the cluster by always making sure the current state and desired state are the same. This includes starting/stopping pods and creating objects (services, replication-controllers, etc) that do not yet exist or killing them if they shouldn't exist.
All of these services interact with the kube-apiserver which should be a separate service that coordinates all of the information these other services use. You'll need the apiserver running in order for all of the other components to do their jobs.
I won't go into the details of getting it running in your environment but from it looks like in the comments on your original thread you found some missing documentation to get it running.

Selenium 2.45 with Firefox 35.0.1 not working in production only

I am using Selenium 2.45 with Firefox 35.0.1 headless browser. Things are fine in dev and test environment, but in production, I am getting error.
Driver info: driver.version: FirefoxDriver
org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(/usr/bin/firefox) on port 7055; process output follows:
Xlib: extension "RANDR" missing on display ":1".
process 20275: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/var/lib/dbus/machine-id": No such file or directory
See the manual page for dbus-uuidgen to correct this issue.
D-Bus not built with -rdynamic so unable to print a backtrace
Xlib: extension "RANDR" missing on display ":1".
process 20300: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/var/lib/dbus/machine-id": No such file or directory
See the manual page for dbus-uuidgen to correct this issue.
D-Bus not built with -rdynamic so unable to print a backtrace
Build info: version: '2.45.0', revision: '5017cb8e7ca8e37638dc3091b2440b90a1d8686f', time: '2015-02-27 09:10:26'
System info: host: 'prod', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-431.1.2.0.1.el6.x86_64', java.version: '1.7.0_65'
Production Environment:
1) Downloaded firefox-35.0.1
[prod#prod ~]$ ls /usr/local/
bin etc firefox firefox-35.0.1.tar.bz2 games include lib lib64 libexec sbin share src
2) soft linked to /usr/bin/firefox
[prod#prod ~]$ ll /usr/bin/firefox
lrwxrwxrwx 1 root root 26 Jun 11 15:59 /usr/bin/firefox -> /usr/local/firefox/firefox
[prod#prod ~]$
3) Ran Xvfb
[prod#prod ~]$ ps ax |grep Xvfb
15425 ? S 0:00 sudo Xvfb +extension RANDR :1 -screen 0 1024x768x24
15426 ? S 0:00 Xvfb +extension RANDR :1 -screen 0 1024x768x24
23102 pts/6 S+ 0:00 grep Xvfb
Test Environment:
[root#vc-stage ~]# ll /usr/bin/firefox
lrwxrwxrwx 1 root root 26 May 24 21:32 /usr/bin/firefox -> /usr/local/firefox/firefox
[root#stage ~]#
[root#stage ~]# ls /usr/local/
bin etc firefox firefox-35.0.1.tar.bz2 games include lib lib64 libexec sbin share src
[root#stage ~]#
[root#stage ~]# ps ax | grep Xvfb
3899 pts/5 S+ 0:00 grep Xvfb
27393 ? S 0:01 Xvfb +extension RANDR :1 -screen 0 1024x768x24
[root#stage ~]#
The only difference between test and prod is; in test I am running everything from a root user. In prod, I am running by a sudo user.
Update: The error message is gone without any changes whatsoever, Duh. Now, it is simply not creating the firefox Driver.
Everything was all right. 1 package was missing in production- "dbus". After installing and configuring the package, everything worked fine.

Unable to stop Tomcat

I am very new to Tomcat and just configured my tomcat with jprofiler. But now unable to stop tomcat server, getting the following error message.
[root#localhost bin]# service tomcat stop
Stopping .
Using CATALINA_BASE: /data/applications/apache-tomcat-6.0.26
Using CATALINA_HOME: /data/applications/apache-tomcat-6.0.26
Using CATALINA_TMPDIR: /data/applications/apache-tomcat-6.0.26/temp
Using JRE_HOME: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0
Using CLASSPATH: /data/applications/apache-tomcat-6.0.26/bin/bootstrap.jar
JProfiler> Protocol version 35
JProfiler> Using JVMTI
JProfiler> JVMTI version 1.1 detected.
JProfiler> 32-bit library
JProfiler> Listening on port: 8849.
JProfiler> Instrumenting native methods.
JProfiler> Can retransform classes.
JProfiler> Can retransform any class.
JProfiler> Native library initialized
JProfiler> VM initialized
JProfiler> Waiting for a connection from the JProfiler GUI ...
JProfiler> ERROR: Could not bind socket.
\n\nTomcat has shutdown
I am not sure what is wrong in my configuration and yes firewall is disabled on the box.
[root#localhost bin]# service iptables status
Firewall is stopped.
In order to find tomcat PID run:
ps -ef | grep tomcat
then use this command:
kill -9 PID
Or in one command:
kill -9 $(ps -ef | grep tomcat | grep -v "grep" | awk '{print $2}')
Another thing, you might have a watchdog running that keeps bringing tomcat back up - in such case you'll want to turn off (or kill) the watchdog as well
You have inserted VM parameters for loading the JProfiler agent in your tomcat script. The JProfiler agent expects to be able to listen for incoming connections on a specific port (by default 8849). The port is already in use by the running Tomcat. When you start the tomcat script again, the initialization of the JVM fails because the profiling agent could not be initialized.
You would have to remove the JVM parameter -agentlib:[path to jprofilerti.dll] from your tomcat start script or make it conditional so that it is not applied for the "stop" command.
As per the Tomcat documentation, you can defined a PID file which is supposed to store the Process ID of Tomcat.
Create a shell script "setenv.sh" in Tomcat bin directory.
This file is referenced in catalina.sh, so it should have exactly the same name.
You can just have the tomcat pid information in "setenv.sh". Something like below..
#!/bin/bash
CATALINA_PID="$CATALINA_BASE/bin/catalina.pid"
With the above step, tomcat will look for a file named as "catalina.pid" in its bin directory. So just create it.
You're done. Just don't forget to stop tomcat with -force option.
./shutdown.sh -force
The force option tells tomcat to kill tomcat by PID, if it's not able to stop within given time.

Resources