Bug 1314717 - Init script should include configuration from /etc/sysconfig/monit
Init script should include configuration from /etc/sysconfig/monit
Status: NEW
Product: Fedora EPEL
Classification: Fedora
Component: monit (Show other bugs)
Unspecified Linux
unspecified Severity low
: ---
: ---
Assigned To: Stewart Adam
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2016-03-04 05:31 EST by Abel Martín
Modified: 2016-03-04 05:37 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Abel Martín 2016-03-04 05:31:55 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):

How reproducible:
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

Actual results:
User-made changes to the init script are lost, so changes to user and group running monit are not preserved.

Expected results:
It would be desirable if sysadmins could preserve some changes made to the behavior of the init script.

Additional info:
Please, consider modifying monit init script to include the following code after the definition of the aforementioned variables.

if [ -f /etc/sysconfig/monit ]; then
    . /etc/sysconfig/monit

Note You need to log in before you can comment on or make changes to this bug.