Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2899
  • Last Modified:

stop jboss server in Linux

Hi, Here I have tried to stop jboss server in Linux .  This seems does not work. Could you please tell where is the problem ?

Please find the file attached. Sensitive information has been masked.
serverstart.txt
0
cofactor
Asked:
cofactor
  • 5
  • 5
  • 4
  • +2
5 Solutions
 
enachemcCommented:
just use the kill command
kill pid

it will not kill the JBoss, just will signal it to close
JBoss will shutdown gracefully
0
 
enachemcCommented:
also, if you have multiple IPs on that server, JBoss might bind some ports only to some IP

issue a "netstat -na" and find out the listening port and IP
0
 
Abhishek_ChibCommented:
First Way to stop gracefully :

# cd  /home/jboss/bin/
# ./shutdown.sh -S

If it work then good , otherwise force stop :

Log on via root

# ps -ef | grep jboss

You will find PID

# kill -9 PID
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
enachemcCommented:
kill -9 should be the almost the last thing you try (before rebooting)
0
 
wesly_chenCommented:
/home/jboss/bin/shutdown.sh -S

Check this
http://community.jboss.org/wiki/StartStopJBoss
0
 
mohansahuCommented:
Hi,

try to Set up all the permissions and run levels like this:

sudo chown root:root /etc/init.d/jboss
sudo chmod ug+x /etc/init.d/jboss

ln -s /etc/rc.d/init.d/jboss /etc/rc3.d/S84jboss
ln -s /etc/rc.d/init.d/jboss /etc/rc4.d/S84jboss
ln -s /etc/rc.d/init.d/jboss /etc/rc5.d/S84jboss

ln -s /etc/rc.d/init.d/jboss/etc/rc6.d/K15jboss
ln -s /etc/rc.d/init.d/jboss/etc/rc0.d/K15jboss
ln -s /etc/rc.d/init.d/jboss/etc/rc1.d/K15jboss
ln -s /etc/rc.d/init.d/jboss/etc/rc2.d/K15jboss

and try to start up like :
$ /etc/init.d/./jboss start or $ /etc/init.d/./jboss stop

OR

Stopping JBoss, if you launched JBoss from the command line, the easiest way to stop it is to press ctrl-C.  JBoss should begin it's shutdown. (OR) ./shutdown.sh -S in jboss bin folder.
0
 
cofactorAuthor Commented:
>>/home/jboss/bin/shutdown.sh -S

my jboss start is a bind to host and started as a service . Is not we should stop as a service ?

>>>just use the kill command
>>kill pid

Is it not  good to stop the service  ? is there any way for that ?

Also, how do we know  the startup status when I start jboss as a service ? it does not return anything ..seems things are in the background . How do I know the startup status ?  
0
 
enachemcCommented:
look in the log files
look at boot.log - notice the timestamp
look at server.log from the timestamp of the boot.log

also ... to kill a service you might need root rights
0
 
mohansahuCommented:
Hi,

Use this following command to stop the server:-

% ./shutdown.sh --host=myremotemachineOrIP -S

Try providing your machine's ip address instead of "localhost".

and also check the boot & server logs in jboss

MS
0
 
cofactorAuthor Commented:
>>>look at boot.log - notice the timestamp
>>>look at server.log from the timestamp of the boot.log

why timestamp is required here ? I dont understand why you are telling to note the timestamp . why do I need that ?
0
 
enachemcCommented:
to see the log at the time the server started ....
0
 
wesly_chenCommented:
> root@me-helobox:~# sudo /etc/init.d/jboss stop
> JBOSS_CMD_START = cd /home/jboss/bin; /home/jboss/bin/run.sh -c default -b 10.24.5.56
Could you post
/etc/init.d/jboss
and
/home/jboss/bin/run.sh
0
 
cofactorAuthor Commented:
>>>Could you post

Yes. But I may not post the entire server details in public . Would you like to see any specific portion ?

Please tell me which portion you would like to check ..I'd copy that part and post it here.

You may tell me which Tag to copy from those files so that it would be helpful to check
0
 
wesly_chenCommented:
1. Please tye to use
/home/jboss/bin/shutdown.sh -S
to see if this typical command can stop your jboss smoothly
If not, then it could be some configuration issue in jboss;
If this way shutdown ok, then the issue is inside your script.


2. The way you stop jboss show the "JBOSS_CMD_START..."
> root@me-helobox:~# sudo /etc/init.d/jboss stop
> JBOSS_CMD_START = cd /home/jboss/bin; /home/jboss/bin/run.sh -c default -b 10.24.5.56
Then shows the error messages. It seems that there is some command/configuration in /etc/init.d/jboss or /home/jboss/bin/run.sh might cause the issue.
So it might be helpful to troubleshooting if you can provide those two scripts.
If there is confidential stuff in there, then you can examine those two scripts by yourself.
Assume those two are shell scripts. Run them with debugging information like this
# sudo sh -x /etc/init.d/jboss stop
and if it calls /home/jboss/bin/run.sh, then please add "sh -x" in front of  "/home/jboss/bin/run.sh"
0
 
cofactorAuthor Commented:
>>>>Please tye to use
>>/home/jboss/bin/shutdown.sh -S
>>to see if this typical command can stop your jboss smoothly


when I run the above I get this ..

 /home/jboss/bin/shutdown.sh -S
Exception in thread "main" java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
        java.net.ConnectException: Connection refused]
        at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:338)
        at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
        at org.jboss.Shutdown.main(Shutdown.java:235)
Caused by: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
        java.net.ConnectException: Connection refused]
        at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:101)
        at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:185)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1886)
        at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1856)
        at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:257)
        ... 2 more
Caused by: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
        java.net.ConnectException: Connection refused
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
        at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
        at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
        at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
        at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
        at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:97)
        ... 7 more
Caused by: java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:529)
        at java.net.Socket.connect(Socket.java:478)
        at java.net.Socket.<init>(Socket.java:375)
        at java.net.Socket.<init>(Socket.java:189)
        at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
        at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
        ... 12 more
0
 
cofactorAuthor Commented:
>>>ps -ef | grep jboss

This shows the list   but not formatted . Hence I find difficult to identify the jboss process id.

Could you please modify the above command so that this prints a nicely formatted  listing . This will help me to dentify the  process id for jboss and thereafter to kill this process.

I'm using putty.exe to connect to server.
0
 
wesly_chenCommented:
>  I find difficult to identify the jboss process id.
pgrep jboss

or
pkill jboss
 to kill jboss
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 5
  • 5
  • 4
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now