39 lines
1.2 KiB
Diff
39 lines
1.2 KiB
Diff
diff -Naur old/etc/example.debian.init.sh new/etc/example.debian.init.sh
|
|
--- old/etc/example.debian.init.sh 2020-01-27 18:35:12.533466866 +0300
|
|
+++ new/etc/example.debian.init.sh 2020-01-27 18:40:38.728173893 +0300
|
|
@@ -7,8 +7,8 @@
|
|
|
|
NAME=pgbouncer
|
|
DAEMON=/usr/bin/$NAME
|
|
-PIDFILE=/var/run/$NAME.pid
|
|
-CONF=/etc/$NAME.ini
|
|
+PIDFILE=/var/run/pgbouncer/$NAME.pid
|
|
+CONF=/etc/pgbouncer/$NAME.ini
|
|
OPTS="-d $CONF"
|
|
# note: SSD is required only at startup of the daemon.
|
|
SSD=`which start-stop-daemon`
|
|
@@ -21,18 +21,20 @@
|
|
|
|
case "$1" in
|
|
start)
|
|
+ mkdir -p /var/run/pgbouncer/
|
|
+ chown postgres:postgres /var/run/pgbouncer/
|
|
echo -n "Starting server: $NAME"
|
|
- $ENV $SSD --start --pidfile $PIDFILE --exec $DAEMON -- $OPTS > /dev/null
|
|
+ su postgres -c "$ENV $SSD --start --pidfile $PIDFILE --exec $DAEMON -- $OPTS" > /dev/null
|
|
;;
|
|
|
|
stop)
|
|
echo -n "Stopping server: $NAME"
|
|
- start-stop-daemon --stop --pidfile $PIDFILE
|
|
+ su postgres -c "start-stop-daemon --stop --pidfile $PIDFILE "
|
|
;;
|
|
|
|
reload | force-reload)
|
|
echo -n "Reloading $NAME configuration"
|
|
- start-stop-daemon --stop --pidfile $PIDFILE --signal HUP
|
|
+ su postgres -c "start-stop-daemon --stop --pidfile $PIDFILE --signal HUP"
|
|
;;
|
|
|
|
restart)
|