[Unit] Description=PgAgent for PostgreSQL After=syslog.target After=network.target [Service] Type=forking User=postgres Group=postgres # Location of the configuration file EnvironmentFile=/etc/pgagent.conf # Where to send early-startup messages from the server (before the logging # options of pgagent.conf take effect) # This is normally controlled by the global default set by systemd # StandardOutput=syslog # Disable OOM kill on the postmaster OOMScoreAdjust=-1000 ExecStart=/usr/bin/pgagent -s ${LOGFILE} -l ${LOGLEVEL} host=${DBHOST} dbname=${DBNAME} user=${DBUSER} port=${DBPORT} KillMode=mixed KillSignal=SIGINT Restart=on-failure # Give a reasonable amount of time for the server to start up/shut down TimeoutSec=300 [Install] WantedBy=multi-user.target