From ingvar at redpill-linpro.com Wed Aug 3 09:17:46 2011 From: ingvar at redpill-linpro.com (Ingvar Hagelund) Date: Wed, 3 Aug 2011 11:17:46 +0200 (CEST) Subject: Support for systemd In-Reply-To: <777989591.56514.1312361183553.JavaMail.root@claudius.linpro.no> Message-ID: <1597911191.56652.1312363066299.JavaMail.root@claudius.linpro.no> 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 From tfheen at varnish-software.com Wed Aug 3 09:27:38 2011 From: tfheen at varnish-software.com (Tollef Fog Heen) Date: Wed, 03 Aug 2011 11:27:38 +0200 Subject: Support for systemd In-Reply-To: <1597911191.56652.1312363066299.JavaMail.root@claudius.linpro.no> (Ingvar Hagelund's message of "Wed, 3 Aug 2011 11:17:46 +0200 (CEST)") References: <1597911191.56652.1312363066299.JavaMail.root@claudius.linpro.no> Message-ID: <874o1ykfp1.fsf@qurzaw.varnish-software.com> ]] 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