Translate

Thursday, November 20, 2014

How to get PID of SUN webserver instance on SOLARIS


Get PID on Sun Web Server





Unix - Solaris/Linux/HP-UX/AIX


On these platforms, the Web Server uses three processes:

·         A watchdog process

·         A parent Server process - webservd or ns-httpd

·         A child Server process - webservd or ns-httpd

The Worker process is the child Server process.

This can be found with the following commands:

#ps -ef | grep wdog

#ptree <pid of wdog> (Solaris and HP-UX)
#pstree <pid of wdog> (Linux)
#proctree <pid of wdog> (AIX)


The last webservd or ns-httpd process in the list is the process required.

For example, on Solaris this would be:

# ps -ef | grep wdog 
root  3878     1   0   Jul 18 ?           0:01 webservd-wdog -d /prods/web/709/admin-server/config -r /prods/web/709 -t /tmp/a
root  5510     1   0 12:02:39 ?           0:00 webservd-wdog -d /prods/web/709/https-web.com/config -r /prods/web/709

Use the Instance not the Admin Server:

# ptree 5510
5510  webservd-wdog -d /prods/web/709/https-web.com/config -r /prods/web/709
5511  webservd -d /prods/web/709/https-web.com/config -r /prods/web/709 -t /t
5512  webservd -d /prods/web/709/https-web.com/config -r /prods/web/709 -t /t

The correct PID would be '5512'.


On Windows


Windows only has a watchdog process and one Server process. So the process required is the single Server process.

Proxy Server

Proxy Server uses the same process structure as Web Server. Therefore:

·         On Unix the same commands will work. The Server process is called 'proxyd'.

·         on Windows it’s still the single Server process


-- Srikanth Govada

What does > /dev/null 2>&1 mean?


I remember being confused for a very long time about the trailing garbage in commands I saw in Unix systems, especially while watching compilers do their work. Nobody I asked could tell me what the funny greater-thans, ampersands and numbers after the commands meant, and search engines never turned up anything but examples of it being used without explanation. In this article I’ll explain those weird commands.





Here’s an example command:

wibble > /dev/null 2>&1


Output redirection

The greater-thans (>) in commands like these redirect the program’s output somewhere. In this case, something is being redirected into /dev/null, and something is being redirected into&1.


Standard in, out, and error

There are three standard sources of input and output for a program. Standard input usually comes from the keyboard if it’s an interactive program, or from another program if it’s processing the other program’s output. The program usually prints to standard output, andsometimes prints to standard error. These three file descriptors (you can think of them as “data pipes”) are often called STDIN, STDOUT, and STDERR.

Sometimes they’re not named, they’re numbered! The built-in numberings for them are 0, 1, and 2, in that order. By default, if you don’t name or number one explicitly, you’re talking about STDOUT.

Given that context, you can see the command above is redirecting standard output into/dev/null, which is a place you can dump anything you don’t want (often called the bit-bucket), then redirecting standard error into standard output (you have to put an & in front of the destination when you do this).

The short explanation, therefore, is “all output from this command should be shoved into a black hole.” That’s one good way to make a program be really quiet!


-- Srikanth Govada

Expand or Add Virtual BOX Storage

C:\Program Files\Oracle\VirtualBox>VBoxManage.exe list hdds

UUID: 9caf05d3-6ec6-4727-9ca1-50b55652e17c
Parent UUID: base
State: created
Type: normal (base)
Location: C:\Users\g800077\VirtualBox VMs\Oracle Enterprise Linux 6.4\Orac
le Enterprise Linux 6.4.vdi
Storage format: VDI
Capacity: 12288 MBytes

C:\Program Files\Oracle\VirtualBox>VBoxManage.exe modifyhd --resize 16240 9caf05

d3-6ec6-4727-9ca1-50b55652e17c
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

 Reference :

https://www.virtualbox.org/manual/ch08.html#vboxmanage-modifyvdi


-- Srikanth Govada