dmytro / nagira

NAGIos Restful Api
MIT License
76 stars 13 forks source link

get_pid() does not return the current pid #28

Closed talgo10 closed 9 years ago

talgo10 commented 10 years ago

OS: Red Hat 4.4.7-3

when run: /etc/init.d/nagira status it always returns the service is not running

it seems the following command need some fix: echo $(ps -C ruby -o pid,cmd | awk '$2 ~ /^\/usr.bin\/nagira $/ {print $1}')

dmytro commented 10 years ago

@golanet Could you please give output of ps -C ruby -o pid,cmd on you host.

talgo10 commented 10 years ago

" PID CMD" it seems the process is running without related tty so when i run : ps -C ruby -o pid,cmd -> i get only from current tty. When I added the flag '-t ?' - i got the needed list. check this: ps -C ruby -o pid,cmd -t ?

dmytro commented 10 years ago

@golanet I cannot reproduce this. In my case I always get list of all Ruby processes running. I've tried doing the same over ssh -T, with same result.

But with -t ? I get list of all processes running on the system, not just Ruby.

What is your Ruby installation? or any other hints helping to understand the problem?

I'm testing on CentOS 6.3

talgo10 commented 10 years ago

@dmytro I'm running ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux] it seems it doesn't work on my side cause the process of nagira is not related to ruby so the flag '-C ruby' returns an empty list..

last check tested on RHEL 6.5 and 6.4

dmytro commented 9 years ago

Cannot reproduce. Tried on CentOS 6.3, 6.5