On Fri, Jan 02, 2015 at 01:20:11PM +1000, David Seikel wrote:
> On Thu, 1 Jan 2015 10:22:46 -0800 Isaac Dunham <[email protected]>
> wrote:
> 
> > On Thu, Jan 01, 2015 at 09:35:31AM -0500, stephen Turner wrote:
> > > while doing some searches on scripting i was reminded about
> > > "service" and noticed it wasn't in toybox. Is this a oversight or
> > > not in intended feature/possible post 1.0.
> > 
> > service(8) is part of the rc scripts, of which there are more variants
> > than there are of init(8).
> > It makes little sense to include it in toybox when the only init we
> > have is oneit; even when init gets out of pending, implementing
> > service in toybox would be hard-coding a requirement about how the rc
> > scripts work. We certainly couldn't implement the rc scripts in
> > toybox, since they are scripts.
> 
> That's not entirely true.  Many years ago I wrote an implementation of
> runlevel/init.d/SYS V init applets for busybox, aiming for LSB
> compliance.  It included the ability for the actual "scripts"
> themselves to be written in any language, and included several ones
> written in C as busybox applets.  These init "scripts" would just be
> symlinks to busybox.  This is in fact compliant with the LSB
> specification.
> 
> If I remember correctly, it includes most of the good stuff systemd
> claims, fast boot if all/most of the "scripts" are written in C,
> dependency tracking, parallel "script" running, etc.

I'm...fascinated and revolted.
The problem with doing init scripts in C is that *when* it breaks (and 
it will, since flawless hardware, drivers, kernel, libc, init, *and* 
networking services exist nowhere), it will require either a rebuild
by someone who knows C, or a *replacement* by a user who only knows
shell.  And writing a shell script to replace an init script while
fixing a bug is a lot more work than fixing a bug in a shell script.

However, having the tools required for init scripts done in C is
a significant improvement; killproc, pidofproc, etc. should not be 
done in shell (as many init scripts do); they could probably be 
implemented along with pkill/killall/... and pidof.

> Rob hasn't decided yet how to tackle this sort of thing, other than his
> oneit toy, which is a very basic init system.  I hope that when he
> does tackle it, "scripts" written in C as part of toybox would be
> supported.
> 
> It's likely bit rotted horribly, but for the curious -
> 
> https://sourceforge.net/projects/urunlevel/
> 
> I'd be happy to port it to toybox.

Thanks,
Isaac Dunham
_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to