From: Michael M. <me...@po...> - 2012-12-06 11:16:00
|
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 |
From: Koichi S. <ko...@in...> - 2012-12-07 05:23:10
|
Hello; Okay, let me take this. Regards; --- Koichi Suzuki On Thu, 6 Dec 2012 11:57:08 +0100 Michael Meskes <me...@po...> wrote: > 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 |
From: Nikhil S. <ni...@st...> - 2012-12-13 13:15:19
|
Hi, This bit me as well. I compared pg_ctl and gtm_ctl source bases and they are almost similar in terms of the start processing and handling. I wonder why in that case gtm_ctl gets stuck when invoked from inside a script? Regards. Nikhils On Fri, Dec 7, 2012 at 10:53 AM, Koichi Suzuki <ko...@in...>wrote: > Hello; > > Okay, let me take this. > > Regards; > --- > Koichi Suzuki > > On Thu, 6 Dec 2012 11:57:08 +0100 > Michael Meskes <me...@po...> wrote: > > > 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 > > > ------------------------------------------------------------------------------ > 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 > -- StormDB - http://www.stormdb.com The Database Cloud Postgres-XC Support and Service |
From: Nikhil S. <ni...@st...> - 2012-12-14 11:34:03
|
Hi Michael, I looked a bit more into this. Looks like either the gtm_ctl binary or the gtm daemon invoked from it is not releasing stdout/stderr properly. I worked around this by detaching to /dev/null by using the following inside my script: /usr/bin/gtm_ctl -D /var/lib/postgres-xc/gtm -Z gtm start > /dev/null 2>&1 HTH, Nikhils On Thu, Dec 13, 2012 at 6:44 PM, Nikhil Sontakke <ni...@st...>wrote: > Hi, > > This bit me as well. > > I compared pg_ctl and gtm_ctl source bases and they are almost similar in > terms of the start processing and handling. I wonder why in that case > gtm_ctl gets stuck when invoked from inside a script? > > Regards. > Nikhils > > > On Fri, Dec 7, 2012 at 10:53 AM, Koichi Suzuki <ko...@in...>wrote: > >> Hello; >> >> Okay, let me take this. >> >> Regards; >> --- >> Koichi Suzuki >> >> On Thu, 6 Dec 2012 11:57:08 +0100 >> Michael Meskes <me...@po...> wrote: >> >> > 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 >> >> >> ------------------------------------------------------------------------------ >> 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 >> > > > > -- > StormDB - http://www.stormdb.com > The Database Cloud > Postgres-XC Support and Service > -- StormDB - http://www.stormdb.com The Database Cloud Postgres-XC Support and Service |
From: Michael M. <me...@po...> - 2012-12-14 13:56:56
|
Hi Nikhil, > I looked a bit more into this. Looks like either the gtm_ctl binary or the > gtm daemon invoked from it is not releasing stdout/stderr properly. This is what I guessed, too. > I worked around this by detaching to /dev/null by using the following > inside my script: > ... Yeah, but that doesn't help because it kills all output. I want to be able to store said output in a variable to display it if needed. And that of course doesn't work. 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 |
From: Nikhil S. <ni...@st...> - 2012-12-18 06:42:52
|
> Yeah, but that doesn't help because it kills all output. I want to be able > to > store said output in a variable to display it if needed. And that of course > doesn't work. > > Well, for this particular usage, output of gtm_ctl is not that helpful. It *does* not guarantee that the gtm command was succesful (similar to pg_ctl) as it just invokes the proper system command to start the server. You might want to use the "-w" option if you want gtm_ctl to wait till the successful start of the server. Regards, Nikhils -- StormDB - http://www.stormdb.com The Database Cloud Postgres-XC Support and Service |
From: Michael M. <me...@po...> - 2012-12-27 11:40:45
|
I still haven't found the time to dig into this, but could anyone please explain to me how gtm is supposed to start up? A simple grep command doesn't seem to find any call to setsid() in gtm subdirs. Could you please point me to the code where gtm daemonizes? Because if it doesn't correctly, there is no suprise gtm_ctl doesn't come back. Or in other words, this is a logical point to start looking. 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 |
From: Koichi S. <koi...@gm...> - 2012-12-27 13:48:58
|
At present, gtm does not call setsid(). Also, gtm_ctl -w option seems not work properly. Sorry I don't have a time to correct these in a high priority. I will take a look at these issue and fix at least in the next major release. Daemonization should be back-ported to 1.0.x. Kind Regards; ---------- Koichi Suzuki 2012/12/27 Michael Meskes <me...@po...>: > I still haven't found the time to dig into this, but could anyone please > explain to me how gtm is supposed to start up? A simple grep command doesn't > seem to find any call to setsid() in gtm subdirs. Could you please point me to > the code where gtm daemonizes? Because if it doesn't correctly, there is no > suprise gtm_ctl doesn't come back. Or in other words, this is a logical point > to start looking. > > 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 > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. ON SALE this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122712 > _______________________________________________ > Postgres-xc-developers mailing list > Pos...@li... > https://lists.sourceforge.net/lists/listinfo/postgres-xc-developers |
From: Ashutosh B. <ash...@en...> - 2013-01-03 10:37:03
|
On Thu, Dec 6, 2012 at 4:27 PM, Michael Meskes <me...@po...> wrote: > 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) Just to report. I am finding similar problem when gtm_ctl is invoked through ssh on some other machine. > > 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 -- Best Wishes, Ashutosh Bapat EntepriseDB Corporation The Enterprise Postgres Company |
From: Michael M. <me...@po...> - 2013-01-03 10:57:21
|
On Thu, Jan 03, 2013 at 04:06:56PM +0530, Ashutosh Bapat wrote: > Just to report. I am finding similar problem when gtm_ctl is invoked > through ssh on some other machine. I'm pretty sure this is also due to the missing daemonizing code in gtm (cf. other thread). I just haven't found the time to look into this, should be too hard to add. 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 |
From: Koichi S. <koi...@gm...> - 2013-01-09 05:03:00
|
Hello; I tested the following: 1. i=$(pg_ctl start -Z coordinator -D ./coord) does not return. gtm_ctl behaves similarly as pg_ctl. 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 |
From: Koichi S. <koi...@gm...> - 2013-01-22 02:05:01
Attachments:
gtm_ctl_start_daemonify_20130122.patch
|
Hi, This is a revised patch for gtm_ctl to return to the shell when invoked with -l option. If no objection, I'd like to commit it to the master. Regards; ---------- Koichi Suzuki 2013/1/21 Koichi Suzuki <koi...@gm...>: > Here's a patch to improve gtm_ctl behavior. Now, with -l option, > gtm_ctl returns in the shell script. I'm using several magic numbers > there. Maybe it needs improvement. > > Regards; > ---------- > Koichi Suzuki > > > 2013/1/10 Michael Meskes <me...@po...>: >> One more bit of information. I guess gtm executes DebugFileOpen() when -l is >> used. The same function is used for the -r option in postgres. But the latter >> is only for single user mode, which usually means the program is attached to a >> tty. >> >> 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 |
From: Michael M. <me...@po...> - 2013-01-22 09:30:37
|
On Tue, Jan 22, 2013 at 11:04:53AM +0900, Koichi Suzuki wrote: > This is a revised patch for gtm_ctl to return to the shell when > invoked with -l option. Looks good to me. I wonder if you could remove the second fork(). AFAIK system() calls fork again, so the system() call will give you the second fork needed. 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 |
From: Nikhil S. <ni...@st...> - 2013-01-09 08:21:00
|
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 |
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 |
From: Michael M. <me...@po...> - 2013-01-10 09:55:36
|
On Wed, Jan 09, 2013 at 05:40:35PM +0900, Koichi Suzuki wrote: > 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. I think this is a feature and not a bug. The bug just comes up when using the "-l" option to redirect output to a log file. Without this option you can argue the user wants stdout/stderr to remain open to see the messages coming from the backend. With a log file redirection stdout/stderr should be gone. This works nicely with pg_ctl as both, stdout and stderr, get redirected to the logfile. With gtm_ctl, however, only stderr gets redirected. Now the question is why... 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 |
From: Koichi S. <koi...@gm...> - 2013-01-10 10:08:31
|
Michael; Thanks for a good comment. I don't think discussing why is productive. Because gtm_ctl is expected to behave similarly to pg_ctl, if pg_ctl -l works nicely to redirect stdout/stderr with -l option, I think we should improve gtm_ctl as well. Regards; ---------- Koichi Suzuki 2013/1/10 Michael Meskes <me...@po...>: > On Wed, Jan 09, 2013 at 05:40:35PM +0900, Koichi Suzuki wrote: >> 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. > > I think this is a feature and not a bug. The bug just comes up when using the > "-l" option to redirect output to a log file. Without this option you can argue > the user wants stdout/stderr to remain open to see the messages coming from the > backend. With a log file redirection stdout/stderr should be gone. This works > nicely with pg_ctl as both, stdout and stderr, get redirected to the logfile. > With gtm_ctl, however, only stderr gets redirected. Now the question is why... > > 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 |
From: Michael P. <mic...@gm...> - 2013-01-10 10:54:10
|
On Thu, Jan 10, 2013 at 7:08 PM, Koichi Suzuki <koi...@gm...>wrote: > Michael; > > Thanks for a good comment. I don't think discussing why is > productive. Because gtm_ctl is expected to behave similarly to > pg_ctl, if pg_ctl -l works nicely to redirect stdout/stderr with -l > option, I think we should improve gtm_ctl as well. > +1. -- Michael Paquier http://michael.otacoo.com |
From: Michael M. <me...@po...> - 2013-01-10 10:22:14
|
> Thanks for a good comment. I don't think discussing why is > productive. Because gtm_ctl is expected to behave similarly to > pg_ctl, if pg_ctl -l works nicely to redirect stdout/stderr with -l > option, I think we should improve gtm_ctl as well. Good point Koichi-san. A brief look shows almost the same code again, so I guess we have to dig into it a bit more to find out what's different. 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 |
From: Koichi S. <ko...@in...> - 2013-01-10 10:33:07
|
Year, because I have finished most of long-term test and HA related issues, I think I can do this soon. Thanks for the good point. --- Koichi On Thu, 10 Jan 2013 11:22:06 +0100 Michael Meskes <me...@po...> wrote: > > Thanks for a good comment. I don't think discussing why is > > productive. Because gtm_ctl is expected to behave similarly to > > pg_ctl, if pg_ctl -l works nicely to redirect stdout/stderr with -l > > option, I think we should improve gtm_ctl as well. > > Good point Koichi-san. A brief look shows almost the same code again, so I > guess we have to dig into it a bit more to find out what's different. > > 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 > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. ON SALE this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122712 > _______________________________________________ > Postgres-xc-developers mailing list > Pos...@li... > https://lists.sourceforge.net/lists/listinfo/postgres-xc-developers |
From: Michael M. <me...@po...> - 2013-01-10 11:59:02
|
On Thu, Jan 10, 2013 at 07:33:04PM +0900, Koichi Suzuki wrote: > Year, because I have finished most of long-term test and HA related issues, I think I can do this soon. > > Thanks for the good point. Thinking about it some more I wonder if the code in pg_ctl has the same problem, but due to a different way of starting the server isn't exploited. In 1.0.0 gtm_ctl started the server by redirected stdout to the logfile. This is how pg_ctl starts postmaster, too. In 1.0.1 gtm received the "-l" option and thus gets started by using this option instead of the redirection, which is the very reason for the problem we see. I just patched gtm_ctl to redirect again and it works flawlessly in my original usecase. 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 |
From: Michael M. <me...@po...> - 2013-01-10 13:50:50
|
One more bit of information. I guess gtm executes DebugFileOpen() when -l is used. The same function is used for the -r option in postgres. But the latter is only for single user mode, which usually means the program is attached to a tty. 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 |
From: Koichi S. <koi...@gm...> - 2013-01-21 08:49:18
Attachments:
gtm_ctl_start_daemonify_20130121.patch
|
Here's a patch to improve gtm_ctl behavior. Now, with -l option, gtm_ctl returns in the shell script. I'm using several magic numbers there. Maybe it needs improvement. Regards; ---------- Koichi Suzuki 2013/1/10 Michael Meskes <me...@po...>: > One more bit of information. I guess gtm executes DebugFileOpen() when -l is > used. The same function is used for the -r option in postgres. But the latter > is only for single user mode, which usually means the program is attached to a > tty. > > 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 |
From: Nikhil S. <ni...@st...> - 2013-02-06 08:56:16
Attachments:
gtm_ctl_wait_HEAD.patch
|
> Also, gtm_ctl -w option > seems not work properly. > PFA, a patch to fix "gtm_ctl -w" behavior in GIT HEAD. I also tested "-w -t nsecs" behavior and it seems to work as well. This patch can be easily be backported to 1.0 if desired. I hope all these obnoxious gtm startup issues are resolved now. Scripting was a bit painful because of these issues. Regards, Nikhils > I will take a look at these issue and fix at least in the next major > release. Daemonization should be back-ported to 1.0.x. > > Kind Regards; > ---------- > Koichi Suzuki > > > 2012/12/27 Michael Meskes <me...@po...>: >> I still haven't found the time to dig into this, but could anyone please >> explain to me how gtm is supposed to start up? A simple grep command doesn't >> seem to find any call to setsid() in gtm subdirs. Could you please point me to >> the code where gtm daemonizes? Because if it doesn't correctly, there is no >> suprise gtm_ctl doesn't come back. Or in other words, this is a logical point >> to start looking. >> >> 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 >> >> ------------------------------------------------------------------------------ >> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >> MVPs and experts. ON SALE this month only -- learn more at: >> http://p.sf.net/sfu/learnmore_122712 >> _______________________________________________ >> 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 |
From: Koichi S. <ko...@in...> - 2013-02-07 07:27:14
|
Yes, I was aware of that and was looking for a time to do this. It's so helpful to have this patch. Will review and test it before committing. Best; --- Koichi Suzuki On Wed, 6 Feb 2013 14:25:48 +0530 Nikhil Sontakke <ni...@st...> wrote: > > Also, gtm_ctl -w option > > seems not work properly. > > > > PFA, a patch to fix "gtm_ctl -w" behavior in GIT HEAD. I also tested > "-w -t nsecs" behavior and it seems to work as well. This patch can be > easily be backported to 1.0 if desired. I hope all these obnoxious gtm > startup issues are resolved now. Scripting was a bit painful because > of these issues. > > Regards, > Nikhils > > > I will take a look at these issue and fix at least in the next major > > release. Daemonization should be back-ported to 1.0.x. > > > > Kind Regards; > > ---------- > > Koichi Suzuki > > > > > > 2012/12/27 Michael Meskes <me...@po...>: > >> I still haven't found the time to dig into this, but could anyone please > >> explain to me how gtm is supposed to start up? A simple grep command doesn't > >> seem to find any call to setsid() in gtm subdirs. Could you please point me to > >> the code where gtm daemonizes? Because if it doesn't correctly, there is no > >> suprise gtm_ctl doesn't come back. Or in other words, this is a logical point > >> to start looking. > >> > >> 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 > >> > >> ------------------------------------------------------------------------------ > >> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > >> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > >> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > >> MVPs and experts. ON SALE this month only -- learn more at: > >> http://p.sf.net/sfu/learnmore_122712 > >> _______________________________________________ > >> 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 |