Modified: trunk/CHANGES
===================================================================
--- trunk/CHANGES 2013-08-16 11:45:07 UTC (rev 13332)
+++ trunk/CHANGES 2013-08-16 12:37:53 UTC (rev 13333)
@@ -30,7 +30,6 @@
Changed Opsview Agent/NRPE's pid file directory to /var/tmp to support Solaris zones
Improved Opspack install process to always copy plugins and retry next time for conflicts
Speed up reload configuration generation by 25% when using lots of attributes
- Added Ubuntu Upstart support. Also fixes audit log errors when MySQL is stopped before Opsview
Ensure ospview-agent, opsview and opsview-web init.d scripts conform much better to standards
NOTICES:
On Ubuntu, MySQL must be running for Opsview to start up on a reboot
Deleted: trunk/opsview-core/bin/opsview_daemon
===================================================================
--- trunk/opsview-core/bin/opsview_daemon 2013-08-16 11:45:07 UTC (rev 13332)
+++ trunk/opsview-core/bin/opsview_daemon 2013-08-16 12:37:53 UTC (rev 13333)
@@ -1,21 +0,0 @@
-#!/bin/bash
-
-# Foreground daemon that waits to catch SIGTERM to stop Opsview. Primarily for
-# Ubuntu's Upstart.
-
-LOG='/var/log/opsview/upstart'
-
-function stop_opsview {
- echo "TERMINATE signal detected, stopping Opsview" >> $LOG
- /usr/local/nagios/bin/rc.opsview stop
- exit
-}
-
-trap stop_opsview TERM
-
-echo "Starting Opsview" >> $LOG
-/usr/local/nagios/bin/rc.opsview start &
-
-while true; do
- sleep 100d
-done
Modified: trunk/opsview-core/debian/postinst
===================================================================
--- trunk/opsview-core/debian/postinst 2013-08-16 11:45:07 UTC (rev 13332)
+++ trunk/opsview-core/debian/postinst 2013-08-16 12:37:53 UTC (rev 13333)
@@ -105,7 +105,7 @@
# send2slaves to update slaves with new opsview code
su - nagios -c '/usr/local/nagios/bin/send2slaves'
- echo "Updating plugin help information - there may be warnings here but they can be ignored"
+ echo "Updating plugin help information - there maybe warnings here but they can be ignored"
su - nagios -c '/usr/local/nagios/bin/populate_db.pl'
}
@@ -132,34 +132,22 @@
echo "Running common postinstall tasks"
test -f /usr/local/nagios/installer/postinstall_root && /usr/local/nagios/installer/postinstall_root 3>/dev/null
test -f /usr/local/nagios/installer/postinstall && su - nagios -c '/usr/local/nagios/installer/postinstall' 3>/dev/null
-
- if lsb_release -i | grep -q Ubuntu; then
- echo "Configuring Upstart"
- # Remove current startup and shutdown scripts from init.
- rm -f /etc/init.d/opsview
- update-rc.d opsview remove
- # Create Upstart files.
- cp /usr/local/nagios/installer/opsview-upstart-init.d /etc/init.d/opsview
- ln -s /lib/init/upstart-job /etc/init.d/opsview-upstart
- cp /usr/local/nagios/installer/opsview-upstart.conf /etc/init/opsview-upstart.conf
- fi
-
return 0
}
case "$1" in
install)
- ;;
+ ;;
upgrade)
- ;;
+ ;;
# We now create databases altogether. It used to be checked individually, but
# that is different from all the instructions we have for other platforms
configure)
set_profile || die "Cannot set_profile"
-
+
# Flag to determine if opsview already exists
# This is required because otherwise deinstallation of a package and then
# reinstallation will wipe all the current data, which is dangerous
Modified: trunk/opsview-core/debian/prerm
===================================================================
--- trunk/opsview-core/debian/prerm 2013-08-16 11:45:07 UTC (rev 13332)
+++ trunk/opsview-core/debian/prerm 2013-08-16 12:37:53 UTC (rev 13333)
@@ -20,9 +20,6 @@
if test -f /usr/local/nagios/installer/preremove ; then
su - nagios -c '/usr/local/nagios/installer/preremove' 3>/dev/null
fi
- # Remove Ubuntu Upstart's control file
- # Must use -f, otherwise set -e causes a script failure
- rm -f /etc/init/opsview-upstart.conf /etc/init.d/opsview /etc/init.d/opsview-upstart 2> /dev/null
}
case "$1" in
Modified: trunk/opsview-core/debian/rules
===================================================================
--- trunk/opsview-core/debian/rules 2013-08-16 11:45:07 UTC (rev 13332)
+++ trunk/opsview-core/debian/rules 2013-08-16 12:37:53 UTC (rev 13333)
@@ -30,7 +30,7 @@
build: build-stamp
-build-stamp: configure-stamp
+build-stamp: configure-stamp
dh_testdir
# Add here commands to compile the package.
@@ -47,12 +47,12 @@
# Add here commands to clean up after the build process.
# -$(MAKE) clean
- dh_clean
+ dh_clean
install: build
dh_testdir
dh_testroot
- dh_clean -k
+ dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/opsview-core.
@@ -67,23 +67,19 @@
binary-arch: build install
dh_testdir
dh_testroot
- dh_installchangelogs
+ dh_installchangelogs
dh_installdocs
dh_installexamples
# dh_install
# dh_installmenu
- dh_installdebconf
+ dh_installdebconf
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_python
# have to ensure opsview is stopped before mysql
- # Only dh_installinit on Debian. We have other rules (in postinst) for
- # Ubuntu.
- if lsb_release -i | grep -q Debian; then \
- dh_installinit --init-script="opsview.init" --name='opsview' --update-rcd-params="defaults 85 12"; \
- fi
+ dh_installinit --init-script="opsview.init" --name='opsview' --update-rcd-params="defaults 85 12"
dh_installinit --init-script='opsview-agent.init' --name='opsview-agent' --update-rcd-params="defaults 86 11"
dh_installcron --name='opsview'
# dh_installinfo
Modified: trunk/opsview-core/filelist
===================================================================
--- trunk/opsview-core/filelist 2013-08-16 11:45:07 UTC (rev 13332)
+++ trunk/opsview-core/filelist 2013-08-16 12:37:53 UTC (rev 13333)
@@ -30,7 +30,6 @@
f nagios:nagios 0750 /usr/local/nagios/bin/nlcat bin/nlcat
f nagios:nagios 0750 /usr/local/nagios/bin/nrd bin/nrd
f nagios:nagios 0750 /usr/local/nagios/bin/opsview_api bin/opsview_api
-f nagios:nagios 0750 /usr/local/nagios/bin/opsview_daemon bin/opsview_daemon
f nagios:nagios 0750 /usr/local/nagios/bin/opsview_rest bin/opsview_rest
f nagios:nagios 0750 /usr/local/nagios/bin/opsview_diag bin/opsview_diag
f nagios:nagios 0750 /usr/local/nagios/bin/opsview_master_housekeep bin/opsview_master_housekeep
@@ -657,8 +656,6 @@
f nagios:nagios 0555 /usr/local/nagios/installer/migrate_rrds installer/migrate_rrds
f nagios:nagios 0555 /usr/local/nagios/installer/nagios_3-4_servicechecks.pl installer/nagios_3-4_servicechecks.pl
f nagios:nagios 0555 /usr/local/nagios/installer/opsview_preupgrade_check installer/opsview_preupgrade_check
-f nagios:nagios 0644 /usr/local/nagios/installer/opsview-upstart.conf installer/opsview-upstart.conf
-f nagios:nagios 0755 /usr/local/nagios/installer/opsview-upstart-init.d installer/opsview-upstart-init.d
f root:nagios 0550 /usr/local/nagios/installer/postinstall_root installer/postinstall_root
f nagios:nagios 0550 /usr/local/nagios/installer/postinstall installer/postinstall
f root:nagios 0555 /usr/local/nagios/installer/preremove installer/preremove
Deleted: trunk/opsview-core/installer/opsview-upstart-init.d
===================================================================
--- trunk/opsview-core/installer/opsview-upstart-init.d 2013-08-16 11:45:07 UTC (rev 13332)
+++ trunk/opsview-core/installer/opsview-upstart-init.d 2013-08-16 12:37:53 UTC (rev 13333)
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-case "$1" in
- stop|start|restart)
- /etc/init.d/opsview-upstart "$@"
- ;;
- *)
- /usr/local/nagios/bin/rc.opsview "$@"
- ;;
-esac
Deleted: trunk/opsview-core/installer/opsview-upstart.conf
===================================================================
--- trunk/opsview-core/installer/opsview-upstart.conf 2013-08-16 11:45:07 UTC (rev 13332)
+++ trunk/opsview-core/installer/opsview-upstart.conf 2013-08-16 12:37:53 UTC (rev 13333)
@@ -1,22 +0,0 @@
-# opsview service for Ubuntu's Upstart
-
-description "Opsview server"
-author "Opsview Ltd."
-
-start on runlevel [2345] or started JOB=mysql
-stop on starting rc RUNLEVEL=[016] or stopping JOB=mysql
-
-expect fork
-kill timeout 300
-respawn limit 2 5
-
-pre-start script
- if [ ! -r /var/run/mysqld/mysqld.pid ]; then
- echo "MySQL needs to be running" >> /var/log/opsview/upstart
- exit 1
- fi
-end script
-
-script
- /usr/local/nagios/bin/opsview_daemon
-end script
Modified: trunk/opsview-web/Makefile
===================================================================
--- trunk/opsview-web/Makefile 2013-08-16 11:45:07 UTC (rev 13332)
+++ trunk/opsview-web/Makefile 2013-08-16 12:37:53 UTC (rev 13333)
@@ -24,7 +24,7 @@
NAGIOS_USER=nagios
NAGIOS_GROUP=nagios
-FILES = bin installer lib root script Makefile.PL opsview_web.yml README etc
+FILES = bin lib root script Makefile.PL opsview_web.yml README etc
all: opsview_web.yml
Deleted: trunk/opsview-web/bin/opsview-web_daemon
===================================================================
--- trunk/opsview-web/bin/opsview-web_daemon 2013-08-16 11:45:07 UTC (rev 13332)
+++ trunk/opsview-web/bin/opsview-web_daemon 2013-08-16 12:37:53 UTC (rev 13333)
@@ -1,21 +0,0 @@
-#!/bin/bash
-
-# Foreground daemon that waits to catch SIGTERM to stop Opsview's web server.
-# Primarily for Ubuntu's Upstart.
-
-LOG='/var/log/opsview/upstart'
-
-function stop_opsview_web {
- echo "TERMINATE signal detected, stopping opsview-web" >> $LOG
- /usr/local/opsview-web/bin/opsview-web stop
- exit
-}
-
-trap stop_opsview_web TERM
-
-echo "Starting opsview-web" >> $LOG
-/usr/local/opsview-web/bin/opsview-web start &
-
-while true; do
- sleep 100d
-done
Deleted: trunk/opsview-web/debian/postinst
===================================================================
--- trunk/opsview-web/debian/postinst 2013-08-16 11:45:07 UTC (rev 13332)
+++ trunk/opsview-web/debian/postinst 2013-08-16 12:37:53 UTC (rev 13333)
@@ -1,76 +0,0 @@
-#!/bin/sh
-# postinst script for opsview-web
-#
-# see: dh_installdeb(1)
-#
-# AUTHORS:
-# Copyright (C) 2003-2013 Opsview Limited. All rights reserved
-#
-# This file is part of Opsview
-#
-# Opsview is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# Opsview is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Opsview; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-set -e
-
-# Include debconf
-. /usr/share/debconf/confmodule
-
-# summary of how this script can be called:
-# * <postinst> `configure' <most-recently-configured-version>
-# * <old-postinst> `abort-upgrade' <new version>
-# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
-# <new-version>
-# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
-# <failed-install-package> <version> `removing'
-# <conflicting-package> <version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-die() {
- echo $1
- exit 1
-}
-
-case "$1" in
-
- configure)
- if lsb_release -i | grep -q Ubuntu; then
- echo "Configuring Upstart"
- # Remove current startup and shutdown scripts from init.
- rm -f /etc/init.d/opsview-web
- update-rc.d opsview-web remove
- # Create Upstart files.
- cp /usr/local/opsview-web/installer/opsview-web-upstart-init.d /etc/init.d/opsview-web
- ln -s /lib/init/upstart-job /etc/init.d/opsview-web-upstart
- cp /usr/local/opsview-web/installer/opsview-web-upstart.conf /etc/init/opsview-web-upstart.conf
- fi
- ;;
-
- install|upgrade|abort-upgrade|abort-remove|abort-deconfigure)
- ;;
-
- *)
- echo "postinst called with unknown argument \`$1'" >&2
- exit 1
- ;;
-
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
Modified: trunk/opsview-web/debian/prerm
===================================================================
--- trunk/opsview-web/debian/prerm 2013-08-16 11:45:07 UTC (rev 13332)
+++ trunk/opsview-web/debian/prerm 2013-08-16 12:37:53 UTC (rev 13333)
@@ -25,23 +25,12 @@
set -e
-if [ -f /usr/local/opsview-web/bin/opsview-web ]; then
- /usr/local/opsview-web/bin/opsview-web stop || true
-fi
-
case "$1" in
-
- remove|deconfigure|upgrade)
- # Remove Ubuntu Upstart's files.
- rm -f /etc/init/opsview-web-upstart.conf /etc/init.d/opsview-web /etc/init.d/opsview-web-upstart 2> /dev/null
- ;;
-
- failed-upgrade)
- ;;
-
*)
- ;;
-
+ if [ -f /usr/local/opsview-web/bin/opsview-web ]; then
+ /usr/local/opsview-web/bin/opsview-web stop || true
+ fi
+ ;;
esac
@@ -51,3 +40,4 @@
#DEBHELPER#
exit 0
+
Modified: trunk/opsview-web/debian/rules
===================================================================
--- trunk/opsview-web/debian/rules 2013-08-16 11:45:07 UTC (rev 13332)
+++ trunk/opsview-web/debian/rules 2013-08-16 12:37:53 UTC (rev 13333)
@@ -10,7 +10,7 @@
install:
dh_testdir
dh_testroot
- dh_clean -k
+ dh_clean -k
$(MAKE) install-perms DESTDIR=$(CURDIR)/debian/opsview-web
@@ -22,9 +22,7 @@
dh_installdocs
#dh_installdefoma
# have to ensure web is stopped before mysql
- if lsb_release -is | grep -q Debian; then \
- dh_installinit --init-script="opsview-web.init" --name="opsview-web" --update-rcd-params="defaults 90 10"; \
- fi
+ dh_installinit --init-script="opsview-web.init" --name="opsview-web" --update-rcd-params="defaults 90 10"
dh_compress
#dh_fixperms
dh_installdeb
Property changes on: trunk/opsview-web/installer/opsview-web-upstart-init.d
___________________________________________________________________
Deleted: svn:executable
- *
Modified: trunk/opsview-web/installer/opsview-web-upstart.conf
===================================================================
--- trunk/opsview-web/installer/opsview-web-upstart.conf 2013-08-16 11:45:07 UTC (rev 13332)
+++ trunk/opsview-web/installer/opsview-web-upstart.conf 2013-08-16 12:37:53 UTC (rev 13333)
@@ -11,10 +11,12 @@
respawn limit 2 5
pre-start script
- if ! ( pgrep -x '(nagios|opsviewd|rc.opsview)' > /dev/null ); then
+ bash -- <<EOS
+ if [[ ! $( pgrep -x '(nagios|opsviewd|rc.opsview)' ) ]]; then
echo "Opsview needs to be running" >> /var/log/opsview/upstart
exit 1
fi
+EOS
end script
script