0

I'm trying to create a systemd-service for a vendor-provided shell-script, which exits after launching the actual service (a Java-program). I don't want to put the program itself into ExecStart, because the script does a lot of things first (setting up environment variables, etc.) -- which lot also changes from version to version.

The only means officially supported by the vendor is through the shell script...

Before exiting, the script creates/updates the PID-file -- can I make systemd monitor the process specified in it?

Mikhail T.
  • 2,272
  • 1
  • 22
  • 49
  • 1
    The obvious thing to do is to set `Type=forking`. – Michael Hampton Feb 02 '21 at 00:44
  • Thanks, @MichaelHampton -- that seems to work, and I even get the full list of processes launched from `systemctl --status`. What, then, is the significance of the `PIDFile`? Also, can you post a proper answer, so I can "accept" it? – Mikhail T. Feb 02 '21 at 16:06
  • The `Type=forking` worked for two months, but then stopped. I commented the `Type`-line out, and it started to work again -- with just the `PIDFile`. See [this question](/questions/1060294/). – Mikhail T. Apr 14 '21 at 02:11

0 Answers0