I am using Debian 9.8
I have a service that runs my dotnet program. I would like to monitor it with monit but in all of the examples, you need to reference a .pid file in /var/run but my dotnet program doesn't have a .pid file in /var/run.
So I added PIDFile=/var/run/testservice.pid to the .service file for my service but it does not create the file when I start it.
This is where I am at
this is my .service file
[Unit]
Description=Test Service
Wants=network-online.target influxdb.service
After=network-online.target influxdb.service
[Service]
User=testservice
Group=mainapp
SyslogIdentifier=testservice
PIDFile=/var/run/testservice.pid
Restart=on-failure
TimeoutStopSec=5
RestartSec=10
ExecStart=/usr/bin/dotnet /mainapp/app/TestSystemdService.dll
[Install]
WantedBy=multi-user.target