-2

I am creating a system unit file for RHEL7 that looks like:

[Service]
ExecStart=/opt/tibco/scripts/tibco-upstart.sh

And this is owned by a UserA,and they can add all these scripts that they want to add. /opt/tibco/scripts/tibco-upstart.sh calls other scripts that APP TEAM can add as they like. For instance :/opt/tibco/scripts/tibco-upstart.sh looks like

/tibco/scripts/startagents.sh
/tibco/scripts/startkafka.sh
/tibco/scripts/startjvms.sh

Is it possible that a Unit file can work like this? I tried forking and oneshot but the processes are not starting as expected.

Venu S
  • 3,251
  • 1
  • 9
  • 25

1 Answers1

0

Assuming your system unit has no other relevant directives, systemd will expect your startup script to keep running forever as a daemon; otherwise systemd will respawn it over and over again.

If your intention is to run the startup script once, add the directives

Type=oneshot
RemainAfterExit=Yes

into the Service section.

JL. Sanchez
  • 371
  • 1
  • 7