Re: [systemd-devel] tomcat start up script wait for message

2016-10-12 Thread Tyler Couto
Thank you for responding, Mantas. I haven’t gotten around to checking this out.

Tyler

From: Mantas Mikulėnas <graw...@gmail.com<mailto:graw...@gmail.com>>
Date: Tuesday, October 4, 2016 at 10:57 AM
To: Tyler Couto <tco...@certain.com<mailto:tco...@certain.com>>
Cc: 
"systemd-devel@lists.freedesktop.org<mailto:systemd-devel@lists.freedesktop.org>"
 
<systemd-devel@lists.freedesktop.org<mailto:systemd-devel@lists.freedesktop.org>>
Subject: Re: [systemd-devel] tomcat start up script wait for message

On Tue, Oct 4, 2016 at 8:32 PM, Tyler Couto 
<tco...@certain.com<mailto:tco...@certain.com>> wrote:
Hi all,

We have a tomcat application that requires some initialization after
tomcat starts up. That is, we run an initialize script after catalina.out
says ?'Server startup in:'. Currently we do this in a number of ways:
manually, through a custom tail script, or through logstash. But I¹m
thinking it might be best to let the init system do it. Is this a good
idea? And if so, how best to implement it?

systemd will not react to stdout messages, but it does have Type=notify which 
will react to a "READY=1" message sent via Unix socket – ideally directly by 
the program (see sd_notify, $NOTIFY_SOCKET) but also possibly via the 
`systemd-notify` tool:

sd_notify(0, "READY=1");

systemd-notify --ready

--
Mantas Mikulėnas <graw...@gmail.com<mailto:graw...@gmail.com>>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] tomcat start up script wait for message

2016-10-04 Thread Tomasz Torcz
On Tue, Oct 04, 2016 at 08:57:09PM +0300, Mantas Mikulėnas wrote:
> On Tue, Oct 4, 2016 at 8:32 PM, Tyler Couto  wrote:
> 
> > Hi all,
> >
> > We have a tomcat application that requires some initialization after
> > tomcat starts up. That is, we run an initialize script after catalina.out
> > says ?'Server startup in:'. Currently we do this in a number of ways:
> > manually, through a custom tail script, or through logstash. But I¹m
> > thinking it might be best to let the init system do it. Is this a good
> > idea? And if so, how best to implement it?
> >
> 
> systemd will not react to stdout messages, but it does have Type=notify
> which will react to a "READY=1" message sent via Unix socket – ideally
> directly by the program (see sd_notify, $NOTIFY_SOCKET) but also possibly
> via the `systemd-notify` tool:
> 
> sd_notify(0, "READY=1");
> 
> systemd-notify --ready
> 


  In other words, Tyler, you have to:

1) implement above sd_notify support int Tomcat, for which many users
   would be thankful;

2) use some waiting mechanism; I know that Spacewalk project has some
   Tomcat-waiting implemented, you can check their units.

-- 
Tomasz TorczThere exists no separation between gods and men:
xmpp: zdzich...@chrome.pl   one blends softly casual into the other.

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] tomcat start up script wait for message

2016-10-04 Thread Mantas Mikulėnas
On Tue, Oct 4, 2016 at 8:32 PM, Tyler Couto  wrote:

> Hi all,
>
> We have a tomcat application that requires some initialization after
> tomcat starts up. That is, we run an initialize script after catalina.out
> says ?'Server startup in:'. Currently we do this in a number of ways:
> manually, through a custom tail script, or through logstash. But I¹m
> thinking it might be best to let the init system do it. Is this a good
> idea? And if so, how best to implement it?
>

systemd will not react to stdout messages, but it does have Type=notify
which will react to a "READY=1" message sent via Unix socket – ideally
directly by the program (see sd_notify, $NOTIFY_SOCKET) but also possibly
via the `systemd-notify` tool:

sd_notify(0, "READY=1");

systemd-notify --ready

-- 
Mantas Mikulėnas 
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel