nkaul / pdsh

Automatically exported from code.google.com/p/pdsh
GNU General Public License v2.0
0 stars 0 forks source link

pdsh hangs on creating a daemon process #8

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I am trying to use pdsh to startup a hiphop server in daemon mode. I see that 
pdsh hangs on the issuing machine.

If I shutdown hiphop on the target machine, through other means, pdsh shuts 
down on the issuing machine.

As a workaround I am using the '-u' option to timeout after 10 seconds. But 
this is error-prone.

If you can give me reasons why this is happening (created process not shutting 
down file descriptors etc) I can fix this on hiphop.

I would really appreciate any pointers.
-- Param

Original issue reported on code.google.com by param.po...@gmail.com on 28 Jan 2011 at 2:03

GoogleCodeExporter commented 8 years ago
What I assume is happening is that the server you are starting with pdsh
is not closing stdout/stderr/stdin, so the ssh connection started by pdsh
remains open and pdsh does not exit.

You can test this by running 

 ssh -2 -a -x -l<user> <host> <server-start>

and verify that ssh does not exit.

Another thing you can try is wrapping your daemon in a script that first
closes stdin/stderr/stdout, e.g. maybe something like this?

 #!/bin/bash
 exec >/dev/null 2>&1
 exec </dev/null
 /etc/init.d/server start

If this is the case, then the hiphop server is failing to close all fds when it
daemonizes I would guess.

Original comment by mark.gro...@gmail.com on 28 Jan 2011 at 3:53

GoogleCodeExporter commented 8 years ago
Assuming this was not a bug and that the above solution worked.

Original comment by mark.gro...@gmail.com on 1 Mar 2011 at 10:13

GoogleCodeExporter commented 8 years ago
yep it is an issue with hiphop, it doesnt close fds.
thanks
Param

Original comment by param.po...@gmail.com on 2 Mar 2011 at 5:06