Code review comment for lp:~jamesodhunt/upstart/add-what-ident

Revision history for this message
Scott James Remnant (scott) wrote :

Except of course that this doesn't tell you which init system is running, a
system like Debian might have /sbin/upstart, /sbin/launchd and
/sbin/sysvinit installed with /sbin/init a symlink to one of them - or even
the init selected with init= on the kernel command-line

On Sun, May 15, 2011 at 6:35 AM, James Hunt <email address hidden>wrote:

> Hi Scott,
>
> The intention for this is to allow a non-privileged tool in any environment
> to identify any of the current init systems purely by doing "what `which
> init`". Of course you are right that init --version works for Upstart, but
> that presupposes that every init system supports "--version" and Debian's
> doesn't. Yeah, a distro could have a script which tried a load of tests for
> init systems I guess, but I thought the 'what' approach might be easier,
> particularly since the debian SysV init *does* already encode that detail
> into the binary.
>
> There is the small matter of what(1) not being available on Debian/Ubuntu,
> but it can be implemented crudely as:
>
> strings $1|grep '@(#)'|sed 's/^@(#) //g'
>
> Cheers,
>
> James.
> --
> https://code.launchpad.net/~jamesodhunt/upstart/add-what-ident/+merge/59936
> Your team Upstart Developers is requested to review the proposed merge of
> lp:~jamesodhunt/upstart/add-what-ident into lp:upstart.
>

« Back to merge proposal