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

Re: Bug#545691: diverting telinit



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.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 713 440 7475 | http://crustytoothpaste.ath.cx/~bmc | My opinion only
OpenPGP: RSA v4 4096b 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187

Attachment: signature.asc
Description: Digital signature


Reply to: