Four years ago, during DebConf 7 in Edinburgh, I had the idea of creating init scripts not by hand, but rather describe them in a declarative way that handles most common cases and generate the real init scripts from them. Back than, this was partly motivated by the varying quality of init scripts and the advent of an alternative init system, upstart, for which proper service files could be generated as well.
I implemented the idea and uploaded it as metainit to Debian, but it did not take off. Only one package uses it, and this package is not used much either. The project basically fell dormant.
Yesterday, I got this mail:
I'm not very familiar with Debian ecosystem, however our company has
recently switched to exclusively using Debian based servers, please
forgive me if there exists a better channel for sending patches.
We need (in house) to create a lot of trivial services and the sysv init
system seems an ideal way to manage them, and metainit an great way to
keep the config simple.
However all our scripts require a heartbeat, the way we normally do this
is with a bunch of checkers launched from cron. Metainit was ideal, but
lacked the simple 'status' task found in most init scripts.
This small patch adds that task, I hope you and others find it usefull.
together with the mentioned patch. So it turned out that the idea was a useful one after all, although it found its use on our user’s machines, and not within the Debian packages, as I originally anticipated. Nice!
During the recent discussions about the latest init system, systemd, there were more thoughts about generating init scripts/upstart service descriptions/systemd units from a declarative description, and if metainit had taken off back then, things would be easier now. So if anyone feels like reviving the project: Please do.
Aren't systemd service files essentially declarative descriptions of services? Plus they already have a parser written in systemd.
Hooking into that (somehow - SMOP :-) to produce sysv init scripts/upstart config files might be able to get you 95% of the way there. It can't hurt that many services already have systemd service files written.