9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans]  Booting with mk
@ 2009-10-16  5:59 Matthias Teege
  0 siblings, 0 replies; 7+ messages in thread
From: Matthias Teege @ 2009-10-16  5:59 UTC (permalink / raw)
  To: andy753421, 9fans

My friend Mike and I were talking a while back about Unix init systems
and came to the conclusion that mk's dependency tracking could come in
handy. I decided to implement it a few days ago using plan9port and
thought that some of the folks here might be interested. Although, I
still haven't decided if it's really neat, or completely evil :-)

The code is available here, along with a fuller README:

  https://lug.rose-hulman.edu/svn/misc/trunk/mkinit/


It consists of a bash script (the rc version has issues..) that runs as
the actually init daemon, a mkfile that contains a list of rules for
starting and stopping services, and a some helper programs.

It's based on mk so any mk rules could be used. What I use is a few
rules to denote runlevels and then a bunch of rules for starting and
stopping services of the form:

  foo-start:VPservice -u: deps-start ..
  foo-stop:VPservice -d: rdeps-stop ..

service -[ud] is just a helper script that determines if the services is
already up or down in order to avoid re-starting/stopping it. Dependency
tracking is pretty strait forward, but foo-stop dependencies are
backwards because the dependencies for the rule denote the services that
must be stopped before foo can be stopped. What this ends up creating is
two separate DAGs, one for booting and one for halting.

I've been using it the past couple days and it seems to work pretty
nicely, but it's still largely untested, and there are a few bugs such
utmp being broken.. It's also a good bit faster than sysvinit due to
mk's parallelization, bootcharts below.

  http://andy753421.ath.cx/temp/mkinit.png
  http://andy753421.ath.cx/temp/sysvinit.png




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] Booting with mk
  2009-10-19 13:36     ` Anthony Sorace
@ 2009-10-19 19:16       ` Andy Spencer
  0 siblings, 0 replies; 7+ messages in thread
From: Andy Spencer @ 2009-10-19 19:16 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> I'd like to check this out, but the server doesn't want to
> talk to me. Is there a copy available elsewhere?

Oops, that's rather embarrassing, sorry about that, that server has a
few issues (oddly enough, it's sysvinit is broken). I posted tarball for
the time begin at http://andy753421.ath.cx/temp/mkinit.tar.gz



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] Booting with mk
  2009-10-16 18:47   ` Andy Spencer
@ 2009-10-19 13:36     ` Anthony Sorace
  2009-10-19 19:16       ` Andy Spencer
  0 siblings, 1 reply; 7+ messages in thread
From: Anthony Sorace @ 2009-10-19 13:36 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I'd like to check this out, but the server doesn't want to
talk to me. Is there a copy available elsewhere?



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] Booting with mk
  2009-10-16 17:29 ` Sam Watkins
@ 2009-10-16 18:47   ` Andy Spencer
  2009-10-19 13:36     ` Anthony Sorace
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Spencer @ 2009-10-16 18:47 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> Great idea, I like it :)  I'll have a look at the code later.
> You're using it on old unix/linux not plan 9 I guess?  thanks.

Yep, I'm running it on my ~4 year old laptop. I'm curious to see how it
would compare on something newer though.  I think it would still be I/O
bound, so I'm not sure how much of an improvement there would be.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] Booting with mk
  2009-10-16  5:54 Andy Spencer
  2009-10-16  6:07 ` andrey mirtchovski
@ 2009-10-16 17:29 ` Sam Watkins
  2009-10-16 18:47   ` Andy Spencer
  1 sibling, 1 reply; 7+ messages in thread
From: Sam Watkins @ 2009-10-16 17:29 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Great idea, I like it :)  I'll have a look at the code later.
You're using it on old unix/linux not plan 9 I guess?  thanks.

On Fri, Oct 16, 2009 at 05:54:12AM +0000, Andy Spencer wrote:
> My friend Mike and I were talking a while back about Unix init systems
> and came to the conclusion that mk's dependency tracking could come in
> handy.

> The code is available here, along with a fuller README:
>
>   https://lug.rose-hulman.edu/svn/misc/trunk/mkinit/



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] Booting with mk
  2009-10-16  5:54 Andy Spencer
@ 2009-10-16  6:07 ` andrey mirtchovski
  2009-10-16 17:29 ` Sam Watkins
  1 sibling, 0 replies; 7+ messages in thread
From: andrey mirtchovski @ 2009-10-16  6:07 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

thanks for that. it is neat!



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [9fans] Booting with mk
@ 2009-10-16  5:54 Andy Spencer
  2009-10-16  6:07 ` andrey mirtchovski
  2009-10-16 17:29 ` Sam Watkins
  0 siblings, 2 replies; 7+ messages in thread
From: Andy Spencer @ 2009-10-16  5:54 UTC (permalink / raw)
  To: 9fans

My friend Mike and I were talking a while back about Unix init systems
and came to the conclusion that mk's dependency tracking could come in
handy. I decided to implement it a few days ago using plan9port and
thought that some of the folks here might be interested. Although, I
still haven't decided if it's really neat, or completely evil :-)

The code is available here, along with a fuller README:

  https://lug.rose-hulman.edu/svn/misc/trunk/mkinit/


It consists of a bash script (the rc version has issues..) that runs as
the actually init daemon, a mkfile that contains a list of rules for
starting and stopping services, and a some helper programs.

It's based on mk so any mk rules could be used. What I use is a few
rules to denote runlevels and then a bunch of rules for starting and
stopping services of the form:

  foo-start:VPservice -u: deps-start ..
  foo-stop:VPservice -d: rdeps-stop ..

service -[ud] is just a helper script that determines if the services is
already up or down in order to avoid re-starting/stopping it. Dependency
tracking is pretty strait forward, but foo-stop dependencies are
backwards because the dependencies for the rule denote the services that
must be stopped before foo can be stopped. What this ends up creating is
two separate DAGs, one for booting and one for halting.

I've been using it the past couple days and it seems to work pretty
nicely, but it's still largely untested, and there are a few bugs such
utmp being broken.. It's also a good bit faster than sysvinit due to
mk's parallelization, bootcharts below.

  http://andy753421.ath.cx/temp/mkinit.png
  http://andy753421.ath.cx/temp/sysvinit.png



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-10-19 19:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-16  5:59 [9fans] Booting with mk Matthias Teege
  -- strict thread matches above, loose matches on Subject: below --
2009-10-16  5:54 Andy Spencer
2009-10-16  6:07 ` andrey mirtchovski
2009-10-16 17:29 ` Sam Watkins
2009-10-16 18:47   ` Andy Spencer
2009-10-19 13:36     ` Anthony Sorace
2009-10-19 19:16       ` Andy Spencer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).