Mailing List Archive

Support for systemd
The last chapter in the saga of sysv init replacements is systemd (1). Fedora 15 has shipped with systemd (2). From what I've heard, Debian (3) and OpenSuSE (4) is migrating. Ubuntu has not made any public announcements on using systemd yet, but there is experimental support (5) .

systemd startup files (so-called unit files) are simpler than the classical init.d shell scripts, and are meant to be distribution agnostic, which means less work on distribution hacks upstream.

Being a cool modern, uh, thing, varnish should probably support systemd too. (I also need systemd support for varnish in Fedora anyway.)

Win: A common systemd unit file for many linux distributions may be distributed and maintained upstream.

Win: Interesting extra features; Some socket activation mechanism that might make varnishd restart completely without loosing connections. (No, I know absolutely nothing about how this works.)

A problem is the way varnish starts up, by reading its startup configuration from environment variables in /etc/{sysconfig|defaults}/varnish. systemd does support reading files with environment variables, but only as a list of VAR=val statements, and not the cumulative way the default sysconfig|defaults file is built up.

Easiest fix for me, most work for developers: Skip the shell based startup that is used by Red Hat, SuSE and Debian derivates, and make varnish itself read its configuration from a file (as an alternative to only support command line options startup).

More or less ugly workaround with minimal changes: Make systemd call a script that boots varnish. The script will look a lot like the start part of the init scripts today

Timeline: No rush. Fedora 15 and 16 will continue to support old style init scripts. (systemd can read an emulate those scripts quite well). I will have to switch to systemd unit files at latest for Fedora 17. RHEL7 will probably use systemd, for what that's worth. I don't know about other distributions.

Ingvar



1) http://www.freedesktop.org/wiki/Software/systemd
2) https://fedoraproject.org/wiki/Packaging:Systemd
3) http://wiki.debian.org/systemd
4) http://en.opensuse.org/openSUSE:Systemd_status
5) https://wiki.ubuntu.com/systemd

_______________________________________________
varnish-dist mailing list
varnish-dist@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dist
Re: Support for systemd [ In reply to ]
]] Ingvar Hagelund

Hi Ingvar, thanks for raising this discussion,

| The last chapter in the saga of sysv init replacements is systemd
| (1). Fedora 15 has shipped with systemd (2). From what I've heard,
| Debian (3) and OpenSuSE (4) is migrating. Ubuntu has not made any
| public announcements on using systemd yet, but there is experimental
| support (5) .

Debian's supporting systemd, but the decision on whether to move to it
by default or not has in no way been taken. (I'm part of the
discussion, as I maintain systemd in Debian.)

[...]

| Win: A common systemd unit file for many linux distributions may be
| distributed and maintained upstream.

Yup, would be good.

| Win: Interesting extra features; Some socket activation mechanism that
| might make varnishd restart completely without loosing
| connections. (No, I know absolutely nothing about how this works.)

This is somewhat harder to do, but in no way impossible, I think.

| A problem is the way varnish starts up, by reading its startup
| configuration from environment variables in
| /etc/{sysconfig|defaults}/varnish. systemd does support reading files
| with environment variables, but only as a list of VAR=val statements,
| and not the cumulative way the default sysconfig|defaults file is
| built up.
|
| Easiest fix for me, most work for developers: Skip the shell based
| startup that is used by Red Hat, SuSE and Debian derivates, and make
| varnish itself read its configuration from a file (as an alternative
| to only support command line options startup).

I think this would be ok in any case, and it's not really that much
work.

--
Tollef Fog Heen
Varnish Software
t: +47 21 98 92 64

_______________________________________________
varnish-dist mailing list
varnish-dist@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dist