On Fri, Jan 17, 2014 at 12:50 AM, Anthony Towns <a...@erisian.com.au> wrote:

> On 31 December 2013 12:55, Colin Watson <cjwat...@debian.org> wrote:
> > The criticisms of Upstart's event model in the systemd position
> > statement simply do not make sense to me.  Events model how things
> > actually happen in reality; dependencies are artificial constructions on
> > top of them, and making them work requires the plethora of different
> > directives in systemd (e.g. Wants, which is sort of a non-depending
> > dependency) to avoid blocking the boot process on a single failing
> > service.
>
> Riffing off this more than replying to it.
>
> I tend to think dependencies and events are both useful ways of
> describing when to start up parts of the system. In particular, it
> seems like:
>
>  - when a network is connected, start web server
>  - when a usb disk is connected, mount it
>  - when a VPN is started, sync various things
>
> are best described by an "event" model, while:
>
>  - in order to run GNOME, logind must be started
>  - in order to run logind, dbus must be available
>  - as part of making the system ready for a user, network-manager
> should be running
>
>
You could express that as an event because GNOME and logind communicate
with logind and dbus (respectively) through IPC. So you can say "when GNOME
tries to use logind's dbus interface, start logind", or you can say "when
//anything// tries to use logind's dbus interface, start logind" and have
that done for. Same for starting dbus, just change a dbus interface to
dbus's port.


> make the most sense when described by "dependencies". In particular,
> in many of those cases, the reverse might not be true: For debugging,
> I might want to start the web server manually without connecting the
> network; or I might want logind running without GNOME, or
> network-manager running without the other parts of my desktop
> environment.
>
>
With the above method, this problem is avoided because GNOME does not start
when logind starts, it just starts whenever the runlevel is right and then
logind is started automatically. So if GNOME is stopped/waiting, you can
start logind without GNOME starting.

--
Cameron Norman

Reply via email to