packages: mysql-mmm/mysql-mmm.spec, mysql-mmm/mmm_agent.conf (NEW), mysql-m...
glen
glen at pld-linux.org
Wed Oct 6 09:50:40 CEST 2010
Author: glen Date: Wed Oct 6 07:50:40 2010 GMT
Module: packages Tag: HEAD
---- Log message:
- re-init package, from fc spec, version 2.2.1
---- Files affected:
packages/mysql-mmm:
mysql-mmm.spec (1.1 -> 1.2) , mmm_agent.conf (NONE -> 1.1) (NEW), mmm_common.conf (NONE -> 1.1) (NEW), mmm_mon.conf (NONE -> 1.1) (NEW), mmm_mon_log.conf (NONE -> 1.1) (NEW), mmm_tools.conf (NONE -> 1.1) (NEW), mysql-mmm-agent.init (NONE -> 1.1) (NEW), mysql-mmm-monitor.init (NONE -> 1.1) (NEW), mysql-mmm-paths.patch (NONE -> 1.1) (NEW), mysql-mmm.logrotate (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/mysql-mmm/mysql-mmm.spec
diff -u packages/mysql-mmm/mysql-mmm.spec:1.1 packages/mysql-mmm/mysql-mmm.spec:1.2
--- packages/mysql-mmm/mysql-mmm.spec:1.1 Tue Oct 5 17:50:25 2010
+++ packages/mysql-mmm/mysql-mmm.spec Wed Oct 6 09:50:34 2010
@@ -1,24 +1,30 @@
# $Revision$, $Date$
-# TODO
-# - find source for bundled 32bit elfs: bin/sys/*
-# - pldize initscript, logrotate, etc
-%include /usr/lib/rpm/macros.perl
-Summary: MySQL Master-Master Replication Manager
+Summary: Multi-Master Replication Manager for MySQL
Name: mysql-mmm
-Version: 1.2.3
+Version: 2.2.1
Release: 0.1
License: GPL v2
Group: Applications/System
-Source0: http://mysql-master-master.googlecode.com/files/mysql-master-master-%{version}.tar.gz
-# Source0-md5: 2d0492222441ddae061a84bbfe23777a
-BuildRequires: rpm-perlprov >= 4.1-13
-BuildRequires: sed >= 4.0
-Requires(post,preun): /sbin/chkconfig
-Requires: rc-scripts
+URL: http://www.mysql-mmm.org/
+Source0: http://mysql-mmm.org/_media/mmm2:%{name}-%{version}.tar.gz
+# Source0-md5: f5f8b48bdf89251d3183328f0249461e
+Source1: http://mysql-mmm.org/_media/mmm2:%{name}-%{version}.pdf
+# Source1-md5: 180dbb5662fd66291d01913e0fe34842
+Source2: %{name}.logrotate
+Source3: %{name}-agent.init
+Source4: %{name}-monitor.init
+Source5: mmm_mon_log.conf
+Source6: mmm_agent.conf
+Source7: mmm_mon.conf
+Source8: mmm_tools.conf
+Source9: mmm_common.conf
+Patch0: %{name}-paths.patch
+Obsoletes: mmm
+Obsoletes: mysql-master-master
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define _appdir %{_datadir}/%{name}
+%define _libdir %{_prefix}/lib
%description
MMM (MySQL Master-Master Replication Manager) is a set of flexible
@@ -27,129 +33,170 @@
at any time). The toolset also has the ability to read balance
standard master/slave configurations with any number of slaves, so you
can use it to move virtual IP addresses around a group of servers
-depending on whether they are behind in replication.
+depending on whether they are behind in replication. In addition to
+that, it also has scripts for data backups, resynchronization between
+nodes etc.
+
+%package agent
+Summary: MMM Database Server Agent Daemon and Libraries
+Group: Applications/System
+Requires: %{name} = %{version}-%{release}
+Requires: iproute2
+Requires: perl-DBD-mysql
+Obsoletes: mmm-agent
+Obsoletes: mysql-master-master-agent
+
+%description agent
+Agent daemon and libraries which run on each MySQL server and provides
+the monitoring node with a simple set of remote services.
+
+%package monitor
+Summary: MMM Monitor Server Daemon and Libraries
+Group: Applications/System
+Requires: %{name} = %{version}-%{release}
+Requires: perl(Class::Singleton)
+Requires: perl(DBD::mysql)
+Obsoletes: mmm-monitor
+Obsoletes: mysql-master-master-monitor
+
+%description monitor
+Monitoring daemon and libraries that do all monitoring work and make
+all decisions about roles moving and so on.
+
+%package tools
+Summary: MMM Control Scripts and Libraries
+Group: Applications/System
+Requires: %{name} = %{version}-%{release}
+Obsoletes: mmm-tools
+Obsoletes: mysql-master-master-tools
+
+%description tools
+Scripts and libraries dedicated to management of the mmmd_mon
+processes by com- mands.
%prep
-%setup -q -n mysql-master-master-%{version}
+%setup -q
+%patch0 -p1
+cp -a %{SOURCE1} %{name}-%{version}.pdf
grep -rl /usr/bin/env bin sbin | xargs %{__sed} -i -e '1s,^#!.*perl,#!%{__perl},'
+# currently the README included with mysql-mmm is zero-length
+cat >> README <<EOF
+Full documentation can be found at:
+
+ %{_docdir}/%{name}-%{version}/%{name}-%{version}.pdf
+EOF
+
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d}
-./install.pl \
- --prefix=$RPM_BUILD_ROOT%{_appdir} \
- --sbin-dir=$RPM_BUILD_ROOT%{_sbindir} \
- --man-dir=$RPM_BUILD_ROOT%{_mandir} \
- --skip-checks
-
-# Install init scripts and logrotate conf
-install -p scripts/init.d/mmm_agent $RPM_BUILD_ROOT/etc/rc.d/init.d/mmm_agent
-install -p scripts/init.d/mmm_mon $RPM_BUILD_ROOT/etc/rc.d/init.d/mmm_mon
-cp -a scripts/logrotate.d/mmm $RPM_BUILD_ROOT/etc/logrotate.d/mmm
-
-# fix symlinks
-for a in $RPM_BUILD_ROOT%{_sbindir}/*; do
- l=$(readlink $a)
- l=../${l#$RPM_BUILD_ROOT%{_prefix}/}
- ln -sf $l $a
-done
-
-# relocate manuals
-install -d $RPM_BUILD_ROOT%{_mandir}/man1
-mv $RPM_BUILD_ROOT%{_appdir}/man/man1/* $RPM_BUILD_ROOT%{_mandir}/man1
-
-# relocate examples
-install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-for a in $RPM_BUILD_ROOT%{_appdir}%{_sysconfdir}/examples/*; do
- mv $a $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/$(basename $a .example)
-done
-
-# bundled 32bit ELF
-rm -f $RPM_BUILD_ROOT%{_appdir}/bin/sys/*
-
-# Remove unpackaged files/dirs
-rm -f $RPM_BUILD_ROOT%{_appdir}/debug*.list
-rm -r $RPM_BUILD_ROOT%{_appdir}/scripts \
- $RPM_BUILD_ROOT%{_appdir}/install.pl \
- $RPM_BUILD_ROOT%{_appdir}/contrib \
- $RPM_BUILD_ROOT%{_appdir}/man/src \
- $RPM_BUILD_ROOT%{_appdir}/CHANGES \
- $RPM_BUILD_ROOT%{_appdir}/COPYING \
- $RPM_BUILD_ROOT%{_appdir}/INSTALL \
- $RPM_BUILD_ROOT%{_appdir}/README \
- $RPM_BUILD_ROOT%{_appdir}/VERSION
+%{__make} install \
+ BINDIR='$(DESTDIR)/%{_libdir}/%{name}' \
+ DESTDIR=$RPM_BUILD_ROOT
+
+# additional
+install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig,logrotate.d},%{_localstatedir}/{run,lib}/%{name}}
+cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/mysql-mmm
+
+# Replace config files
+cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/mmm_mon_log.conf
+cp -a %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/mmm_agent.conf
+cp -a %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/mmm_mon.conf
+cp -a %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/mmm_tools.conf
+cp -a %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/mmm_common.conf
+
+# Replace our init scripts
+rm -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/*
+install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-mmm-agent
+install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/mysql-mmm-monitor
+
+# Create defaults files
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/default
+
+cat > $RPM_BUILD_ROOT/etc/sysconfig/mysql-mmm-agent <<EOF
+# mysql-mmm-agent defaults
+ENABLED=1
+EOF
+
+cat > $RPM_BUILD_ROOT/etc/sysconfig/mysql-mmm-monitor <<EOF
+# mysql-mmm-monitor defaults
+ENABLED=1
+EOF
%clean
rm -rf $RPM_BUILD_ROOT
-%post
-/sbin/chkconfig --add mmm_agent
-%service mmm_agent restart
-/sbin/chkconfig --add mmm_mon
-%service mmm_mon restart
-
-%preun
-if [ "$1" = "0" ]; then
- %service mmm_agent stop
- /sbin/chkconfig --del mmm_agent
- %service mmm_mon stop
- /sbin/chkconfig --del mmm_mon
+%post agent
+if [ "$1" -eq 1 ]; then
+ /sbin/chkconfig --add mysql-mmm-agent
+ /sbin/chkconfig mysql-mmm-agent off
+elif [ "$1" -ge 2 ]; then
+ %service mysql-mmm-agent condrestart
+fi
+
+%post monitor
+if [ "$1" -eq 1 ]; then
+ /sbin/chkconfig --add mysql-mmm-monitor
+ /sbin/chkconfig mysql-mmm-monitor off
+elif [ "$1" -ge 2 ]; then
+ %service mysql-mmm-monitor condrestart
+fi
+
+%preun agent
+if [ "$1" -eq 0 ]; then
+ %service mysql-mmm-agent stop
+ /sbin/chkconfig --del mysql-mmm-agent
+fi
+
+%preun monitor
+if [ "$1" -eq 0 ]; then
+ %service mysql-mmm-monitor stop
+ /sbin/chkconfig --del mysql-mmm-monitor
fi
%files
%defattr(644,root,root,755)
-%doc CHANGES INSTALL README VERSION
-%config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/mmm
-%attr(754,root,root) /etc/rc.d/init.d/mmm_agent
-%attr(754,root,root) /etc/rc.d/init.d/mmm_mon
+%doc INSTALL README VERSION %{name}-%{version}.pdf
+%dir %{_sysconfdir}/mysql-mmm
+%config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/mysql-mmm
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/mmm_common.conf
+%{perl_vendorlib}/MMM/Common
+
+%dir %{_localstatedir}/lib/mysql-mmm
+%dir %{_localstatedir}/run/mysql-mmm
+%dir %{_localstatedir}/log/mysql-mmm
+
+%files tools
+%defattr(644,root,root,755)
+%doc README
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/mmm_tools.conf
%attr(755,root,root) %{_sbindir}/mmm_backup
%attr(755,root,root) %{_sbindir}/mmm_clone
-%attr(755,root,root) %{_sbindir}/mmm_control
-%attr(755,root,root) %{_sbindir}/mmm_get_dump
%attr(755,root,root) %{_sbindir}/mmm_restore
-%attr(755,root,root) %{_sbindir}/mmmd_agent
-%attr(755,root,root) %{_sbindir}/mmmd_angel
-%attr(755,root,root) %{_sbindir}/mmmd_mon
-%{_mandir}/man1/mmm_backup.1*
-%{_mandir}/man1/mmm_clone.1*
-%{_mandir}/man1/mmm_control.1*
-%{_mandir}/man1/mmm_get_dump.1*
-%{_mandir}/man1/mmm_restore.1*
-%{_mandir}/man1/mmmd_agent.1*
-%{_mandir}/man1/mmmd_angel.1*
-%{_mandir}/man1/mmmd_mon.1*
-
-%dir %{_appdir}
-%{_appdir}/lib
-%dir %{_appdir}/sbin
-%attr(755,root,root) %{_appdir}/sbin/*
-
-%dir %{_appdir}/bin
-%dir %{_appdir}/bin/agent
-%dir %{_appdir}/bin/check
-%dir %{_appdir}/bin/lvm
-%dir %{_appdir}/bin/sys
-%attr(755,root,root) %{_appdir}/bin/agent/add_role
-%attr(755,root,root) %{_appdir}/bin/agent/check_role
-%attr(755,root,root) %{_appdir}/bin/agent/del_role
-%attr(755,root,root) %{_appdir}/bin/agent/set_active_master
-%attr(755,root,root) %{_appdir}/bin/agent/set_state
-%attr(755,root,root) %{_appdir}/bin/check/checker
-%attr(755,root,root) %{_appdir}/bin/check_ip
-%attr(755,root,root) %{_appdir}/bin/clear_ip
-%attr(755,root,root) %{_appdir}/bin/limit_run
-%attr(755,root,root) %{_appdir}/bin/lvm/create_snapshot
-%attr(755,root,root) %{_appdir}/bin/lvm/remove_snapshot
-%attr(755,root,root) %{_appdir}/bin/mysql_allow_write
-%attr(755,root,root) %{_appdir}/bin/mysql_deny_write
-%attr(755,root,root) %{_appdir}/bin/sync_with_master
-#%attr(755,root,root) %{_appdir}/bin/sys/fping
-#%attr(755,root,root) %{_appdir}/bin/sys/send_arp
-%attr(755,root,root) %{_appdir}/bin/turn_off_slave
-%attr(755,root,root) %{_appdir}/bin/turn_on_slave
+%{perl_vendorlib}/MMM/Tools
+%{_libdir}/%{name}/tools
-%{_examplesdir}/%{name}-%{version}
+%files agent
+%defattr(644,root,root,755)
+%doc README
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/mmm_agent.conf
+%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-mmm-agent
+%attr(754,root,root) /etc/rc.d/init.d/mysql-mmm-agent
+%attr(755,root,root) %{_sbindir}/mmm_agentd
+%{perl_vendorlib}/MMM/Agent
+%{_libdir}/%{name}/agent
+
+%files monitor
+%defattr(644,root,root,755)
+%doc README
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/mmm_mon.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/mmm_mon_log.conf
+%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mysql-mmm-monitor
+%attr(754,root,root) /etc/rc.d/init.d/mysql-mmm-monitor
+%attr(755,root,root) %{_sbindir}/mmm_mond
+%attr(755,root,root) %{_sbindir}/mmm_control
+%{perl_vendorlib}/MMM/Monitor
+%{_libdir}/%{name}/monitor
%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
%changelog
@@ -157,5 +204,6 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
-Revision 1.1 2010/10/05 15:50:25 glen
-- new, based on bundled .spec
+Revision 1.2 2010/10/06 07:50:34 glen
+- re-init package, from fc spec, version 2.2.1
+
================================================================
Index: packages/mysql-mmm/mmm_agent.conf
diff -u /dev/null packages/mysql-mmm/mmm_agent.conf:1.1
--- /dev/null Wed Oct 6 09:50:40 2010
+++ packages/mysql-mmm/mmm_agent.conf Wed Oct 6 09:50:34 2010
@@ -0,0 +1,6 @@
+include mmm_common.conf
+
+# The 'this' variable refers to this server. Proper operation requires
+# that 'this' server (db1 by default), as well as all other servers, have the
+# proper IP addresses set in mmm_common.conf.
+this db1
================================================================
Index: packages/mysql-mmm/mmm_common.conf
diff -u /dev/null packages/mysql-mmm/mmm_common.conf:1.1
--- /dev/null Wed Oct 6 09:50:40 2010
+++ packages/mysql-mmm/mmm_common.conf Wed Oct 6 09:50:34 2010
@@ -0,0 +1,40 @@
+active_master_role writer
+
+<host default>
+ cluster_interface eth0
+ pid_path /var/run/mysql-mmm/mmm_agentd.pid
+ bin_path /usr/libexec/mysql-mmm/
+ replication_user replicant
+ replication_password slave
+ agent_user mmm_agent
+ agent_password RepAgent
+</host>
+
+<host db1>
+ ip 192.168.100.49
+ mode master
+ peer db2
+</host>
+
+<host db2>
+ ip 192.168.100.50
+ mode master
+ peer db1
+</host>
+
+#<host db3>
+# ip 192.168.100.51
+# mode slave
+#</host>
+
+<role writer>
+ hosts db1, db2
+ ips 192.168.100.250
+ mode exclusive
+</role>
+
+<role reader>
+ hosts db1, db2
+ ips 192.168.100.251, 192.168.100.252
+ mode balanced
+</role>
================================================================
Index: packages/mysql-mmm/mmm_mon.conf
diff -u /dev/null packages/mysql-mmm/mmm_mon.conf:1.1
--- /dev/null Wed Oct 6 09:50:40 2010
+++ packages/mysql-mmm/mmm_mon.conf Wed Oct 6 09:50:34 2010
@@ -0,0 +1,24 @@
+include mmm_common.conf
+
+<monitor>
+ ip 127.0.0.1
+ pid_path /var/run/mysql-mmm/mmm_mond.pid
+ bin_path /usr/libexec/mysql-mmm
+ status_path /var/lib/mysql-mmm/mmm_mond.status
+ ping_ips 192.168.100.50
+ auto_set_online 60
+
+ # The kill_host_bin does not exist by default, though the monitor will
+ # throw a warning about it missing. See the section 5.10 "Kill Host
+ # Functionality" in the PDF documentation.
+ #
+ # kill_host_bin /usr/libexec/mysql-mmm/monitor/kill_host
+ #
+</monitor>
+
+<host default>
+ monitor_user mmm_monitor
+ monitor_password RepMonitor
+</host>
+
+debug 0
================================================================
Index: packages/mysql-mmm/mmm_mon_log.conf
diff -u /dev/null packages/mysql-mmm/mmm_mon_log.conf:1.1
--- /dev/null Wed Oct 6 09:50:40 2010
+++ packages/mysql-mmm/mmm_mon_log.conf Wed Oct 6 09:50:34 2010
@@ -0,0 +1,18 @@
+#log4perl.logger = FATAL, MMMLog, MailFatal
+log4perl.logger = FATAL, MMMLog
+
+log4perl.appender.MMMLog = Log::Log4perl::Appender::File
+log4perl.appender.MMMLog.Threshold = INFO
+log4perl.appender.MMMLog.filename = /var/log/mysql-mmm/mmm_mond.log
+log4perl.appender.MMMLog.recreate = 1
+log4perl.appender.MMMLog.layout = PatternLayout
+log4perl.appender.MMMLog.layout.ConversionPattern = %d %5p %m%n
+
+#log4perl.appender.MailFatal = Log::Dispatch::Email::MailSender
+#log4perl.appender.MailFatal.Threshold = FATAL
+#log4perl.appender.MailFatal.from = mmm at example.com
+#log4perl.appender.MailFatal.to = root
+#log4perl.appender.MailFatal.buffered = 0
+#log4perl.appender.MailFatal.subject = FATAL error in mysql-mmm-monitor
+#log4perl.appender.MailFatal.layout = PatternLayout
+#log4perl.appender.MailFatal.layout.ConversionPattern = %d %m%n
================================================================
Index: packages/mysql-mmm/mmm_tools.conf
diff -u /dev/null packages/mysql-mmm/mmm_tools.conf:1.1
--- /dev/null Wed Oct 6 09:50:40 2010
+++ packages/mysql-mmm/mmm_tools.conf Wed Oct 6 09:50:34 2010
@@ -0,0 +1,43 @@
+include mmm_agent.conf
+
+default_copy_method scp
+clone_dirs data, logs
+
+<host default>
+ ssh_user root
+
+ lvm_snapshot_size 1G
+ lvm_logical_volume mysql
+ lvm_volume_group storage
+ lvm_mount_dir /mmm_snapshot
+ lvm_mount_opts -orw,nouuid
+
+ tools_user mmm_tools
+ tools_password RepTools
+
+ backup_dir /mmm_backup
+ restore_dir /mysql
+</host>
+
+
+<copy_method scp>
+ backup_command scp -c blowfish -r %SSH_USER%@%IP%:%SNAPSHOT%/%CLONE_DIR% %DEST_DIR%/
+ restore_command cp -axv %BACKUP_DIR%/* %DEST_DIR%/
+ true_copy 1
+</copy_method>
+
+<copy_method rdiff>
+ backup_command rdiff-backup --ssh-no-compression -v 5 !--include %SNAPSHOT%/%CLONE_DIR%! --exclude %SNAPSHOT% %SSH_USER%@%IP%::%SNAPSHOT%/ %DEST_DIR%/
+ restore_command rdiff-backup --force -v 5 -r %VERSION% %BACKUP_DIR% %DEST_DIR%/.mmm_restore; cp -axvl --remove-destination %DEST_DIR%/.mmm_restore/* %DEST_DIR%/; rm -r %DEST_DIR%/.mmm_restore/
+ incremental_command rdiff-backup --parsable-output -l %BACKUP_DIR%
+ single_run 1
+ incremental 1
+</copy_method>
+
+<copy_method ssh-gz>
+ backup_command ssh -c blowfish %SSH_USER%@%IP% "cd '%SNAPSHOT%'; tar cv !'%CLONE_DIR%'!" | gzip > %DEST_DIR%/backup.tar.gz
+ restore_command cd %DEST_DIR%; tar xzfv %BACKUP_DIR%/backup.tar.gz
+ single_run 1
+</copy_method>
+
+
================================================================
Index: packages/mysql-mmm/mysql-mmm-agent.init
diff -u /dev/null packages/mysql-mmm/mysql-mmm-agent.init:1.1
--- /dev/null Wed Oct 6 09:50:40 2010
+++ packages/mysql-mmm/mysql-mmm-agent.init Wed Oct 6 09:50:34 2010
@@ -0,0 +1,81 @@
+#!/bin/sh
+#
+# mysql-mmm-agent This shell script takes care of starting and stopping
+# the mmm agent daemon.
+#
+# chkconfig: - 64 36
+# description: MMM Agent.
+# processname: mmm_agentd
+# config: /etc/mysql-mmm/mmm_agent.conf
+# pidfile: /var/run/mysql-mmm/mmm_agentd.pid
+
+# Source function library and defaults file.
+. /etc/rc.d/init.d/functions
+. /etc/default/mysql-mmm-agent
+
+# Paths
+MMMD_AGENT_BIN="/usr/sbin/mmm_agentd"
+MMMD_AGENT_PIDFILE="/var/run/mysql-mmm/mmm_agentd.pid"
+LOCKFILE='/var/lock/subsys/mysql-mmm-agent'
+prog='MMM Agent Daemon'
+
+
+start() {
+ if [ "${ENABLED}" != "1" ]; then
+ echo "$prog is disabled!"
+ exit 1
+ fi
+
+ echo -n "Starting $prog: "
+ if [ -s $MMMD_AGENT_PIDFILE ] && kill -0 `cat $MMMD_AGENT_PIDFILE` 2> /dev/null; then
+ echo " already running."
+ exit 0
+ fi
+ daemon $MMMD_AGENT_BIN
+ RETVAL=$?
+ echo
+ [ $RETVAL = 0 ] && touch $LOCKFILE
+ return $RETVAL
+}
+
+stop() {
+ # Stop daemon.
+ echo -n "Stopping $prog: "
+ killproc -p $MMMD_AGENT_PIDFILE $MMMD_AGENT_BIN
+ RETVAL=$?
+ echo
+ [ $RETVAL = 0 ] && rm -f $LOCKFILE
+ return $RETVAL
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+
+ stop)
+ stop
+ ;;
+
+ status)
+ status -p $MMMD_AGENT_PIDFILE $MMMD_AGENT_BIN
+ RETVAL=$?
+ ;;
+
+ restart|reload)
+ stop
+ start
+ ;;
+
+ condrestart)
+ if [ -f $LOCKFILE ]; then
+ stop
+ start
+ fi
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|condrestart|status}"
+ ;;
+esac
+
+exit $RETVAL
================================================================
Index: packages/mysql-mmm/mysql-mmm-monitor.init
diff -u /dev/null packages/mysql-mmm/mysql-mmm-monitor.init:1.1
--- /dev/null Wed Oct 6 09:50:40 2010
+++ packages/mysql-mmm/mysql-mmm-monitor.init Wed Oct 6 09:50:34 2010
@@ -0,0 +1,86 @@
+#!/bin/sh
+#
+# mysql-mmm-monitor This shell script takes care of starting and stopping
+# the mmm monitoring daemon.
+#
+# chkconfig: - 64 36
+# description: MMM Monitor.
+# processname: mmm_mond
+# config: /etc/mysql-mmm/mmm_mon.conf
+# pidfile: /var/run/mysql-mmm/mmm_mond.pid
<<Diff was trimmed, longer than 597 lines>>
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/mysql-mmm/mysql-mmm.spec?r1=1.1&r2=1.2&f=u
More information about the pld-cvs-commit
mailing list