Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am currently running a SunOS 5.9 machine as a web server. It runs several apache instances, each with its own config file. I specify the config file using the -f command-line option.

What I want to do is to check, at any time, what apaches are running and with what config files. The problem is that running ps only gets me 126 characters per line, which is not enough for me to know the file.

Is there any way around this? A way around the 126-character limit would be nice, but if there's another way to get the config file from a running httpd process, that works as well.

Thanks!

EDIT: Alright, so I'm dumb and hadn't been able to find any explanations on this until now. It turns out ps on solaris truncates the arguments to 80 chars. Any idea on how would I go about getting the full arguments? Or knowing what's running?

share|improve this question
    
As per davey's and hayalci's suggestions, I was able to use /usr/ucb/ps wwwaux, but it still cuts my output. The funny thing is that if I use "/usr/ucb/ps x" I get less characters on each line, but the lines are STILL cut! Like so: [ webadmin@machine ~ ] /usr/ucb/ps wwwaux webadmin 14553 0.0 0.2 8856 1896 ? S Dec 04 0:03 /projects/usr/httpd2/bin/httpd -d /projects/usr/www/myproj1 -f /projects/usr/ww [ webadmin@machine ~ ] /usr/ucb/ps x 14553 ? S 0:03 /projects/usr/httpd2/bin/httpd -d /projects/usr/www/myp So it doesn't seem like a char limit in the output of ps. Weird. –  malvim Dec 10 '09 at 12:54
    
Damn, output got completely messed up. Sorry about that. :/ –  malvim Dec 10 '09 at 12:55
add comment

3 Answers

up vote 2 down vote accepted

The command:

/usr/ucb/ps wwwaux

only prints the full command if it is run as root. Add sudo to the front of that or switch to root and it should work as expected.

share|improve this answer
    
Why, I'd never had guessed that... Thanks for the help! –  malvim Dec 10 '09 at 16:20
add comment

To use "www" you will need to ensure you use the BSD "ps" command from /usr/ucb:

/usr/ucb/ps wwwaux
share|improve this answer
add comment

Try givin 'w' option to ps (optionally, multiple times)

ps www
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.