On Mar 18, 2012 8:48 AM, "Canek Peláez Valdés" <can...@gmail.com> wrote: > > On Sat, Mar 17, 2012 at 6:48 PM, Nikos Chantziaras <rea...@gmail.com> wrote: > > On 17/03/12 13:53, Alan Mackenzie wrote: > >> > >> Hello, Nikos. > >> > >> On Sat, Mar 17, 2012 at 08:25:48AM +0200, Nikos Chantziaras wrote: > >> > >>>> Happy Computer Users, systemd is on your horizon. > >> > >> > >>> No, we don't. I hope systemd arrives soon. It's the best init system I > >>> ever saw. > >> > >> > >> What's so good about it? What will it do for me? > >> > >> I have this horrible sneaking suspicion that it will be more complicated > >> than /sbin/init + OpenRC, just like udev + initramfs is more complicated > >> than udev, and CUPS is more complicated than classical lpr. > >> > >> Why do you find it so good? > > > > > > No idea. I only posted this because the OP didn't say what's bad about > > systemd :-) I really don't know I should care whether my system runs OpenRC > > or systemd. > > Take this with a grain (or a kilo) of salt, since I'm obviously > biased, but IMHO this are systemd advantages over OpenRC: > > * Really fast boot. OpenRC takes at least double the time that systemd > does when booting, easily verifiable. In my laptop systemd is twice as > fast as OpenRC; in my desktop is three times faster. > > * Really parallel service startup: OpenRC has never been reliable on > parallel service startup; its documentation says it explicitly. > > * Really simple service unit files: The service unit files are really > small, really simple, really easy to understand/modify. Compare the 9 > lines of sshd.service: > > $ cat /etc/systemd/system/sshd.service > [Unit] > Description=SSH Secure Shell Service > After=syslog.target > > [Service] > ExecStart=/usr/sbin/sshd -D > > [Install] > WantedBy=multi-user.target > > with the 84 of /etc/init.d/sshd (80 without comments). > > * Really good documentation: systemd has one of the best > documentations I have ever seen in *any* project. Everything (except > really new, experimental features) is documented, with manual pages > explaining everything. And besides, there are blog posts by Lennart > explaining in a more informal way how to do neat tricks with systemd. > > * Really good in-site customization: The service unit files are > trivially overrided with custom ones for specific installations, > without needing to touch the ones installed by systemd or a program. > With OpenRC, if I modify a /etc/init.d file, chances are I need to > check out my next installation so I can see how the new file differs > from the old one, and adapt the changes to my customized version. > > * All the goodies from Control Groups: You can use kernel cgroups to > monitor/control several properties of your daemons, out of the box, > almost no admin effort involved. > > * It tries to unify Linux behaviour among distros (some can argue that > this is a bad thing): Using systemd, the same > configurations/techniques work the same in every distribution. No more > need to learn /etc/conf.d, /etc/sysconfig, /etc/default hacks by > different distros. > > * Finally, and what I think is the most fundamental difference between > systemd and almost any other init system: The service unit files in > systemd are *declarative*; you tell the daemon *what* to do, not *how* > to do it. If the service files are shell scripts (like in > OpenRC/SysV), everything can spiral out of control really easily. And > it usually does (again, look at sshd; and that one is actully nicely > written, there are all kind of monsters out there abusing the power > that shell gives you). > > These are the ones off the top of my head; but what I like the most > about systemd is that it just works, and that it makes a lot of sense > (at least to me). > > Most of systemd features can be implemented in OpenRC (although the > speed difference will never be eliminated if OpenRC keeps using shell > files). My question is: why bother? systemd is already here, it > already works, and it's actually supported in Gentoo. > > But again, remember that I'm biased: I keep an overlay to run Gentoo > systems with only systemd; no OpenRC, no baselayout, no SysV. You guys > can try it if you want: > > http://xochitl.matem.unam.mx/~canek/gentoo-systemd-only/ > > Usual disclaimer: I take no responsibility if using my overlay results > in your systems asploding. That said, I'm using it on all my machines > without a hitch. > > Regards.
Interesting... However, what if the service is complex? For example, I created a "gatewall" service which, upon boot, initializes : * Routing tables and the RPDB * ipset * iptables while ensuring that upon shutdown, the settings of the above are (optionally) saved. How do I specify such intelligence? Rgds,