You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jan Kaluza <jk...@redhat.com> on 2012/09/26 17:10:07 UTC

[PATCH] mod_systemd

Hi,

attached patch adds new module called mod_systemd. Systemd [1] is service manager for Linux. Although httpd works with systemd normally, systemd provides sd_notify(...) function [2] to inform service manager about current status of the service. Status message passed to service manager using this function is later visible in "systemctl status httpd.service" output and can provide useful information about current httpd status.

The goal of this module is to update httpd's status message regularly to provide information like number of idle/busy workers, total requests or for example number of requests per second. It uses data from the ap_get_sload(...) function and depends on my httpd-sload.patch from previous mail.

I've tried to choose some interesting data for the status message, but if you think admins would like to see something different there, I'm open to suggestions. Note that it has to be single line of text, so there's no space for lot of data.

[1] http://www.freedesktop.org/wiki/Software/systemd
[2] http://www.freedesktop.org/software/systemd/man/sd_notify.html

Thanks for reviewing,
Jan Kaluza

Re: [PATCH] mod_systemd

Posted by Tim Bannister <is...@jellybaby.net>.
On 26 Sep 2012, at 16:10, Jan Kaluza wrote:

> Hi,
> 
> attached patch adds new module called mod_systemd. Systemd [1] is service manager for Linux. Although httpd works with systemd normally, systemd provides sd_notify(...) function [2] to inform service manager about current status of the service. Status message passed to service manager using this function is later visible in "systemctl status httpd.service" output and can provide useful information about current httpd status.
> 
> The goal of this module is to update httpd's status message regularly to provide information like number of idle/busy workers, total requests or for example number of requests per second. It uses data from the ap_get_sload(...) function and depends on my httpd-sload.patch from previous mail.
> 
> I've tried to choose some interesting data for the status message, but if you think admins would like to see something different there, I'm open to suggestions. Note that it has to be single line of text, so there's no space for lot of data.

I'd like to be able to show the date/time of the last configuration load (eg from a HUP). However, I don't use systemd yet so please treat this as only a suggestion.


-- 
Tim Bannister – isoma@jellybaby.net


Re: [PATCH] mod_systemd

Posted by Arturo 'Buanzo' Busleiman <bu...@buanzo.com.ar>.
NICE
 On Oct 3, 2012 5:28 AM, "Joe Orton" <jo...@redhat.com> wrote:

> On Wed, Sep 26, 2012 at 11:10:07AM -0400, Jan Kaluza wrote:
> > attached patch adds new module called mod_systemd. Systemd [1] is
> > service manager for Linux. Although httpd works with systemd normally,
> > systemd provides sd_notify(...) function [2] to inform service manager
> > about current status of the service. Status message passed to service
> > manager using this function is later visible in "systemctl status
> > httpd.service" output and can provide useful information about current
> > httpd status.
>
> Any objections from the list to adding this?  systemd integration is a
> nice feature.
>
> [root@virt-f18e ~]# systemctl status httpd.service
> httpd.service - The Apache HTTP Server
>           Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
>           Active: active (running) since Wed, 03 Oct 2012 08:24:58 +0100;
> 2min 17s ago
>         Main PID: 403 (httpd)
>           Status: "Total requests: 1100; Current requests/sec: 80.1;
> Current traffic: 350KB/sec"
>           CGroup: name=systemd:/system/httpd.service
>                   ├ 403 /usr/sbin/httpd -DFOREGROUND
>                   ├ 441 /usr/sbin/httpd -DFOREGROUND
>                   ├ 444 /usr/sbin/httpd -DFOREGROUND
>                   ├ 445 /usr/sbin/httpd -DFOREGROUND
>                   ├ 446 /usr/sbin/httpd -DFOREGROUND
>                   ├ 447 /usr/sbin/httpd -DFOREGROUND
>                   ├ 448 /usr/sbin/httpd -DFOREGROUND
>                   └ 470 /usr/sbin/httpd -DFOREGROUND
>
>

Re: [PATCH] mod_systemd

Posted by Graham Leggett <mi...@sharp.fm>.
On 03 Oct 2012, at 10:28 AM, Joe Orton <jo...@redhat.com> wrote:

> Any objections from the list to adding this?  systemd integration is a 
> nice feature.

Very much so, +1.

Regards,
Graham
--


Re: [PATCH] mod_systemd

Posted by Jim Jagielski <ji...@jaguNET.com>.
+1

On Oct 3, 2012, at 4:28 AM, Joe Orton <jo...@redhat.com> wrote:

> On Wed, Sep 26, 2012 at 11:10:07AM -0400, Jan Kaluza wrote:
>> attached patch adds new module called mod_systemd. Systemd [1] is 
>> service manager for Linux. Although httpd works with systemd normally, 
>> systemd provides sd_notify(...) function [2] to inform service manager 
>> about current status of the service. Status message passed to service 
>> manager using this function is later visible in "systemctl status 
>> httpd.service" output and can provide useful information about current 
>> httpd status.
> 
> Any objections from the list to adding this?  systemd integration is a 
> nice feature.
> 
> [root@virt-f18e ~]# systemctl status httpd.service
> httpd.service - The Apache HTTP Server
> 	  Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
> 	  Active: active (running) since Wed, 03 Oct 2012 08:24:58 +0100; 2min 17s ago
> 	Main PID: 403 (httpd)
> 	  Status: "Total requests: 1100; Current requests/sec: 80.1; Current traffic: 350KB/sec"
> 	  CGroup: name=systemd:/system/httpd.service
> 		  ├ 403 /usr/sbin/httpd -DFOREGROUND
> 		  ├ 441 /usr/sbin/httpd -DFOREGROUND
> 		  ├ 444 /usr/sbin/httpd -DFOREGROUND
> 		  ├ 445 /usr/sbin/httpd -DFOREGROUND
> 		  ├ 446 /usr/sbin/httpd -DFOREGROUND
> 		  ├ 447 /usr/sbin/httpd -DFOREGROUND
> 		  ├ 448 /usr/sbin/httpd -DFOREGROUND
> 		  └ 470 /usr/sbin/httpd -DFOREGROUND
> 


Re: [PATCH] mod_systemd

Posted by Joe Orton <jo...@redhat.com>.
On Wed, Oct 03, 2012 at 09:28:08AM +0100, Joe Orton wrote:
> On Wed, Sep 26, 2012 at 11:10:07AM -0400, Jan Kaluza wrote:
> > attached patch adds new module called mod_systemd. Systemd [1] is 
> > service manager for Linux. Although httpd works with systemd normally, 
> > systemd provides sd_notify(...) function [2] to inform service manager 
> > about current status of the service. Status message passed to service 
> > manager using this function is later visible in "systemctl status 
> > httpd.service" output and can provide useful information about current 
> > httpd status.
> 
> Any objections from the list to adding this?  systemd integration is a 
> nice feature.

OK, no objections, so committed here:

  http://svn.apache.org/viewvc?view=revision&revision=1393976

Thanks a lot for the contribution, Jan!

Regards, Joe

Re: [PATCH] mod_systemd

Posted by Joe Orton <jo...@redhat.com>.
On Wed, Sep 26, 2012 at 11:10:07AM -0400, Jan Kaluza wrote:
> attached patch adds new module called mod_systemd. Systemd [1] is 
> service manager for Linux. Although httpd works with systemd normally, 
> systemd provides sd_notify(...) function [2] to inform service manager 
> about current status of the service. Status message passed to service 
> manager using this function is later visible in "systemctl status 
> httpd.service" output and can provide useful information about current 
> httpd status.

Any objections from the list to adding this?  systemd integration is a 
nice feature.

[root@virt-f18e ~]# systemctl status httpd.service
httpd.service - The Apache HTTP Server
	  Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
	  Active: active (running) since Wed, 03 Oct 2012 08:24:58 +0100; 2min 17s ago
	Main PID: 403 (httpd)
	  Status: "Total requests: 1100; Current requests/sec: 80.1; Current traffic: 350KB/sec"
	  CGroup: name=systemd:/system/httpd.service
		  ├ 403 /usr/sbin/httpd -DFOREGROUND
		  ├ 441 /usr/sbin/httpd -DFOREGROUND
		  ├ 444 /usr/sbin/httpd -DFOREGROUND
		  ├ 445 /usr/sbin/httpd -DFOREGROUND
		  ├ 446 /usr/sbin/httpd -DFOREGROUND
		  ├ 447 /usr/sbin/httpd -DFOREGROUND
		  ├ 448 /usr/sbin/httpd -DFOREGROUND
		  └ 470 /usr/sbin/httpd -DFOREGROUND