From: Ricardo J. B. <ric...@da...> - 2011-03-03 22:34:01
|
El Jue 03 Marzo 2011, Thomas S Hatch escribió: > Thats some fine lsof skills you have there, Not really, I'm a quick reader and skimmed through 'man lsof' (check the second version in another mail!!). > although I am going to argue that pidof is simpler, and it should be less > intrusive, since lsof needs to read in the table of open file descriptors: > > pidof -o %PPID -x /usr/sbin/mfsmaster Well, acording to time your pidof version is consistenly three times faster than my last lsof version, so this one wins :) In my defense, I said it was a dirty way!! :P Cheers. > On Thu, Mar 3, 2011 at 3:22 PM, Ricardo J. Barberis < > > ric...@da...> wrote: > > El Jue 03 Marzo 2011, Giovanni Toraldo escribió: > > > Il 03/03/2011 11:20, Michal Borychowski ha scritto: > > > > Hi! > > > > > > > > Please have a look at these two answers: > > > > http://www.moosefs.org/moosefs-faq.html#master-pid > > > > > > Uh, there isn't something more scripting friendly? :P > > > > Quick and dirty if you're on Linux (watch out for line-wrapping): > > > > lsof -X -n | grep $(awk '/^DATA_PATH/ {print $NF}' > > /etc/mfs/mfsmaster.cfg)/.mfsmaster.lock | awk '{print $2}' > > > > > Every daemon that forks in background should write a PID somewhere, why > > > mfs did not, even inside the lock file? -- Ricardo J. Barberis Senior SysAdmin / ITI Dattatec.com :: Soluciones de Web Hosting Tu Hosting hecho Simple! |