OpenNMS, dpkg packages and restarting after upgrades (and failing on SIGHUP)

4 messages Options
Embed this post
Permalink
Alex Bennee-3

OpenNMS, dpkg packages and restarting after upgrades (and failing on SIGHUP)

Reply Threaded More More options
Print post
Permalink
Hi,

I've been trying to track down a rather puzzling problem with the Debian OpenNMS
packages. The packages as provided shutdown OpenNMS in the prerm
scripts. However
there is no correspondent start in the postinst scripts. This means every time
a new package is shipped the service is stopped and has to be manually started
(or the server it's running on re-booted).

I added the following to opennms-server postinst:

        # Start opennms
        invoke-rc.d opennms start || :

Which does what you would expect. OpenNMS quite happily starts again. However I
noticed that OpenNMS was always dead after the end of apt's upgrade process.

Running strace I see:

root@vnms:/var/log# strace -p 11298
Process 11298 attached - interrupt to quit
futex(0x419a09e0, FUTEX_WAIT, 11443, NULL) = ? ERESTARTSYS (To be restarted)
--- SIGHUP (Hangup) @ 0 (0) ---
futex(0x7fc757b258a0, 0x81 /* FUTEX_??? */, 1) = 1
rt_sigreturn(0x7fc757b258a0)            = 202
futex(0x419a09e0, FUTEX_WAIT, 11443, NULL) = ? ERESTARTSYS (To be restarted)
PANIC: attached pid 11298 exited
Process 11298 detached

Which I can happily replicate with a manual kill -SIGHUP

Is this a feature of Java or OpenNMS? Is it intentional that a SIGHUP causes
OpenNMS to shutdown or have I stumbled onto a bug?

--
Alex, homepage: http://www.bennee.com/~alex/
http://www.half-llama.co.uk

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel
DJ Gregor-2

Re: OpenNMS, dpkg packages and restarting after upgrades (and failing on SIGHUP)

Reply Threaded More More options
Print post
Permalink
Neither Java nor OpenNMS handle a SIGHUP.  You have to use the OpenNMS
init script (e.g.: "/etc/init.d/opennms restart") to restart (or
otherwise control) OpenNMS.


On Wed, 09 Sep 2009 18:36 +0100, "Alex Bennee"
<[hidden email]> wrote:

> Hi,
>
> I've been trying to track down a rather puzzling problem with the Debian
> OpenNMS
> packages. The packages as provided shutdown OpenNMS in the prerm
> scripts. However
> there is no correspondent start in the postinst scripts. This means every
> time
> a new package is shipped the service is stopped and has to be manually
> started
> (or the server it's running on re-booted).
>
> I added the following to opennms-server postinst:
>
> # Start opennms
> invoke-rc.d opennms start || :
>
> Which does what you would expect. OpenNMS quite happily starts again.
> However I
> noticed that OpenNMS was always dead after the end of apt's upgrade
> process.
>
> Running strace I see:
>
> root@vnms:/var/log# strace -p 11298
> Process 11298 attached - interrupt to quit
> futex(0x419a09e0, FUTEX_WAIT, 11443, NULL) = ? ERESTARTSYS (To be
> restarted)
> --- SIGHUP (Hangup) @ 0 (0) ---
> futex(0x7fc757b258a0, 0x81 /* FUTEX_??? */, 1) = 1
> rt_sigreturn(0x7fc757b258a0)            = 202
> futex(0x419a09e0, FUTEX_WAIT, 11443, NULL) = ? ERESTARTSYS (To be
> restarted)
> PANIC: attached pid 11298 exited
> Process 11298 detached
>
> Which I can happily replicate with a manual kill -SIGHUP
>
> Is this a feature of Java or OpenNMS? Is it intentional that a SIGHUP
> causes
> OpenNMS to shutdown or have I stumbled onto a bug?
>
> --
> Alex, homepage: http://www.bennee.com/~alex/
> http://www.half-llama.co.uk
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day
> trial. Simplify your report design, integration and deployment - and
> focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Please read the OpenNMS Mailing List FAQ:
> http://www.opennms.org/index.php/Mailing_List_FAQ
>
> opennms-devel mailing list
>
> To *unsubscribe* or change your subscription options, see the bottom of
> this page:
> https://lists.sourceforge.net/lists/listinfo/opennms-devel

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel
Alex Bennee-3

Re: OpenNMS, dpkg packages and restarting after upgrades (and failing on SIGHUP)

Reply Threaded More More options
Print post
Permalink
2009/9/9 DJ Gregor <[hidden email]>:
> Neither Java nor OpenNMS handle a SIGHUP.  You have to use the OpenNMS
> init script (e.g.: "/etc/init.d/opennms restart") to restart (or
> otherwise control) OpenNMS.
>

I was using the invoke-rc.d script which should be using the init
script to start.
I'll try calling the init.d script directly.


--
Alex, homepage: http://www.bennee.com/~alex/
http://www.half-llama.co.uk

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel
Alex Bennee-3

Re: OpenNMS, dpkg packages and restarting after upgrades (and failing on SIGHUP)

Reply Threaded More More options
Print post
Permalink
In reply to this post by DJ Gregor-2
2009/9/9 DJ Gregor <[hidden email]>:
> Neither Java nor OpenNMS handle a SIGHUP.  You have to use the OpenNMS
> init script (e.g.: "/etc/init.d/opennms restart") to restart (or
> otherwise control) OpenNMS.

The invoke-rc.d script calls the standard /etc/init.d/opennms init
script. However the script doesn't seem to do anything in particular
to daemonise the process (i.e. not using the Debian daemon scripts).

However it seems that there is something special happening in the
apt-get upgrade process that causes the SIGHUP to get sent.

Has OpenNMS ever started itself in the Debian packages (it certainly
stops itself in the prerm script)? Or has manually restarting OpenNMS
after an upgrade always been the order of the day?

--
Alex, homepage: http://www.bennee.com/~alex/
http://www.half-llama.co.uk

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel