El estado del servicio systemd está en estado de activación todo el tiempo.

El estado del servicio systemd está en estado de activación todo el tiempo.

Tengo un problema con el servicio systemd, el estado del script siempre es "Estado de activación", no "activo". No estoy seguro de cuál es el problema. Por favor ayúdame con esto.

He creado el servicio systemd que ejecutará un script bash cada 30 segundos.

My script : 
#!/bin/bash
PGPORT=$1
echo "running through bash script thourgh  systemd working `date`" >> //tmp/diditwork.txt

Mi configuración de servicio systemd

[root@pglinux02 system]# cat /etc/systemd/system/test-pg.service
[Unit]
Description=PostgreSQL db Service
After=network.target

[Service]
User=postgres
Type=simple
ExecStart=/tmp/test.sh 5432
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target
[root@pglinux02 system]#

Mi script se ejecuta como se esperaba, pero cuando verifico el estado del servicio, muestra el estado "activando" todo el tiempo.

[root@pglinux02 system]# systemctl status test-pg.service
● test-pg.service - PostgreSQL db Service 
   Loaded: loaded (/etc/systemd/system/test-pg.service; enabled; vendor preset: disabled)
   Active: **activating (auto-restart)** since Fri 2021-10-29 19:49:57 GMT; 6s ago
  Process: 5274 ExecStart=/tmp/test.sh 5432 (code=exited, status=0/SUCCESS)
 Main PID: 5274 (code=exited, status=0/SUCCESS)
[root@pglinux02 system]#

¿Cuál es la forma de hacer que este servicio esté "activo (en ejecución)"? Si agrega otro parámetro "RemainAfterExit=yes", el script se ejecuta por primera vez y no se ejecuta en el intervalo siguiente.

por favor avise sobre mi error junto con la solución

Gracias Durga

información relacionada