<div dir="ltr"><div>Package: postgres-xc<br></div><div>Version: 1.1-2</div><div>Severity: normal</div><div>Tags: patch</div><div><br></div><div>--- Please enter the report below this line. ---</div><div><br></div><div>Hello,</div>
<div><br></div><div>Original init script included into the package does not support gtm proxy.</div><div><br></div><div>Please find below my suggested patch for init script to handle that additional component of postgres-xc:</div>
<div><br></div><div><br></div><div><div>--- /etc/init.d/postgres-xc 2013-08-20 07:29:54.000000000 -0400</div><div>+++ ./postgres-xc 2014-01-24 11:37:20.185485456 -0500</div><div>@@ -33,6 +33,10 @@</div><div> {</div>
<div> status=0</div><div> case "$1" in</div><div>+ gtm_proxy)</div><div>+ pidfile=gtm_proxy.pid</div><div>+ sleep 2</div><div>+ ;;</div><div> gtm)</div><div>
pidfile=gtm.pid</div><div> sleep 2</div><div>@@ -40,7 +44,7 @@</div><div> postgres)</div><div> pidfile=postmaster.pid</div><div> confport=$(grep -si '^port *=' $PGXC_DATA/$2/postgresql.conf |</div>
<div>- cut -f2 -d= | sed -e 's/#.*$//' -e 's/ //g')</div><div>+ cut -f2 -d= | sed -e 's/#.*$//' -e 's/ //g')</div><div> port=${confport:=5432}</div>
<div> </div><div> # wait for server to come up, but no more than 10 seconds</div><div>@@ -63,6 +67,7 @@</div><div> [ "`ps h -o comm -p $PID`" != $1 ] && status=1</div><div> fi</div>
<div> else</div><div>+# echo $PGXC_DATA/$2/$pidfile is not readable</div><div> status=1</div><div> fi</div><div> return 0</div><div>@@ -77,15 +82,24 @@</div><div> $FAST_STOP &&</div>
<div> STOP_MODE="-mf"</div><div> }</div><div>- for TYPE in datanode coordinator gtm; do</div><div>+ SEQUENCE="gtm gtm_proxy coordinator datanode"</div><div>+ [ "$ACTION" = "stop" ] && SEQUENCE="datanode coordinator gtm_proxy gtm"</div>
<div>+ for TYPE in $SEQUENCE; do</div><div> case $TYPE in</div><div> gtm)</div><div> PG_CTL=gtm_ctl</div><div> PG_START=gtm</div><div>+ EXTRA_OPTS=''</div>
<div>+ ;;</div><div>+ gtm_proxy)</div><div>+ PG_CTL=gtm_ctl</div><div>+ PG_START=gtm_proxy</div><div>+ EXTRA_OPTS=''</div><div> ;;</div><div> coordinator|datanode)</div>
<div> PG_CTL=pg_ctl</div><div> PG_START=postgres</div><div>+ EXTRA_OPTS=''</div><div> ;;</div><div> esac</div><div> log_daemon_msg "$2 Postgres-XC ${TYPE}"</div>
<div>@@ -94,24 +108,37 @@</div><div> if [ "$ACTION" = "reload" ] && [ "$TYPE" = "gtm" ]; then </div><div> ACTION="restart"</div>
<div> fi</div><div>+ if [ "$ACTION" = "reload" ] && [ "$TYPE" = "gtm_proxy" ]; then </div><div>+ ACTION="restart"</div>
<div>+ fi</div><div> [ "$ACTION" = "stop" ] &&</div><div> check_if_running $PG_START $NODE stop</div><div> if [ $status -eq 1 ]; then</div>
<div> log_progress_msg "$NODE is not running"</div><div> else</div><div>- ERRMSG=$(start-stop-daemon -c postgres-xc \</div><div>- -Sx /usr/bin/$PG_CTL -- $ACTION $STOP_MODE \</div>
<div>- -D $PGXC_DATA/$NODE -Z $TYPE \</div><div>- -l $PGXC_LOG/datanode.log</div><div>- STATUS=$?</div><div>- if $FAST_STOP && [ $STATUS -gt 0 ] && </div>
<div>- [ "$ACTION" = "stop" ]; then</div><div>- STATUS=0</div><div>- start-stop-daemon -c postgres-xc \</div>
<div>- -Sx /usr/bin/$PG_CTL -- stop -mi \</div><div>- -D $PGXC_DATA/$NODE -Z $TYPE \</div><div>- -l $PGXC_LOG/datanode.log || STATUS=$?</div>
<div>- fi) </div><div>+ if [ "$TYPE" = "gtm_proxy" ] ; then EXTRA_OPTS="-o -D $PGXC_DATA/$NODE"; fi</div><div>+ ERRMSG=$(if [ "$TYPE" = "gtm_proxy" ] ; then {</div>
<div>+ start-stop-daemon -c postgres-xc \</div><div>+ -Sx /usr/bin/$PG_CTL -- $ACTION $STOP_MODE \</div><div>+ -D $PGXC_DATA/$NODE -Z $TYPE \</div>
<div>+ -l $PGXC_LOG/datanode.log -o "-D $PGXC_DATA/$NODE"</div><div>+ }</div><div>+ else {</div><div>+ start-stop-daemon -c postgres-xc \</div>
<div>+ -Sx /usr/bin/$PG_CTL -- $ACTION $STOP_MODE \</div><div>+ -D $PGXC_DATA/$NODE -Z $TYPE \</div><div>+ -l $PGXC_LOG/datanode.log </div>
<div>+ }</div><div>+ fi</div><div>+ STATUS=$?</div><div>+ if $FAST_STOP && [ $STATUS -gt 0 ] && </div><div>
+ [ "$ACTION" = "stop" ]; then</div><div>+ STATUS=0</div><div>+ start-stop-daemon -c postgres-xc \</div>
<div>+ -Sx /usr/bin/$PG_CTL -- stop -mi \</div><div>+ -D $PGXC_DATA/$NODE -Z $TYPE \</div><div>+ -l $PGXC_LOG/datanode.log || STATUS=$?</div>
<div>+ fi) </div><div> REPORT=$NODE</div><div> [ "$ACTION" = "status" ] && REPORT=$ERRMSG</div><div> log_progress_msg "$REPORT"</div>
<div>@@ -153,4 +180,3 @@</div><div> esac</div><div> </div><div> exit 0</div><div>-</div></div><div><br></div><div><br></div><div>Thanks</div><div>Tim</div><div><br></div><div>--- System information. ---</div><div>Architecture: amd64</div>
<div>Kernel: Linux 3.11-2-amd64</div><div><br></div><div>Debian Release: jessie%2Fsid</div><div> 800 unstable <a href="http://http.us.debian.org">http.us.debian.org</a> </div><div> 800 unstable <a href="http://deb-multimedia.org">deb-multimedia.org</a> </div>
<div> 500 stable <a href="http://dl.google.com">dl.google.com</a> </div><div> 1 experimental <a href="http://http.us.debian.org">http.us.debian.org</a> </div><div><br></div><div>--- Package information. ---</div>
<div>Depends (Version) | Installed</div><div>======================================- -================</div><div>libc6 (>= 2.16) | </div><div>libcomerr2 (>= 1.01) | </div>
<div>libgssapi-krb5-2 (>= 1.10 dfsg~) | </div><div>libkrb5-3 (>= 1.6.dfsg.2) | </div><div>libldap-2.4-2 (>= 2.4.7) | </div><div>libpam0g (>= 0.99.7.1) | </div>
<div>
libpq5 (>= 9.1~) | </div><div>libssl1.0.0 (>= 1.0.0) | </div><div>libxml2 (>= 2.7.4) | </div><div>zlib1g (>= 1:1.1.4) | </div><div>
postgres-xc-client | </div>
<div>adduser | </div><div>ssl-cert (>= 1.0.11) | </div><div>logrotate | </div><div><br></div><div><br></div><div>Package's Recommends field is empty.</div>
<div><br></div><div>Package's Suggests field is empty.</div><div><br></div></div>