"Ben Dibell" <thinkingrod...@gmail.com> wrote:

> Hi, I've tried other resources, even reading the source for init, but I
> can't seem to locate the magic that makes /sbin/init the approved init.
> I'm porting my init system Epoch to BSD for personal reasons, and I'd like
> it to work under OpenBSD, which I've been enjoying as of late. I come from
> the linux world where init=/bin/sh is perfectly valid, so some aspects are
> probably simpler in Linux. I am hoping there is a concise and clean
> explanation as to how to write/port an init system to BSD. Is it signal
> trickery? A checksum burned into the kernel? I'm lost. I'm given "init has
> died, signal 0 exit 0" or something nearly identical to this. There are no
> further useful debug messages and my keyboard becomes unresponsive on the
> debugging prompt or the kernel locks up or something, so I can't do more
> there.
> 
> Thanks for your time.
> 
> -Ben

The kernel doesn't support any command line syntax like that but I don't
know why it wouldn't let you use any static binary. You should read
kernel sources too if you're serious about this.

But I don't see your point. Obviously you can do what makes you happy on
your systems but have you thought about what OpenBSD init does vs. what
your init does? init (among other things) exists to run getty and start
/etc/rc. You mention status in a further message. You probably want to
keep logs and manage daemon state like the other newfangled init
systems. You're going to have to rewrite both init and the rc system.
And you won't get any support for such a system.

And if you want to monitor daemons you'll be better off monitoring the
service the daemons are supposed to provide. It doesn't matter if httpd
hasn't exited yet if you can't connect to it.

- Martin Brandenburg

Reply via email to