This is really annoying that systemd
only responded that my configuration of a service file is wrong, but does not specify where is wrong exactly:
/lib/systemd/system/auto_pgha.service
:
[Unit]
Description=PostgreSQL High Availability
After=network.service
After=firewalld.service
[Service]
Type=simple
WorkingDirectory=/etc/repmgr
ExecStartPre=/bin/bash -c 'echo -e "\n" `date +"%Y/%m/%d %a, %X"`": STARTING \n" >> pgha.log'
ExecStart=/bin/bash -c "python3 pg_high_availability.py &>> pgha.log"
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target
Inside directory /etc/repmgr
the two commands worked just fine. But the systemd service just responded with an error:
# systemctl start auto_pgha
Failed to start auto_pgha.service: Unit auto_pgha.service has a bad unit file setting.
See system logs and 'systemctl status auto_pgha.service' for details.
# systemctl status -l auto_pgha
○ auto_pgha.service - PostgreSQL High Availability
Loaded: bad-setting (Reason: Unit auto_pgha.service has a bad unit file setting.)
......
auto_pgha.service: Unit configuration has fatal error, unit will not be be started.