Make mmmd_mon / mmmd_agent runnable by non-root users

Bug #384842 reported by Pascal Hofmann
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
mysql-mmm
Confirmed
Undecided
Unassigned

Bug Description

Make mmmd_mon / mmmd_agent runnable by non-root users.

See: http://cwe.mitre.org/data/definitions/250.html

Related branches

Revision history for this message
IND admins (admins-indweb) wrote :

Started testing 2.0.7 with the following changes on linux (seems ok after a few hours):

RUN AS DIFFERENT USER

## NOTE Net::ARP can only function when called with UID 0, so only root can run the agents

a, Monitor node

# useradd -s /bin/false -d / mmmd

# chown -R mmmd:mmmd /etc/mysql-mmm/

# mkdir /var/run/mmmd
# chown mmmd:mmmd /var/run/mmmd
# chmod o-rwx /var/run/mmmd/

# chown -R mmmd:mmmd /var/log/mysql-mmm/

# mkdir /var/lib/misc/mmmd
# chown mmmd:mmmd /var/lib/misc/mmmd
# chmod o-rwx /var/lib/misc/mmmd

/etc/init.d/mysql-mmm-monitor

….
# Run as user
MMMD_USER='mmmd'
….
# Paths
if [ "$CLUSTER" != "" ]; then
    MMMD_MON_BIN="/usr/sbin/mmmd_mon @$CLUSTER"
    MMMD_MON_PIDFILE="/var/run/mmmd/mmmd_mon-$CLUSTER.pid"
else
    MMMD_MON_BIN="/usr/sbin/mmmd_mon"
    MMMD_MON_PIDFILE="/var/run/mmmd/mmmd_mon.pid"
fi
….
sudo -u $MMMD_USER "$MMMD_MON_BIN"
….

Changed in mysql-mmm:
status: New → Confirmed
Revision history for this message
clutch (spydergst-97) wrote :

Why is the code not looking at the config file (mmm_mon.conf:pid_path) to find the pid path. I don't think the pid pah should be hard coded if you have it available in the mmm_mon.conf.

Revision history for this message
Pascal Hofmann (pascalhofmann) wrote :

The init scripts do not parse the config file. If you want to use a non-default pid_path you have to adjust your init-script too.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.