Doing `service prosody start` will start prosody, but not create the PIDfile the rc script expects. This leads to `service prosody status´ claiming the service isn't running when it actually is and keeps `service prosody stop` from ever working, meaning it has to be stopped by manually using `kill` on it.
Yes, that's why the pkg-message says: »Make sure your prosody.cfg.lua contains the following line or else the init script won't work: pidfile = "/var/run/prosody/prosody.pid"« The "posix" module gets loaded automatically, but there's no default for the pidfile, even though you usually want one (e.g. for prosodyctl). Having this hint in the package message seemed like a reasonable approach.
(In reply to Thomas Morper from comment #1) Oh, oooh. Yes, that fixes it. ^^; Adding the pidfile definition to the beginning of `prosody.cfg.lua.sample` with a comment stating that it's needed for the rc script to work properly would probably be a good "fix" keeping the problem from even occuring in most cases. :)
Where possible, the default state of a ports rc scripts (and default configs) should provide for a 'working' startup out of the box. If it's possible to improve existing rc.d scripts or configuration files to provide more default settings(such as pidfile in this case), we should look to do that. What is possible to improve in this case?
Its too rainy for cycling today so I had a look at this. I think historically we either required the pidfile or I simply picked the easy way because I couldn't figure out how to make it work with procname, command_args and command_interpreter initially. Nevertheless, since "prosodyctl" has been deprecated for startup and we no longer use that, there's no need for a pidfile any more. I've modified the rc-script to still support a user-defined pidfile, but it's neither encouraged nor required.
Created attachment 226680 [details] make having a pidfile optional net-im/prosody: make having a pidfile optional * Having the "pidfile" option in prosody.cfg.lua is no longer required by rc.d/prosody QA: * portlint: OK (1 warning regarding the use of /var/db) * testport: OK (poudriere: 11.4 & 12.2, i386 & amd64; 13.0, amd64 & arm64)
(In reply to Thomas Morper from comment #5) If there's no functionality/behaviour change in this and the quarterly version of the port is affected, please set merge-quarterly (to ?) so the change can be merged Thanks Thomas!
No changes in behaviour or in Prosody itself. An MFH is safe and propably a good idea.
Prosody 0.11.10 has been released. A PR for an update has been submitted, already including the one-line fix for pidfile issue discussed here - see bug #257595. Once the update is accepted this bug here may be closed.