[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-dev
Subject:    Re: [asterisk-dev] systemd sd_notify() [was: Re: Journald support for Asterisk]
From:       Matthew Jordan <mjordan () digium ! com>
Date:       2015-05-13 1:24:32
Message-ID: CAN2PU+7-JkSTN7N_-EdgD1wyv2YiSyZ9A9Xz-Gc6kch_xtsYRg () mail ! gmail ! com
[Download RAW message or body]

On Sun, May 10, 2015 at 3:03 AM, Tzafrir Cohen <tzafrir.cohen@xorcom.com> wrote:
> On Sat, May 09, 2015 at 10:17:24AM +0200, Ludovic Gasc wrote:
>> Hi,
>>
>> Systemd and Journald is now by default on Debian Jessie and Ubuntu 15.04,
>> as on RHEL/CentOS.
>> Journald supports syslog format, nevertheless, at least for us, the
>> structured log system provided with journald helps us to debug the
>> production.
>
> Slightly off-topic: if anybody wants to implement support for
> sd_notify(3)[1] in Asterisk, it would be nice.
>
> Suppose there would be a function called ast_daemon_changed_state()[2] to
> notify journald on end of start, start/end of reload and start of end.
> Is this information useful to anything else besides notifying systemd
> via sd_notify()?
>
> [1] http://www.freedesktop.org/software/systemd/man/sd_notify.html
>
> [2] Bad name, I know.

I'm not sure I'd create a new C API for this. Asterisk already uses
Stasis to convey a lot of this information, although today, it is only
consumed by AMI. The right way to do this would be to pull the
messages out of the manager topic and make them a bit more publicly
consumable. If that is done, you could then have a completely
independent external module that interfaces with systemd.

Since there isn't a reload start/stop, there'd have to be at least one
new message added as well.

The messages to look at are:

The publishing of Reload in loader.c::publish_reload_message
The publishing of FullyBooted in asterisk.c::publish_fully_booted
The publishing of Shutdown in asterisk.c::really_quit

-- 
Matthew Jordan
Digium, Inc. | Director of Technology
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic