Arch Linux - Systemd Service scenarios to Start with 'scenarios to read PID file' scenarios for Custom Daemon
I'm having trouble with I've encountered a strange issue with I'm a bit lost with I'm getting frustrated with I'm having trouble starting my custom service on Arch Linux using systemd..... When I attempt to start it, I receive the behavior `Failed to read PID file /var/run/mydaemon.pid: No such file or directory`. I have verified that the service file located at `/etc/systemd/system/mydaemon.service` is configured correctly, but the service still fails to recognize the PID file. My service file looks like this: ```ini [Unit] Description=My Custom Daemon After=network.target [Service] Type=forking PIDFile=/var/run/mydaemon.pid ExecStart=/usr/local/bin/mydaemon start ExecStop=/usr/local/bin/mydaemon stop Restart=on-failure [Install] WantedBy=multi-user.target ``` I've already checked the permissions on `/var/run/mydaemon.pid`, and it appears to be writable by the user running the service. Additionally, I manually created the PID file with the expected PID in it during testing. However, when I check the logs with `journalctl -u mydaemon.service`, I see entries stating it failed to read the PID file and the service did not start. I tried using `Type=simple` instead of `Type=forking`, but that also did not resolve the scenario. Is there something Iām missing in the service file configuration or a step I need to take to ensure the PID file is created properly? For context: I'm using Bash on Windows. For context: I'm using Bash on Linux. Any help would be greatly appreciated! My team is using Bash for this CLI tool. What's the correct way to implement this? I'm working in a CentOS environment. Any examples would be super helpful. What's the correct way to implement this?