public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in dev-db/pgbouncer/files: pgbouncer.initd
@ 2011-11-16  4:17 Aaron Swenson (titanofold)
  0 siblings, 0 replies; 3+ messages in thread
From: Aaron Swenson (titanofold) @ 2011-11-16  4:17 UTC (permalink / raw
  To: gentoo-commits

titanofold    11/11/16 04:17:37

  Added:                pgbouncer.initd
  Log:
  Initial commit. Ebuild written by Johan Bergström <bugs@bergstroem.nu>. Fixes bug 243232.
  
  (Portage version: 2.1.10.11/cvs/Linux i686)

Revision  Changes    Path
1.1                  dev-db/pgbouncer/files/pgbouncer.initd

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/pgbouncer/files/pgbouncer.initd?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/pgbouncer/files/pgbouncer.initd?rev=1.1&content-type=text/plain

Index: pgbouncer.initd
===================================================================
#!/sbin/runscript

extra_started_commands="reload"

if [ -d /run ] ; then
	RUNDIR=/run/pgbouncer
else
	RUNDIR=/var/run/pgbouncer
fi

depend() {
	need net
	after postgresql
}

start() {
	mkdir -p ${RUNDIR}
	chown pgbouncer:pgbouncer ${RUNDIR}

	ebegin "Starting pgbouncer"
	start-stop-daemon --start --pidfile ${RUNDIR}/pgbouncer.pid \
		--exec /usr/bin/pgbouncer -- -q -d -u pgbouncer /etc/pgbouncer.conf
	eend $? "Failed to start pgbouncer"
}

stop() {
	ebegin "Stopping pgbouncer"
	start-stop-daemon --stop --quiet --pidfile ${RUNDIR}/pgbouncer.pid
	eend $?
}

reload() {
	ebegin "Gracefully reloading pgbouncer"
	start-stop-daemon --stop --oknodo --signal HUP \
		--pidfile ${RUNDIR}/pgbouncer.pid
	eend $?
}






^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gentoo-commits] gentoo-x86 commit in dev-db/pgbouncer/files: pgbouncer.initd
@ 2013-01-14 17:26 Sergey Popov (pinkbyte)
  0 siblings, 0 replies; 3+ messages in thread
From: Sergey Popov (pinkbyte) @ 2013-01-14 17:26 UTC (permalink / raw
  To: gentoo-commits

pinkbyte    13/01/14 17:26:13

  Modified:             pgbouncer.initd
  Log:
  Update initscript, fix bugs #410645 and #410647, thanks to Johan Bergström
  
  (Portage version: 2.2.0_alpha151/cvs/Linux x86_64, unsigned Manifest commit)

Revision  Changes    Path
1.2                  dev-db/pgbouncer/files/pgbouncer.initd

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/pgbouncer/files/pgbouncer.initd?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/pgbouncer/files/pgbouncer.initd?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/pgbouncer/files/pgbouncer.initd?r1=1.1&r2=1.2

Index: pgbouncer.initd
===================================================================
RCS file: /var/cvsroot/gentoo-x86/dev-db/pgbouncer/files/pgbouncer.initd,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pgbouncer.initd	16 Nov 2011 04:17:37 -0000	1.1
+++ pgbouncer.initd	14 Jan 2013 17:26:13 -0000	1.2
@@ -1,6 +1,6 @@
 #!/sbin/runscript
 
-extra_started_commands="reload"
+extra_started_commands="reload upgrade"
 
 if [ -d /run ] ; then
 	RUNDIR=/run/pgbouncer
@@ -14,8 +14,7 @@
 }
 
 start() {
-	mkdir -p ${RUNDIR}
-	chown pgbouncer:pgbouncer ${RUNDIR}
+	checkpath -d -m 755 -o pgbouncer:pgbouncer ${RUNDIR}
 
 	ebegin "Starting pgbouncer"
 	start-stop-daemon --start --pidfile ${RUNDIR}/pgbouncer.pid \
@@ -31,7 +30,14 @@
 
 reload() {
 	ebegin "Gracefully reloading pgbouncer"
-	start-stop-daemon --stop --oknodo --signal HUP \
-		--pidfile ${RUNDIR}/pgbouncer.pid
+	kill -HUP $(head -n1 ${RUNDIR}/pgbouncer.pid)
 	eend $?
 }
+
+upgrade() {
+	egrep -q "^unix_socket_dir" /etc/pgbouncer.conf || \
+		eerror "Not running with unix sockets, cannot upgrade"
+    ebegin "Gracefully upgrading pgbouncer"
+		/usr/bin/pgbouncer -R -q -d -u pgbouncer /etc/pgbouncer.conf
+    eend $?
+}
\ No newline at end of file





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gentoo-commits] gentoo-x86 commit in dev-db/pgbouncer/files: pgbouncer.initd
@ 2013-08-18 20:19 Aaron Swenson (titanofold)
  0 siblings, 0 replies; 3+ messages in thread
From: Aaron Swenson (titanofold) @ 2013-08-18 20:19 UTC (permalink / raw
  To: gentoo-commits

titanofold    13/08/18 20:19:51

  Modified:             pgbouncer.initd
  Log:
  Fix bugs 478142, 478240, and 477350.
  
  (Portage version: 2.1.12.2/cvs/Linux x86_64, signed Manifest commit with key D1BBFDA0)

Revision  Changes    Path
1.4                  dev-db/pgbouncer/files/pgbouncer.initd

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/pgbouncer/files/pgbouncer.initd?rev=1.4&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/pgbouncer/files/pgbouncer.initd?rev=1.4&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/pgbouncer/files/pgbouncer.initd?r1=1.3&r2=1.4

Index: pgbouncer.initd
===================================================================
RCS file: /var/cvsroot/gentoo-x86/dev-db/pgbouncer/files/pgbouncer.initd,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- pgbouncer.initd	19 Jul 2013 00:47:55 -0000	1.3
+++ pgbouncer.initd	18 Aug 2013 20:19:50 -0000	1.4
@@ -22,15 +22,26 @@
         checkpath -o postgres:postgres -m 0775 -d "${UNIX_SOCKET_DIR}" \
             || return 1
     fi
+    checkpath -o pgbouncer:postgres -m 0755 -d "$(dirname ${PIDFILE})" \
+        || return 1
     checkpath -o pgbouncer:postgres -m 0644 -f "${PIDFILE}" \
         || return 1
+    checkpath -o pgbouncer:postgres -m 0755 -d "$(dirname $(get_config logfile))" \
+        || return 1
     checkpath -o pgbouncer:postgres -m 0640 -f "$(get_config logfile)" \
         || return 1
+
+    return 0
 }
 
 start() {
     ebegin "Starting PgBouncer"
-    prep || eend 1
+    prep
+    local ret=$?
+    if [ $ret -ne 0 ] ; then
+        eend $ret
+        exit $ret
+    fi
     start-stop-daemon --start \
         --pidfile ${PIDFILE} \
         --user pgbouncer \
@@ -39,14 +50,14 @@
 }
 
 stop() {
-    local seconds=$(( ${NICE_TIMEOUT} + ${FORCE_TIMEOUT} ))
+    local seconds=$(( ${NICE_TIMEOUT} + ${FORCE_QUIT_TIMEOUT} ))
     ebegin "Stopping PgBouncer (this can take up to ${seconds} seconds)"
 
     local retries=SIGINT/${NICE_TIMEOUT}
 
     if [ "${FORCE_QUIT}" = "YES" ] ; then
         einfo "FORCE_QUIT enabled."
-        retries="${retries}/SIGTERM/${FORCE_TIMEOUT}"
+        retries="${retries}/SIGTERM/${FORCE_QUIT_TIMEOUT}"
     fi
 
     # Loops through nice and force quit in one go.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-18 20:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-14 17:26 [gentoo-commits] gentoo-x86 commit in dev-db/pgbouncer/files: pgbouncer.initd Sergey Popov (pinkbyte)
  -- strict thread matches above, loose matches on Subject: below --
2013-08-18 20:19 Aaron Swenson (titanofold)
2011-11-16  4:17 Aaron Swenson (titanofold)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox