Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Dev

[PATCH] systemd socket activation

 

 

Apache dev RSS feed   Index | Next | Previous | View Threaded


paul at querna

Jul 21, 2013, 2:14 PM

Post #1 of 4 (64 views)
Permalink
[PATCH] systemd socket activation

Hiya Y'all, long time no patches :-)

Attached is a patch that would let httpd use systemd's socket
activation feature:
<http://0pointer.de/blog/projects/socket-activation.html>

Also online here:
<https://github.com/pquerna/httpd/compare/trunk...systemd_socket_activation>

It isn't particularly pretty; Mostly it is working within how
listener code already works. You can test it yourself very easily
using something like:

/usr/lib/systemd/systemd-activate -l 0.0.0.0:8080 -l 9080
/usr/local/httpd-dev/bin/httpd -DFOREGROUND

You'll note it works with multiple listeners. I've been testing it on
Fedora 19, and it seems fine there.

Now, the patch is not part of mod_systemd. This is mostly because the
listener.c code isn't exactly friendly to a non-core module messing
around with the listeners. I'd definitely be +1 to a larger
refactoring of listen.c, but not sure I have the time / energy to head
that up.

If there aren't any objections I'll commit it into trunk in a few days,

Thanks,

Paul
Attachments: systemd-socket-activation.patch (10.9 KB)


jorton at redhat

Jul 23, 2013, 3:11 AM

Post #2 of 4 (56 views)
Permalink
Re: [PATCH] systemd socket activation [In reply to]

On Sun, Jul 21, 2013 at 02:14:35PM -0700, Paul Querna wrote:
> Hiya Y'all, long time no patches :-)
>
> Attached is a patch that would let httpd use systemd's socket
> activation feature:
> <http://0pointer.de/blog/projects/socket-activation.html>
>
> Also online here:
> <https://github.com/pquerna/httpd/compare/trunk...systemd_socket_activation>
>

Hi Paul - this is neat! A surprisingly simple patch, I like it a lot,
+1 for trunk.

I guess we still need to set O_NONBLOCK on inherited sockets in the same
way that open_listeners() does? But otherwise leaving socket options to
the systemd .socket seems reasonable, I guess. Having the "https ==
443" heuristic is annoying but no obvious way round that.

Regards, Joe


jkaluza at redhat

Jul 24, 2013, 12:00 AM

Post #3 of 4 (56 views)
Permalink
Re: [PATCH] systemd socket activation [In reply to]

On 07/21/2013 11:14 PM, Paul Querna wrote:
> Hiya Y'all, long time no patches :-)
>
> Attached is a patch that would let httpd use systemd's socket
> activation feature:
> <http://0pointer.de/blog/projects/socket-activation.html>
>
> Also online here:
> <https://github.com/pquerna/httpd/compare/trunk...systemd_socket_activation>

Hi,

I have tried the patch on F18 with httpd-2.4.6 and it works as expected.
I really like it :).

Regards,
Jan Kaluza

> It isn't particularly pretty; Mostly it is working within how
> listener code already works. You can test it yourself very easily
> using something like:
>
> /usr/lib/systemd/systemd-activate -l 0.0.0.0:8080 -l 9080
> /usr/local/httpd-dev/bin/httpd -DFOREGROUND
>
> You'll note it works with multiple listeners. I've been testing it on
> Fedora 19, and it seems fine there.
>
> Now, the patch is not part of mod_systemd. This is mostly because the
> listener.c code isn't exactly friendly to a non-core module messing
> around with the listeners. I'd definitely be +1 to a larger
> refactoring of listen.c, but not sure I have the time / energy to head
> that up.
>
> If there aren't any objections I'll commit it into trunk in a few days,
>
> Thanks,
>
> Paul
>


paul at querna

Aug 6, 2013, 9:53 AM

Post #4 of 4 (21 views)
Permalink
Re: [PATCH] systemd socket activation [In reply to]

Committed to trunk in r1511033.

On Wed, Jul 24, 2013 at 12:00 AM, Jan Kaluža <jkaluza [at] redhat> wrote:
> On 07/21/2013 11:14 PM, Paul Querna wrote:
>>
>> Hiya Y'all, long time no patches :-)
>>
>> Attached is a patch that would let httpd use systemd's socket
>> activation feature:
>> <http://0pointer.de/blog/projects/socket-activation.html>
>>
>> Also online here:
>>
>> <https://github.com/pquerna/httpd/compare/trunk...systemd_socket_activation>
>
>
> Hi,
>
> I have tried the patch on F18 with httpd-2.4.6 and it works as expected. I
> really like it :).
>
> Regards,
> Jan Kaluza
>
>
>> It isn't particularly pretty; Mostly it is working within how
>> listener code already works. You can test it yourself very easily
>> using something like:
>>
>> /usr/lib/systemd/systemd-activate -l 0.0.0.0:8080 -l 9080
>> /usr/local/httpd-dev/bin/httpd -DFOREGROUND
>>
>> You'll note it works with multiple listeners. I've been testing it on
>> Fedora 19, and it seems fine there.
>>
>> Now, the patch is not part of mod_systemd. This is mostly because the
>> listener.c code isn't exactly friendly to a non-core module messing
>> around with the listeners. I'd definitely be +1 to a larger
>> refactoring of listen.c, but not sure I have the time / energy to head
>> that up.
>>
>> If there aren't any objections I'll commit it into trunk in a few days,
>>
>> Thanks,
>>
>> Paul
>>
>

Apache dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.