Eu tenho um Activation.service
que desejo executar durante a inicialização após o serviço de rede ser iniciado com êxito.
Este é o arquivo Activation.service
:
[Unit]
Description=Starting activation service during boot
Wants=network-online.target
After=network-online.target
[Service]
Type=forking
ExecStart=/opt/Neurotec_Biometric_10_0_SDK/Bin/Linux_x86_64/Activation/run_pgd.sh
TimeoutSec=30
Restart=on-failure
RestartSec=10
StartLimitInterval=350
StartLimitBurst=10
[Install]
WantedBy=multi-user.target
Alias=Activation.service
O script run_pgd.sh
está funcionando bem, testei esse script antes de carregar em systemd
.
Mas sudo systemctl start Activation.service
está jogando erro. Este é o status que obtive de systemctl status Activation.service
● Activation.service - Starting activation service during boot
Loaded: loaded (/etc/systemd/system/Activation.service; disabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Thu 2017-11-23 09:46:30 IST; 3s ago
Process: 3015 ExecStart=/opt/Neurotec_Biometric_10_0_SDK/Bin/Linux_x86_64/Activation/run_pgd.sh (code=exited, status=1/FAILURE)
Nov 23 09:46:30 inch-desktop systemd[1]: Failed to start Starting activation service during boot.
Nov 23 09:46:30 inch-desktop systemd[1]: Activation.service: Unit entered failed state.
Nov 23 09:46:30 inch-desktop systemd[1]: Activation.service: Failed with result 'exit-code'.
Este log eu recebi de journalctl -xe
-- Unit Activation.service has begun starting up.
Nov 23 09:53:57 inch-desktop run_pgd.sh[3158]: Usage: /opt/Neurotec_Biometric_10_0_SDK/Bin/Linux_x86_64/Activation/run_pgd.sh {start|stop|restart|log}
Nov 23 09:53:57 inch-desktop systemd[1]: Activation.service: Control process exited, code=exited status=1
Nov 23 09:53:57 inch-desktop systemd[1]: Failed to start Starting activation service during boot.
-- Subject: Unit Activation.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit Activation.service has failed.
--
-- The result is failed.
Nov 23 09:53:57 inch-desktop systemd[1]: Activation.service: Unit entered failed state.
Nov 23 09:53:57 inch-desktop systemd[1]: Activation.service: Failed with result 'exit-code'.
Nov 23 09:53:57 inch-desktop sudo[3155]: pam_unix(sudo:session): session closed for user root
Não tenho certeza do que deu errado. Existe algo que eu preciso fazer