Fix for 0000296: PGPool v3.6.2 terminated by systemd because the service Type
authorMuhammad Usama <m.usama@gmail.com>
Thu, 23 Mar 2017 21:17:36 +0000 (02:17 +0500)
committerMuhammad Usama <m.usama@gmail.com>
Thu, 23 Mar 2017 21:21:39 +0000 (02:21 +0500)
has been set to 'forking'

Removing the "-n" value assigned to OPTS variable in pgpool.sysconfig.
The problem was the systemd service with Type=forking expects the parent process
to exit after the startup is complete, but because the -n command line option
disables the daemon mode and systemd keeps on waiting for the Pgpool-II's parent
process to exit after startup, which never happens and eventually systemd
terminate the Pgpool-II after timeout.
As part of this commit I have also added a new variable STOP_OPTS which is
passed to ExecStop and can be used to pass extra command line options to
Pgpool-II stop command.

src/redhat/pgpool.service
src/redhat/pgpool.sysconfig

index 40f2e589f15b9ec1c47b650320c8b65e96acd33c..74bc934b6c2af55e53e450b2abe7dc272a4e569a 100644 (file)
@@ -9,7 +9,7 @@ Type=forking
 EnvironmentFile=-/etc/sysconfig/pgpool
 
 ExecStart=/usr/bin/pgpool -f /etc/pgpool-II/pgpool.conf $OPTS
-ExecStop=/usr/bin/pgpool -f /etc/pgpool-II/pgpool.conf stop
+ExecStop=/usr/bin/pgpool -f /etc/pgpool-II/pgpool.conf $STOP_OPTS stop
 ExecReload=/usr/bin/pgpool -f /etc/pgpool-II/pgpool.conf reload
 
 [Install]
index 221869e597c6a2725178cda1adb4aeef56104b04..96b4d9e934cf96af077cdb719574ec3c9fc1e5ef 100644 (file)
@@ -1,7 +1,7 @@
 # Options for pgpool
 
-# -n: don't run in daemon mode. does not detatch control tty
-# -d: debug mode. lots of debug information will be printed
+# If you want to use '-n' in START_OPTS, change the service type to simple in
+# the Pgpool-II service configuration file
+#OPTS=" -d"
 
-#OPTS=" -d -n"
-OPTS=" -n"
+#STOP_OPTS=" -m fast"