Sponsored Content
Full Discussion: How to get jboss pid?
Operating Systems Linux Red Hat How to get jboss pid? Post 302447609 by pbsdis on Monday 23rd of August 2010 08:14:11 PM
Old 08-23-2010
How to get jboss pid?

I am writing SSH (actually Python via SSH) commandline to get jboss PID from a remote machine (Redhat), how can I do it?

I usually have the patten like:

run('some_linux_command')

What should be 'some_linux_comand' be here?

I also tried a shell script (I found in internet) local on the machine

Quote:
#!/bin/sh
PID=$(ps -eo pid,comm | awk '$2=="jboss" {print $2}')
echo $PID
if [ -z "$PID"]; then
echo No Jboss running
else
echo All done
fi
But it return nothing, while I used 'ps -ef | grep jboss' returned information with the PID.

Any idea?
 

10 More Discussions You Might Find Interesting

1. Programming

printing ppid,child pid,pid

question: for the below program i just printed the value for pid, child pid and parent pid why does it give me 6 values? i assume ppid is 28086 but can't figure out why there are 5 values printed instead of just two! can someone comment on that! #include<stdio.h> #define DIM 8 int... (3 Replies)
Discussion started by: a25khan
3 Replies

2. UNIX for Dummies Questions & Answers

Session PID & socket connection pid

1. If I use an software application(which connects to the database in the server) in my local pc, how many PID should be registered? Would there be PID for the session and another PID for socket connection? 2. I noticed (through netstat) that when I logged in using the my software application,... (1 Reply)
Discussion started by: pcx26
1 Replies

3. UNIX for Advanced & Expert Users

jboss and websphere monitoring scripts for hobbit

HI, A very good morning.... i need extensions/plugins for monitoring jboss and websphere for hobbit.. kindly if any one has the ext. or associated scripts pls send me the script or the link from where i can download the scripts(and any dependency for those scripts). Await ur reply.. ... (0 Replies)
Discussion started by: suvra
0 Replies

4. UNIX for Dummies Questions & Answers

Need to get pid of a process and have to store the pid in a variable

Hi, I need to get the pid of a process and have to store the pid in a variable and i want to use this value(pid) of the variable for some process. Please can anyone tell me how to get the pid of a process and store it in a variable. please help me on this. Thanks in advance, Amudha (7 Replies)
Discussion started by: samudha
7 Replies

5. Red Hat

JBoss Application Server 5 CR1 available

The first candidate release (CR1) for JBoss Application Server 5 has been released. There is a lot of good background from Sacha Labourey and feature details from project lead Dimitris Andreadis. Now that version 5 of the new application server has been through alpha and beta stages, this... (0 Replies)
Discussion started by: Linux Bot
0 Replies

6. AIX

Creating startup service for JBoss

Hello Friends, Does anyone know how to create a startup script for Jboss on IBM AIX 5.3? Please help me, I'd be highly grateful to you... Thanks & Regards, Vinit (0 Replies)
Discussion started by: vpatil6688
0 Replies

7. AIX

Installing jboss on aix

Hi, anybody knows how to configure and install jboss on aix. Regards, Manoj (1 Reply)
Discussion started by: manoj.solaris
1 Replies

8. UNIX and Linux Applications

Jboss Stop Issue

Hello Everybody, I have recently setup a Jboss-4.2.3 server in a RHEL machine.I copied the "/etc/init.d/jboss" script from another Jboss server and added the same to chkconfig. When i run - "service jboss start" - the Jboss server starts fine. However when i run - "service jboss stop" - it... (1 Reply)
Discussion started by: Hari_Ganesh
1 Replies

9. Shell Programming and Scripting

Recycle Jboss server script

Hello, I need help writing a script to restart our Jboss server when it crashes. I am not very good with scripting but here is the basics. 1) I'm hoping to use KornShell 2) The command to stop the Jboss is "/var/opt/HP/ALM/jboss/bin/run.sh stop" 3) I want to verify the jboss is stopped before... (1 Reply)
Discussion started by: Blogger11
1 Replies

10. Web Development

Starting Web Application on Jboss

Hello, I installed Jboss EAP 6 on a remote Linux server in standalone mode, and deployed a HelloWorld war file successfully. Opened a browser on my PC and pointed to http://127.0.0.1:8080/filename. I can see “Hello World!” on my browser. However, if the browser points to http://server's... (3 Replies)
Discussion started by: learnix
3 Replies
SHLOCK(1)						    BSD General Commands Manual 						 SHLOCK(1)

NAME
shlock -- create or verify a lock file for shell scripts SYNOPSIS
shlock [-du] [-p PID] -f lockfile DESCRIPTION
The shlock command can create or verify a lock file on behalf of a shell or other script program. When it attempts to create a lock file, if one already exists, shlock verifies that it is or is not valid. If valid, shlock will exit with a non-zero exit code. If invalid, shlock will remove the lock file, and create a new one. shlock uses the link(2) system call to make the final target lock file, which is an atomic operation (i.e. "dot locking", so named for this mechanism's original use for locking system mailboxes). It puts the process ID ("PID") from the command line into the requested lock file. shlock verifies that an extant lock file is still valid by using kill(2) with a zero signal to check for the existence of the process that holds the lock. The -d option causes shlock to be verbose about what it is doing. The -f argument with lockfile is always required. The -p option with PID is given when the program is to create a lock file; when absent, shlock will simply check for the validity of the lock file. The -u option causes shlock to read and write the PID as a binary pid_t, instead of as ASCII, to be compatible with the locks created by UUCP. EXIT STATUS
A zero exit code indicates a valid lock file. EXAMPLES
BOURNE SHELL #!/bin/sh lckfile=/tmp/foo.lock if shlock -f ${lckfile} -p $$ then # do what required the lock rm ${lckfile} else echo Lock ${lckfile} already held by `cat ${lckfile}` fi C SHELL #!/bin/csh -f set lckfile=/tmp/foo.lock shlock -f ${lckfile} -p $$ if ($status == 0) then # do what required the lock rm ${lckfile} else echo Lock ${lckfile} already held by `cat ${lckfile}` endif The examples assume that the file system where the lock file is to be created is writable by the user, and has space available. HISTORY
shlock was written for the first Network News Transfer Protocol (NNTP) software distribution, released in March 1986. The algorithm was sug- gested by Peter Honeyman, from work he did on HoneyDanBer UUCP. AUTHORS
Erik E. Fair <fair@clock.org> BUGS
Does not work on NFS or other network file system on different systems because the disparate systems have disjoint PID spaces. Cannot handle the case where a lock file was not deleted, the process that created it has exited, and the system has created a new process with the same PID as in the dead lock file. The lock file will appear to be valid even though the process is unrelated to the one that cre- ated the lock in the first place. Always remove your lock files after you're done. BSD
June 29, 1997 BSD
All times are GMT -4. The time now is 12:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy