Subject: Re: Bug#405454: [new check] init script in level S must only use commands from /sbin:/bin

From: Russ Allbery <[email-masked]>
Date: Tue, 27 Feb 2007 01:02:22 -0800

> On systems with a separate /usr filesystem, several boot scripts in
> level S break because they use commands from /usr/bin or
> /usr/sbin. Culprits include scripts for essential packages that perform
> system initialization.
> 
> It would be desirable for Lintian to check that scripts that delcare
> level S in their LSB header _only_ use commands from /bin and /sbin.
> 
> Note:  as Manoj noted, it would be pointless to add this to Policy,
> since maintainers are already expected to verify this. Thus, Lintian
> would introduce this check as additional idiot-proofing, to ensure that
> systems can factually be built with a separate /usr filesystem.

The hard part about this is that lintian has no way of knowing which files
are in /bin and /sbin.  I suppose we could maintain a static list, but
that looks extremely unattractive.  I'm not sure that lintian is the right
tool to use here.

This looks to me like a hard problem, particularly given that checking
this means knowing whether programs invoked without a path are actually
shell built-ins (and since such an init script may be a /bin/bash script,
there are lots of those).

-- 
Russ Allbery ([email-masked])               <http://www.eyrie.org/~eagle/>

---

From: "Martin-Éric Racine" <[email-masked]>
Date: Mon, 23 Jun 2008 16:11:28 +0300

Checking for the existence of a string "/usr/" anywhere in the init
script could already be a simple way to do this.

-- 
Martin-Éric Racine
http://q-funk.iki.fi