We currently have an older release of icinga2 (2.2.1) in ports because subsequent releases don't startup correctly on OpenBSD - hanging after printing "information/DynamicObject: Restoring program state from file ..." apparently in the ParallelWorkQueue constructor (called from DynamicObject::RestoreObjects() in lib/base/dynamicobject.cpp).
My c++/threads/boost debugging skills are mostly nonexistent at present so I haven't gone investigated that further (and apart from anything else I'm unsure whether I should be looking in Icinga's direction or the OS), but I've noticed that this hang doesn't seem to occur for me if icinga2 is started without the -d flag to daemonize. Does anyone else have an icinga2 installation on OpenBSD they could test to see what happens for them with this? It takes a fair while to build, so I'm copying packages for -current amd64 to http://junkpile.org/i2-224/ in case that makes testing easier. Index: Makefile =================================================================== RCS file: /cvs/ports/net/icinga/core2/Makefile,v retrieving revision 1.24 diff -u -p -r1.24 Makefile --- Makefile 20 Jan 2015 18:42:38 -0000 1.24 +++ Makefile 5 Feb 2015 22:09:05 -0000 @@ -1,14 +1,13 @@ # $OpenBSD: Makefile,v 1.24 2015/01/20 18:42:38 landry Exp $ SHARED_ONLY = Yes -BROKEN-hppa = undefined reference to `__sync_add_and_fetch_4' when linking icinga2 +BROKEN-hppa = undefined reference to __sync_add_and_fetch_4 when linking icinga2 COMMENT-main = network monitoring system COMMENT-mysql = MySQL support for icinga2 COMMENT-pgsql = PostgreSQL support for icinga2 -V = 2.2.1 +V = 2.2.4 EPOCH = 0 -REVISION-main = 0 GH_ACCOUNT = Icinga GH_PROJECT = icinga2 GH_TAGNAME = v$V Index: distinfo =================================================================== RCS file: /cvs/ports/net/icinga/core2/distinfo,v retrieving revision 1.6 diff -u -p -r1.6 distinfo --- distinfo 4 Jan 2015 21:32:24 -0000 1.6 +++ distinfo 5 Feb 2015 22:09:05 -0000 @@ -1,2 +1,2 @@ -SHA256 (icinga2-2.2.1.tar.gz) = Pa9zswz+ymspyMpxXABrTmEjJBZaBYPrBypR0JJe6m0= -SIZE (icinga2-2.2.1.tar.gz) = 683579 +SHA256 (icinga2-2.2.4.tar.gz) = AynnrRDlcWQHZT63PCVFYWpjPXpwxrf8wt+ZUxae6ao= +SIZE (icinga2-2.2.4.tar.gz) = 691978 Index: patches/patch-etc_icinga2_scripts_mail-host-notification_sh =================================================================== RCS file: /cvs/ports/net/icinga/core2/patches/patch-etc_icinga2_scripts_mail-host-notification_sh,v retrieving revision 1.1 diff -u -p -r1.1 patch-etc_icinga2_scripts_mail-host-notification_sh --- patches/patch-etc_icinga2_scripts_mail-host-notification_sh 19 Jun 2014 23:33:09 -0000 1.1 +++ patches/patch-etc_icinga2_scripts_mail-host-notification_sh 5 Feb 2015 22:09:05 -0000 @@ -1,9 +1,9 @@ $OpenBSD: patch-etc_icinga2_scripts_mail-host-notification_sh,v 1.1 2014/06/19 23:33:09 sthen Exp $ ---- etc/icinga2/scripts/mail-host-notification.sh.orig Thu Jun 19 14:50:37 2014 -+++ etc/icinga2/scripts/mail-host-notification.sh Thu Jun 19 14:50:46 2014 +--- etc/icinga2/scripts/mail-host-notification.sh.orig Thu Feb 5 10:15:24 2015 ++++ etc/icinga2/scripts/mail-host-notification.sh Thu Feb 5 18:17:05 2015 @@ -1,4 +1,4 @@ --#!/usr/bin/env bash +-#!/bin/sh +#!/bin/ksh - template=$(cat <<TEMPLATE + template=`cat <<TEMPLATE ***** Icinga ***** Index: patches/patch-etc_icinga2_scripts_mail-service-notification_sh =================================================================== RCS file: patches/patch-etc_icinga2_scripts_mail-service-notification_sh diff -N patches/patch-etc_icinga2_scripts_mail-service-notification_sh --- patches/patch-etc_icinga2_scripts_mail-service-notification_sh 19 Jun 2014 23:33:09 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,9 +0,0 @@ -$OpenBSD: patch-etc_icinga2_scripts_mail-service-notification_sh,v 1.1 2014/06/19 23:33:09 sthen Exp $ ---- etc/icinga2/scripts/mail-service-notification.sh.orig Thu Jun 19 14:51:56 2014 -+++ etc/icinga2/scripts/mail-service-notification.sh Thu Jun 19 14:52:03 2014 -@@ -1,4 +1,4 @@ --#!/usr/bin/env bash -+#!/bin/ksh - template=$(cat <<TEMPLATE - ***** Icinga ***** - Index: patches/patch-icinga-app_icinga_cpp =================================================================== RCS file: patches/patch-icinga-app_icinga_cpp diff -N patches/patch-icinga-app_icinga_cpp --- patches/patch-icinga-app_icinga_cpp 22 Nov 2014 00:14:05 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,19 +0,0 @@ -$OpenBSD: patch-icinga-app_icinga_cpp,v 1.1 2014/11/22 00:14:05 sthen Exp $ - -XXX Work around random crashes at program startup. Typically these -have a corrupt stack, but occasionally the backtrace includes -Application::SetResourceLimits or related functions. - ---- icinga-app/icinga.cpp.orig Fri Nov 21 23:49:09 2014 -+++ icinga-app/icinga.cpp Fri Nov 21 23:49:30 2014 -@@ -103,8 +103,10 @@ int Main(void) - - Application::SetStartTime(Utility::GetTime()); - -+#if 0 - if (!autocomplete) - Application::SetResourceLimits(); -+#endif - - /* Set thread title. */ - Utility::SetThreadName("Main Thread", false); Index: patches/patch-lib_base_stacktrace_cpp =================================================================== RCS file: /cvs/ports/net/icinga/core2/patches/patch-lib_base_stacktrace_cpp,v retrieving revision 1.3 diff -u -p -r1.3 patch-lib_base_stacktrace_cpp --- patches/patch-lib_base_stacktrace_cpp 22 Nov 2014 00:13:03 -0000 1.3 +++ patches/patch-lib_base_stacktrace_cpp 5 Feb 2015 22:09:05 -0000 @@ -1,15 +1,14 @@ $OpenBSD: patch-lib_base_stacktrace_cpp,v 1.3 2014/11/22 00:13:03 sthen Exp $ ---- lib/base/stacktrace.cpp.orig Mon Nov 17 09:52:21 2014 -+++ lib/base/stacktrace.cpp Thu Nov 20 20:03:27 2014 +--- lib/base/stacktrace.cpp.orig Fri Jan 9 13:46:07 2015 ++++ lib/base/stacktrace.cpp Fri Jan 16 19:52:21 2015 @@ -21,9 +21,9 @@ #include "base/utility.hpp" #include "base/initialize.hpp" -#ifdef HAVE_BACKTRACE_SYMBOLS --# include <execinfo.h> --#endif /* HAVE_BACKTRACE_SYMBOLS */ +#if Backtrace_FOUND -+# include <${Backtrace_HEADER}> + # include <execinfo.h> +-#endif /* HAVE_BACKTRACE_SYMBOLS */ +#endif /* Backtrace_FOUND */ using namespace icinga; Index: patches/patch-third-party_execvpe_execvpe_c =================================================================== RCS file: patches/patch-third-party_execvpe_execvpe_c diff -N patches/patch-third-party_execvpe_execvpe_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-third-party_execvpe_execvpe_c 5 Feb 2015 22:09:05 -0000 @@ -0,0 +1,12 @@ +$OpenBSD$ +--- third-party/execvpe/execvpe.c.orig Fri Jan 16 19:54:06 2015 ++++ third-party/execvpe/execvpe.c Fri Jan 16 19:54:31 2015 +@@ -17,7 +17,7 @@ + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +-#ifndef __FreeBSD__ ++#if !defined(__FreeBSD__) && !defined(__OpenBSD__) + #include <alloca.h> + #endif /* _FreeBSD__ */ + #include <unistd.h> Index: pkg/icinga2.rc =================================================================== RCS file: /cvs/ports/net/icinga/core2/pkg/icinga2.rc,v retrieving revision 1.2 diff -u -p -r1.2 icinga2.rc --- pkg/icinga2.rc 22 Nov 2014 00:13:03 -0000 1.2 +++ pkg/icinga2.rc 5 Feb 2015 22:09:05 -0000 @@ -2,13 +2,14 @@ # # $OpenBSD: icinga2.rc,v 1.2 2014/11/22 00:13:03 sthen Exp $ -daemon="${TRUEPREFIX}/sbin/icinga2 daemon -d" +daemon="${TRUEPREFIX}/sbin/icinga2 daemon" daemon_flags="" daemon_user="_icinga" . /etc/rc.d/rc.subr -pexp="${TRUEPREFIX}/sbin/icinga2.*daemon -d${daemon_flags:+ ${daemon_flags}}" +pexp="${TRUEPREFIX}/sbin/icinga2.*daemon${daemon_flags:+ ${daemon_flags}}" +rc_bg=YES rc_pre() { install -d -o ${daemon_user} /var/run/icinga2
