Missing pid file from non-running service breaks copy SSL certificate script and Lets Encrypt renewal

There may be a bug in the Copy SSL certificate functions if a service isn’t running. I’ve got a certificate setup for Webmin, Usermin, Postfix and Dovecot.

Normally I keep Usermin disabled as it’s not normally used, but like to still have it configured to easily turn on if I need it. During the copy SSL certificate procedure when it reaches Usermin configuration and is unable to open PID file the script stops and the cert(s) for subsequent services in the list like Postfix and Dovecot are not updated.

Seems like &usermin::restart_usermin_miniserv(); fails with an error if it can’t open the PID file then the error handler calls exit(1) after printing the error breaking the calling script. Perhaps the logic shouldn’t throw an error that halts if the pid file doesn’t exist or is otherwise invalid.

Maybe my use case isn’t typical but if there was a problem with the pid file for whatever reason and a lets encrypt automatic renewal ran it could break a number of core services silently.

If this is intended behavior is there a better way to disable Usermin but keep it easily usable? I have a workaround with just calling return if the pid file can’t be opened but hopefully there’s a way to handle this without having to modify every release.

Configuring Usermin to use them ..

---

### Failed to open PID file
SYSTEM INFORMATION
OS type and version Rocky Linux 9.1
Virtualmin version 7.5

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.