<div dir="ltr"><div><div><font size="4">Hi guys!<br><br></font></div><font size="4">I want systemd to monitor pgpool and restart another once it found it is dead. So here is this simple service named as auto_pgpool.service<br></font><br><span style="color:rgb(0,0,255)"><font size="4">[Unit]<br>Description=run pgpool after auto_pgha service ## <-change run_XXX.sh<br><br>[Service]<br>Type=simple<br>ExecStart=/usr/bin/pgpool ## <-change run_XXX.sh<br>Restart=on-failure<br>RestartSec=3 <br>## systemd bears daemon duty<br><br>[Install]<br>WantedBy=multi-user.target</font></span><br><br></div><font size="4">But it always failed and caused systemd to restart it again and again - <b><span style="color:rgb(255,0,0)">is it a false positive? and how can I avoid it?</span></b></font><br><br><span style="background-color:rgb(0,0,0)"><span style=""></span><span style="color:rgb(153,0,255)"><span style="background-color:rgb(255,255,255)">Jun 30 14:48:13 yzx1 systemd[1]: Started run pgpool after auto_pgha service ## <-change run_XXX.sh.<br><span style="color:rgb(56,118,29)">░░ Subject: A start job for unit auto_pgpool.service has finished successfully<br>░░ Defined-By: systemd<br>░░ Support: <a href="https://access.redhat.com/support">https://access.redhat.com/support</a><br>░░<br>░░ A start job for unit auto_pgpool.service has finished successfully.<br>░░<br>░░ The job identifier is 10863.</span><br>Jun 30 14:48:13 yzx1 pgpool[5575]: pgpool-II version 4.4.3 (nurikoboshi),<br>Jun 30 14:48:13 yzx1 pgpool[5575]:   A generic connection pool/replication/load balance server for PostgreSQL<br>Jun 30 14:48:13 yzx1 pgpool[5575]: Usage:<br>Jun 30 14:48:13 yzx1 pgpool[5575]:   pgpool [ -c] [ -f CONFIG_FILE ] [ -F PCP_CONFIG_FILE ] [ -a HBA_CONFIG_FILE ]<br>Jun 30 14:48:13 yzx1 pgpool[5575]:          [ -n ] [ -D ] [ -d ]<br>Jun 30 14:48:13 yzx1 pgpool[5575]:   pgpool [ -f CONFIG_FILE ] [ -F PCP_CONFIG_FILE ] [ -a HBA_CONFIG_FILE ]<br>Jun 30 14:48:13 yzx1 pgpool[5575]:          [ -m SHUTDOWN-MODE ] stop<br>Jun 30 14:48:13 yzx1 pgpool[5575]:   pgpool [ -f CONFIG_FILE ] [ -F PCP_CONFIG_FILE ] [ -a HBA_CONFIG_FILE ] reload<br>Jun 30 14:48:13 yzx1 pgpool[5575]: Common options:<br>Jun 30 14:48:13 yzx1 pgpool[5575]:   -a, --hba-file=HBA_CONFIG_FILE<br>Jun 30 14:48:13 yzx1 pgpool[5575]:                       Set the path to the pool_hba.conf configuration file<span style=""></span><br>Jun 30 14:48:13 yzx1 pgpool[5575]:                       (default: /usr/etc/pool_hba.conf)<br>Jun 30 14:48:13 yzx1 pgpool[5575]:   -f, --config-file=CONFIG_FILE<br>Jun 30 14:48:13 yzx1 pgpool[5575]:                       Set the path to the pgpool.conf configuration file<br>Jun 30 14:48:13 yzx1 pgpool[5575]:                       (default: /usr/etc/pgpool.conf)<br>Jun 30 14:48:13 yzx1 pgpool[5575]:   -k, --key-file=KEY_FILE<br>Jun 30 14:48:13 yzx1 pgpool[5575]:                       Set the path to the pgpool key file<br>Jun 30 14:48:13 yzx1 pgpool[5575]:                       (default: /root/.pgpoolkey)<br>Jun 30 14:48:13 yzx1 pgpool[5575]:                       can be over ridden by PGPOOLKEYFILE environment variable<br>Jun 30 14:48:13 yzx1 pgpool[5575]:   -F, --pcp-file=PCP_CONFIG_FILE<br>Jun 30 14:48:13 yzx1 pgpool[5575]:                       Set the path to the pcp.conf configuration file<br>Jun 30 14:48:13 yzx1 pgpool[5575]:                       (default: /usr/etc/pcp.conf)<br>Jun 30 14:48:13 yzx1 pgpool[5575]:   -h, --help          Print this help<br>Jun 30 14:48:13 yzx1 pgpool[5575]: Start options:<br>Jun 30 14:48:13 yzx1 pgpool[5575]:   -C, --clear-oidmaps Clear query cache oidmaps when memqcache_method is memcached<br>Jun 30 14:48:13 yzx1 pgpool[5575]:                       (If shmem, discards whenever pgpool starts.)<br>Jun 30 14:48:13 yzx1 pgpool[5575]:   -n, --dont-detach   Don't run in daemon mode, does not detach control tty<br>Jun 30 14:48:13 yzx1 pgpool[5575]:   -x, --debug-assertions   Turns on various assertion checks, This is a debugging aid<br>Jun 30 14:48:13 yzx1 pgpool[5575]:   -D, --discard-status Discard pgpool_status file and do not restore previous status<br>Jun 30 14:48:13 yzx1 pgpool[5575]:   -d, --debug         Debug mode<br>Jun 30 14:48:13 yzx1 pgpool[5575]: Stop options:<br>Jun 30 14:48:13 yzx1 pgpool[5575]:   -m, --mode=SHUTDOWN-MODE<br>Jun 30 14:48:13 yzx1 pgpool[5575]:                       Can be "smart", "fast", or "immediate"<br>Jun 30 14:48:13 yzx1 pgpool[5575]: Shutdown modes are:<br>Jun 30 14:48:13 yzx1 pgpool[5575]:   smart       quit after all clients have disconnected<br>Jun 30 14:48:13 yzx1 pgpool[5575]:   fast        quit directly, with proper shutdown<br>Jun 30 14:48:13 yzx1 pgpool[5575]:   immediate   the same mode as fast<br><b><span style="color:rgb(241,194,50)">Jun 30 14:48:13 yzx1 systemd[1]: auto_pgpool.service: Main process exited, code=exited, status=1/FAILURE</span></b><br><span style="color:rgb(56,118,29)">░░ Subject: Unit process exited<br>░░ Defined-By: systemd<br>░░ Support: <a href="https://access.redhat.com/support">https://access.redhat.com/support</a><br>░░<br>░░ An ExecStart= process belonging to unit auto_pgpool.service has exited.<br>░░<br>░░ The process' exit code is 'exited' and its exit status is 1.</span><br>Jun 30 14:48:13 yzx1 systemd[1]: auto_pgpool.service: Failed with result 'exit-code'.<br><span style="color:rgb(56,118,29)">░░ Subject: Unit failed<br>░░ Defined-By: systemd<br>░░ Support: <a href="https://access.redhat.com/support">https://access.redhat.com/support</a><br>░░<br>░░ The unit auto_pgpool.service has entered the 'failed' state with result 'exit-code'.<br>Jun 30 14:48:16 yzx1 systemd[1]: auto_pgpool.service: Scheduled restart job, restart counter is at 167.</span></span></span></span></div>