[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#545691: diverting telinit



On Fri, Oct 23 2009, brian m. carlson wrote:

> On Fri, Oct 23, 2009 at 12:43:18PM -0500, Manoj Srivastava wrote:
>>  if [ -x /sbin/init ] && [ -d /proc/1 ] &&
>>      [ "$(stat -c %d/%i /sbin/init)" = "$(stat -Lc %d/%i /proc/1/exe 2>/dev/null)" ] ; then
>>      # So, init exists, and there is a linuxy /proc, and the inode of
>>      # the executable of the process with uid 1 is the same as
>>      # /sbin/init (ok, no init=/bin/sh going on)
>> 
>>      if [ "$(stat -c %d/%i /)" = "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ]; then
>>          # the devicenumber/inode pair of / is the same as that of
>>          # /sbin/init's root, so we're *not* in a chroot
>> 
>>          # Final sanity check. Make sure there is a /dev/initctl
>>          # for us to talk to
>>          if [ -e /dev/initctl ]; then
>
> Last I checked, the kfreebsd-* architectures don't use /dev/initctl; I
> think it's something like /etc/.initctl.  They do, however, have a
> linuxy proc.  You should probably check with the porters as to what
> location is appropriate on those architectures.

        Well, this was not an issue i my case, since these packages do
 not support  ! linux, but yes, a generic solution would have to cater
 to that as well.

        manoj
-- 
Today is the first day of the rest of the mess.
Manoj Srivastava <srivasta@debian.org> <http://www.debian.org/~srivasta/>  
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C


Reply to: