Thread: [Refdb-users] refdbctl do not stop deamon
Status: Beta
Brought to you by:
mhoenicka
|
From: Wei-Wei G. <ww...@gm...> - 2009-05-09 03:34:52
|
Hi Markus, I got a new problem. refdbctl can start daemon, but cannot stop it. # ps -C refdbd PID TTY TIME CMD 2860 ? 00:00:00 refdbd 3255 ? 00:00:00 refdbd # refdbctl stop /usr/bin/refdbctl stop: /usr/bin/refdbd is not running Am I do anything wrong? Best wishes, Wei-Wei |
|
From: Markus H. <mar...@mh...> - 2009-05-11 06:49:38
|
Quoting Wei-Wei Guo <ww...@gm...>: > # refdbctl stop > /usr/bin/refdbctl stop: /usr/bin/refdbd is not running > > Am I do anything wrong? > Not necessarily. It might be a permission problem or a parsing problem of the grep output as well. After starting refdbd using refdbctl, do you see a file called "refdbd.pid" in /var/run/? If yes, could you please post the contents? Please also check the setting of the "pidfile" variable in your refdbdrc. It should have the value "/var/run/refdbd.pid" as well. regards, Markus -- Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |
|
From: Wei-Wei G. <ww...@gm...> - 2009-05-11 07:40:19
|
Markus Hoenicka 写道: >> # refdbctl stop >> /usr/bin/refdbctl stop: /usr/bin/refdbd is not running >> >> Am I do anything wrong? >> > > Not necessarily. It might be a permission problem or a parsing problem > of the grep output as well. After starting refdbd using refdbctl, do you > see a file called "refdbd.pid" in /var/run/? If yes, could you please > post the contents? There is only one line in /var/run/refdbd.pid: 2908 It is the PID of refdbd. $ ps -C refdbd PID TTY TIME CMD 2908 ? 00:00:00 refdbd > Please also check the setting of the "pidfile" > variable in your refdbdrc. It should have the value > "/var/run/refdbd.pid" as well. > Here is the 'pidfile' line in refdbdrc: pidfile /var/run/refdbd.pid Best wishes, Wei-Wei |
|
From: Markus H. <mar...@mh...> - 2009-05-11 08:18:30
|
Quoting Wei-Wei Guo <ww...@gm...>: > There is only one line in /var/run/refdbd.pid: > > 2908 > > It is the PID of refdbd. > > $ ps -C refdbd > PID TTY TIME CMD > 2908 ? 00:00:00 refdbd > > >> Please also check the setting of the "pidfile" variable in your >> refdbdrc. It should have the value "/var/run/refdbd.pid" as well. >> > > Here is the 'pidfile' line in refdbdrc: > > pidfile /var/run/refdbd.pid > > Thanks for running these tests. Both look ok, so I'm entirely clueless why the script fails on your box. refdbctl uses two shell commands to isolate the process ID from the ps output and from the PID file. Maybe one of these commands fails on your box. Could you please test those shell commands manually? You'll have to replace two variables with their real values, like this (using the values "2908" as the PID and "/var/run/refdbd.pid" as the full path of the PID file in this example): cat /var/run/refdbd.pid|sed 's/^ *\([0-9]*\).*/\1/' and ps ax | grep -i "^ *2908.*[r]efdbd" | sed 's/^ *\([0-9]*\).*/\1/' Both commands should return the process ID, i.e. "2908" in this example. regards, Markus -- Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |
|
From: Wei-Wei G. <ww...@gm...> - 2009-05-11 08:42:37
|
Markus Hoenicka 写道: > Thanks for running these tests. Both look ok, so I'm entirely clueless > why the script fails on your box. refdbctl uses two shell commands to > isolate the process ID from the ps output and from the PID file. Maybe > one of these commands fails on your box. Could you please test those > shell commands manually? You'll have to replace two variables with their > real values, like this (using the values "2908" as the PID and > "/var/run/refdbd.pid" as the full path of the PID file in this example): > > cat /var/run/refdbd.pid|sed 's/^ *\([0-9]*\).*/\1/' > > and > > ps ax | grep -i "^ *2908.*[r]efdbd" | sed 's/^ *\([0-9]*\).*/\1/' > > Both commands should return the process ID, i.e. "2908" in this example. > Is this what you mean? $ ls /var/run/refdb* /var/run/refdbd.pid $ ps -C refdbd PID TTY TIME CMD 2904 ? 00:00:00 refdbd $ cat /var/run/refdbd.pid|sed 's/^ *\([0-9]*\).*/\1/' 2904 $ ps ax | grep -i "^ *2904.*[r]efdbd" | sed 's/^ *\([0-9]*\).*/ 1/' 2904 Best wishes, Wei-Wei |
|
From: Markus H. <mar...@mh...> - 2009-05-11 09:13:43
|
Quoting Wei-Wei Guo <ww...@gm...>: > Is this what you mean? > > $ ls /var/run/refdb* > /var/run/refdbd.pid > > $ ps -C refdbd > PID TTY TIME CMD > 2904 ? 00:00:00 refdbd > > $ cat /var/run/refdbd.pid|sed 's/^ *\([0-9]*\).*/\1/' > 2904 > > $ ps ax | grep -i "^ *2904.*[r]efdbd" | sed 's/^ *\([0-9]*\).*/ 1/' > 2904 > Thanks again. Both commands work as expected. Therefore the script should work as well. Can you still reproduce the script failure? Also, which shell did you use for these tests, i.e. what is your login shell? If it is not bash, you may try repeating the above tests using bash: type "bash" at your prompt, repeat the above tests, and type exit again to return to your login shell. If that should give different results, try editing the first line of refdbctl (something like "#!/usr/bin/bash") and make it point to your login shell. regards, Markus -- Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |
|
From: Wei-Wei G. <ww...@gm...> - 2009-05-11 09:44:30
|
Markus Hoenicka 写道: > Thanks again. Both commands work as expected. Therefore the script > should work as well. Can you still reproduce the script failure? Also, > which shell did you use for these tests, i.e. what is your login shell? > If it is not bash, you may try repeating the above tests using bash: > type "bash" at your prompt, repeat the above tests, and type exit again > to return to your login shell. If that should give different results, > try editing the first line of refdbctl (something like > "#!/usr/bin/bash") and make it point to your login shell. > I opened /usr/bin/refdbctl and happened to find the problem. the script refdbctl set PIDFILE to: PIDFILE='/var/lib/run/refdbd.pid' instead of PIDFILE='/var/run/refdbd.pid' After changing the variable, the refdbd can be stopped correctly. It seems refdbctl doesn't use the variable set in refdbdrc. Thanks for help! Best wishes, Wei-Wei |
|
From: Markus H. <mar...@mh...> - 2009-05-11 09:50:15
|
Quoting Wei-Wei Guo <ww...@gm...>: > After changing the variable, the refdbd can be stopped correctly. It seems > refdbctl doesn't use the variable set in refdbdrc. > Ah, I see. I'll try to fix this asap. regards, Markus -- Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |
|
From: Markus H. <mar...@mh...> - 2009-05-13 20:07:07
|
Markus Hoenicka writes: > Quoting Wei-Wei Guo <ww...@gm...>: > > > After changing the variable, the refdbd can be stopped correctly. It seems > > refdbctl doesn't use the variable set in refdbdrc. > > > > Ah, I see. I'll try to fix this asap. > I've checked in a patch which fixes this problem, see revision 675. regards, Markus -- Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |
|
From: Wei-Wei G. <ww...@gm...> - 2009-05-14 02:03:10
|
Markus Hoenicka 写道: > > I've checked in a patch which fixes this problem, see revision 675. > Thanks a lot! Best wishes, Wei-Wei |