Red Hat Bugzilla – Bug 1314717
Init script should include configuration from /etc/sysconfig/monit
Last modified: 2016-03-04 05:37:03 EST
Description of problem:
The startup init script for monit relies on local defined variables: rundir, pidfile, user, group and prog.
Monit is run by root by default. If someone wants to change the user and group used to run monit, the init script must be modified.
A better approach would be reading the contents from /etc/sysconfig/monit if this file exists after the definition of those variables, allowing the user to override their default values.
Version-Release number of selected component (if applicable):
Reinstalling or updating the package will smash init script file, since it's not a configuration file.
Steps to Reproduce:
1. Change monit init script and adjust its files and directories permissions in order to successfully run it as a non-root user. Configure sudo as needed to allow monit to restart monitored services when needed.
2. Reinstall monit.
3. Open /etc/init.d/monit
User-made changes to the init script are lost, so changes to user and group running monit are not preserved.
It would be desirable if sysadmins could preserve some changes made to the behavior of the init script.
Please, consider modifying monit init script to include the following code after the definition of the aforementioned variables.
if [ -f /etc/sysconfig/monit ]; then