Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Sep 2010 17:17:40 +0200
From:      =?ISO-8859-1?B?QmFs4XpzIE3hdOlmZnk=?= <repcsike@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: rebuilding world - is "chflags -R noschg *" necessary?
Message-ID:  <AANLkTik=tPEjZscz4j5ZHLaZatFE%2B2JGvj72WzcZF8iP@mail.gmail.com>
In-Reply-To: <4C9B675D.7070500@qeng-ho.org>
References:  <20100923110216.GA1861@mech-cluster241.men.bris.ac.uk> <20100923161009.026d950c.freebsd@edvax.de> <4C9B675D.7070500@qeng-ho.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello!

Anton is right, really the handbook says that it MAY contain, so it's not
necessary that after every build there will be some files with the immutable
flag.

OFF: Long long time ago one night when I was playing with jails (to be exact
I was building and making work my first jail by hand) I got to know this
little thing known as immutable, after building a jail, and after #&@$ing it
up (sry :)) I could not delete it. It was a funny discovery I remember I was
new to FBSD and unix in general:).
ON:

I think maybe in older releases the build process may have used the
immutable flag at build??, but the test machine I tried, started out as
maybe 5.2, and I never had this issue once. Now I'm at 8.1-REL. After you
make installworld you get some files immutable, check this:

# cd /usr/src/
# make installworld DESTDIR=/usr/home/testworld/
# cd /usr/home/testworld
# find . -xdev -flags +schg -exec ls -la {} \;
-r-sr-xr-x  1 root  wheel  18584 Sep 23 16:54 ./bin/rcp
-r--r--r--  1 root  wheel  1150968 Sep 23 16:53 ./lib/libc.so.7
-r--r--r--  1 root  wheel  32104 Sep 23 16:53 ./lib/libcrypt.so.5
-r--r--r--  1 root  wheel  76412 Sep 23 16:54 ./lib/libthr.so.3
-r-xr-xr-x  1 root  wheel  220596 Sep 23 16:54 ./libexec/ld-elf.so.1
-r-xr-xr-x  1 root  wheel  663616 Sep 23 16:55 ./sbin/init
-r-sr-xr-x  6 root  wheel  18588 Sep 23 16:56 ./usr/bin/chpass
-r-sr-xr-x  6 root  wheel  18588 Sep 23 16:56 ./usr/bin/chfn
-r-sr-xr-x  6 root  wheel  18588 Sep 23 16:56 ./usr/bin/chsh
-r-sr-xr-x  6 root  wheel  18588 Sep 23 16:56 ./usr/bin/ypchpass
-r-sr-xr-x  6 root  wheel  18588 Sep 23 16:56 ./usr/bin/ypchfn
-r-sr-xr-x  6 root  wheel  18588 Sep 23 16:56 ./usr/bin/ypchsh
-r-sr-xr-x  1 root  wheel  21836 Sep 23 16:56 ./usr/bin/login
-r-sr-xr-x  1 root  wheel  4792 Sep 23 16:56 ./usr/bin/opieinfo
-r-sr-xr-x  1 root  wheel  11868 Sep 23 16:56 ./usr/bin/opiepasswd
-r-sr-xr-x  2 root  wheel  6160 Sep 23 16:56 ./usr/bin/passwd
-r-sr-xr-x  2 root  wheel  6160 Sep 23 16:56 ./usr/bin/yppasswd
-r-sr-xr-x  1 root  wheel  11244 Sep 23 16:56 ./usr/bin/rlogin
-r-sr-xr-x  1 root  wheel  8896 Sep 23 16:56 ./usr/bin/rsh
-r-sr-xr-x  1 root  wheel  14500 Sep 23 16:56 ./usr/bin/su
-r-sr-xr-x  1 root  wheel  27044 Sep 23 16:56 ./usr/bin/crontab
-r--r--r--  1 root  wheel  16604 Sep 23 16:54 ./usr/lib/librt.so.1
total 4
dr-xr-xr-x   2 root  wheel  512 Sep 23 16:53 .
drwxr-xr-x  22 root  wheel  512 Sep 23 16:53 ..

# rm -rf testworld/
rm: testworld/bin/rcp: Operation not permitted
rm: testworld/bin: Directory not empty
rm: testworld/lib/libc.so.7: Operation not permitted
rm: testworld/lib/libcrypt.so.5: Operation not permitted
rm: testworld/lib/libthr.so.3: Operation not permitted
rm: testworld/lib: Directory not empty
rm: testworld/libexec/ld-elf.so.1: Operation not permitted
rm: testworld/libexec: Directory not empty
rm: testworld/sbin/init: Operation not permitted
and so on...

Anton if you wanna be sure just do it, or test it with the version you are
using, but I don't think you will find any immutable files in /usr/obj

/usr/obj]# find . -flags +schg -exec ls -la {} \;
/usr/obj]#


Sorry if this was a bit long, but I hope it helpded!

Regards,

Balazs.



On 23 September 2010 16:42, Arthur Chance <freebsd@qeng-ho.org> wrote:

> On 09/23/10 15:10, Polytropon wrote:
>
>> On Thu, 23 Sep 2010 12:02:17 +0100, Anton Shterenlikht<
>> mexas@bristol.ac.uk>  wrote:
>>
>>> I've never seen a file under /usr/obj/ with immutable flag set.
>>>
>>
>> I think it was a directory called empty/ that couldn't be removed
>> unless the flag was unset. This makes this step neccessary when
>> you rm -rf /usr/obj the object subtree.
>>
>
> I think you're thinking of /var/empty, not something under /usr/obj. On my
> machine find fails to find anything immutable under /usr/obj.
>
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "
> freebsd-questions-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTik=tPEjZscz4j5ZHLaZatFE%2B2JGvj72WzcZF8iP>