I want to use -p and create a PID file so monit can watch the daemon and restart it when it’s not responding (ea when I have thread starvation or an other bug in my apps).
But it looks like the -p argument is not working if you don’t use -d
I’m not an AppDaemon user, but I know systemd has the PIDFile option for service units. Maybe this resolves your issue of having to use that as a parameter for the command itself.
Besides that, systemd can be configured to automatically restart a service if it crashes. The Restart option would be what you need in this case.
When you start appdaemon with systemd you do not and should not use -d option (see documentation) and it still runs as a daemon then. The -d option is for a “stand-alone” daemon mode.
That was my point to start with. IMHO the -p argument should not be coupled to the -d. Home Assistant has both a -d and -p option and the work separate. My systemd and monit setup works fine for home assistant, just not for appdaemon.
but at least we can say for sure that it is not a bug, but something by design.
maybe it is possible and the docs need an addition, maybe it isnt possible by choice or because that option is missed.