From: Koichi S. <koi...@gm...> - 2013-01-09 08:40:42
|
Yes, we have a similar problem using gtm_ctl with ssh. And this happens in pg_ctl as well. ssh hostxx pg_ctl start -Z coordinator -D somedirs won't return either. As you suggested, we have to redirect stdout/stderr explicitly. I think I can fix this problem for gtm_ctl by taking care of stdout/stderr. But I don't think I should do the same thing to pg_ctl. Regards; ---------- Koichi Suzuki 2013/1/9 Nikhil Sontakke <ni...@st...>: > Hi Suzuki-san, > > > >> >> 1. i=$(pg_ctl start -Z coordinator -D ./coord) does not return. >> gtm_ctl behaves similarly as pg_ctl. > > > Yeah, that seems to be the case with latest PostgreSQL as well. > > However, one difference is if you just use the command without assigning > into a variable in a shell script. Like: > > cat /tmp/h.sh > > ./install/bin/pg_ctl -D install/data start > echo "done" > > The above shell script exits properly. > > However the use of gtm_ctl similarly does not cause the script to exit and > that's the problem. > > Regards, > Nikhils >> >> 2. I inserted setsid() to gtm code and ran i=$(gtm_ctl start -Z gtm -D >> ./gtm). It didn't return. No improvement so far. >> 3. In addition to 2, I added codes to close both stdout and stderr >> before setsid(). This worked well. >> >> I think the issue you reported is common to pg_ctl. Setsid() has >> nothing to do with stdout/stderr handling at daemonization. Of >> course, you can detach stdout/stderr from tty as Nikhil reported. >> >> So I'd like inputs on whether gtm_ctl start should return, which is >> different from pg_ctl. >> >> I think similar behavior of gtm_ctl to pg_ctl is acceptable. >> >> Regards; >> ---------- >> Koichi Suzuki >> >> >> 2012/12/6 Michael Meskes <me...@po...>: >> > Hi, >> > >> > any idea why gtm_ctl hangs when its output get redirected into a >> > variable like >> > this? >> > >> > i=$(/usr/bin/gtm_ctl start -D /var/lib/postgres-xc/gtm -Z gtm) >> > >> > Looks like a problem with output device handling. gtm is indeed started >> > correctly. Same kind of redirection works nicely with other commands >> > like >> > pg_ctl. I don't feel like debugging gtm right now, maybe you guys know. >> > >> > Michael >> > -- >> > Michael Meskes >> > Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) >> > Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org >> > Jabber: michael.meskes at gmail dot com >> > VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL >> > >> > >> > ------------------------------------------------------------------------------ >> > LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial >> > Remotely access PCs and mobile devices and provide instant support >> > Improve your efficiency, and focus on delivering more value-add services >> > Discover what IT Professionals Know. Rescue delivers >> > http://p.sf.net/sfu/logmein_12329d2d >> > _______________________________________________ >> > Postgres-xc-developers mailing list >> > Pos...@li... >> > https://lists.sourceforge.net/lists/listinfo/postgres-xc-developers >> >> >> ------------------------------------------------------------------------------ >> Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery >> and much more. Keep your Java skills current with LearnJavaNow - >> 200+ hours of step-by-step video tutorials by Java experts. >> SALE $49.99 this month only -- learn more at: >> http://p.sf.net/sfu/learnmore_122612 >> >> _______________________________________________ >> Postgres-xc-developers mailing list >> Pos...@li... >> https://lists.sourceforge.net/lists/listinfo/postgres-xc-developers > > > > > -- > StormDB - http://www.stormdb.com > The Database Cloud > Postgres-XC Support and Service |