systemctl restart megáll ExecStartPost esetén

Sziasztok,

Van egy CentOS 7 rendszer, systemctl paranccsal szeretnék egy service-t indítani és miután ez lefutott egy utólagos scripttel létrehotni az indított program PID file-át.
PIDFile=/var/run/pg.pid opció nem hozza létre ezért az
ExecStartPost opcióval szeretnék egy utólagos scripttel operálni.

A service file lényeges részei:
.include /lib/systemd/system/postgresql-9.6.service

[Service]
Environment=PGDATA=/data/pg-andguard
Environment=PGPORT=5433
Environment=PGLOG="/var/log/postgresql.log"
Environment=PGCLIENTENCODING="UTF8"

ExecStartPost="/data/teszt.sh"

# monit relies on the pidfile name
PIDFile=/var/run/pg.pid

A következő történik:
# systemctl start postgres.service

A teszt.sh lefut (mivel teszt ezért egyelőre csak létrehoz egy file-t), de a terminalban nem adja vissza a promptot.
Ha a rendszert újraindítom, akkor szépen elindul a service, nem akasztja meg a rendszert.
Kézzel indítás nem megy.

Valakinek esetleg van tippje, hogy mit csináljak?

üdv: redman

Hozzászólások

Megvan a megoldás:
Valamiért ha ez bent van:

PIDFile=/var/run/pg.pid

akkor elszáll a dolog.
Ezt a sort kivettem (úgysem csinálta azt amit vártam tőle) és megoldódott a probléma.

http://www.redphoto.hu

Szerintem csak nem olvastál doksit:

PIDFile=

Takes an absolute file name pointing to the PID file of this daemon. Use of this option is recommended for services where Type= is set to forking. systemd will read the PID of the main process of the daemon after start-up of the service. systemd will not write to the file configured here, although it will remove the file after the service has shut down if it still exists.

Nem hozza létre, de törli.

tr '[:lower:]' '[:upper:]' <<<locsemege
LOCSEMEGE