FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 06-19-2012, 05:56 PM
Alan Chandler
 
Default Using the find command

I am trying to debug why my system fails during bootup with udev
failing. I think its related to debian bug #677097


mountall-bootclean.sh cleans the run directory. This program sources
/lib/init/bootclean.sh


Inside there is a function clean_all

At one point it does

clean /run "! -xtype d ! -name utmp ! -name innd.pid" || ES=1
clean /run/lock "! -type d" || ES=1
clean /run/shm "! -type d" || ES=1

which looks as though (with the "! - xtype d...") that its trying not to
recurse down the subdirectories of /run (otherwise why follow the clean
/run with clean /run/lock)


the clean routine ends up passing its parameter to find

what in effect is happening is its cd to /run
then calls find

find . "! -xtype d ! -name utmp ! -name innd.pid" -delete

I tried running
find . "! -xtype d ! -name utmp ! -name innd.pid"

which is the same command without the -delete action - so I am assuming
it "prints" the names instead


What happens it that

a) it lists all the files in all subdirectories
b) it finishes up with a line which says find: `! -xtype d ! -name utmp
! -name innd.pid': No such file or directory


I guess this is what is ultimately wrong - since it deletes the
/run/udev directory which udev is using.



However I can't find any real documentation on find which explains why
it outputs that error message. Can any gurus out there explain




--
Alan Chandler
http://www.chandlerfamily.org.uk


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4FE0BD3D.60007@chandlerfamily.org.uk">http://lists.debian.org/4FE0BD3D.60007@chandlerfamily.org.uk
 
Old 06-19-2012, 06:42 PM
Shane Johnson
 
Default Using the find command

Alan,
from what I can see, it's just supposed to delete files and not touch
directories, any files name utmp or innd.pid. the ! prefixing the
tests negates the test to pull the opposite. By using xtype it's just
handling links differently. This command shouldn't be deleting your
udev directory. (the ! -xtype d is the part that singles the
directories out).



On Tue, Jun 19, 2012 at 11:56 AM, Alan Chandler
<alan@chandlerfamily.org.uk> wrote:
> I am trying to debug why my system fails during bootup with udev failing. *I
> think its related to debian bug #677097
>
> mountall-bootclean.sh cleans the run directory. This program sources
> /lib/init/bootclean.sh
>
> Inside there is a function clean_all
>
> At one point it does
>
> * *clean /run "! -xtype d ! -name utmp ! -name innd.pid" || ES=1
> * *clean /run/lock "! -type d" || ES=1
> * *clean /run/shm "! -type d" || ES=1
>
> which looks as though (with the "! - xtype d...") that its trying not to
> recurse down the subdirectories of /run (otherwise why follow the clean /run
> with clean /run/lock)
>
> the clean routine ends up passing its parameter to find
>
> what in effect is happening is its cd to /run
> then calls find
>
> find . "! -xtype d ! -name utmp ! -name innd.pid" -delete
>
> I tried running
> find . "! -xtype d ! -name utmp ! -name innd.pid"
>
> which is the same command without the -delete action - so I am assuming it
> "prints" the names instead
>
> What happens it that
>
> a) it lists all the files in all subdirectories
> b) it finishes up with a line which says find: `! -xtype d ! -name utmp !
> -name innd.pid': No such file or directory
>
> I guess this is what is ultimately wrong - since it deletes the /run/udev
> directory which udev is using.
>
>
> However I can't find any real documentation on find which explains why it
> outputs that error message. *Can any gurus out there explain
>
>
>
> --
> Alan Chandler
> http://www.chandlerfamily.org.uk
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject
> of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: http://lists.debian.org/4FE0BD3D.60007@chandlerfamily.org.uk
>



--
Shane D. Johnson
IT Administrator
Rasmussen Equipment


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAPLO1L6_pPZPm9MJO9tPHsknro-F87CCxRmahwxDjcTBkRrW9A@mail.gmail.com">http://lists.debian.org/CAPLO1L6_pPZPm9MJO9tPHsknro-F87CCxRmahwxDjcTBkRrW9A@mail.gmail.com
 
Old 06-19-2012, 06:56 PM
Alan Chandler
 
Default Using the find command

On 19/06/12 19:42, Shane Johnson wrote:

Alan,
from what I can see, it's just supposed to delete files and not touch
directories, any files name utmp or innd.pid. the ! prefixing the
tests negates the test to pull the opposite. By using xtype it's just
handling links differently. This command shouldn't be deleting your
udev directory. (the ! -xtype d is the part that singles the
directories out).




I think it needs a -maxdepth 1. What I think is happening is that yes,
its leaving out the directory, but it is still recursing into them and
listing the files within


So the directory remains, but the files in it do not.

The quotes were a red herring - its needed to make all options pass as
a single parameter to the routine clean,


I am just experimenting with that now.




--
Alan Chandler
http://www.chandlerfamily.org.uk


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4FE0CB52.6030305@chandlerfamily.org.uk">http://lists.debian.org/4FE0CB52.6030305@chandlerfamily.org.uk
 
Old 06-20-2012, 06:35 AM
Cam Hutchison
 
Default Using the find command

Alan Chandler <alan@chandlerfamily.org.uk> writes:

>At one point it does

> clean /run "! -xtype d ! -name utmp ! -name innd.pid" || ES=1
> clean /run/lock "! -type d" || ES=1
> clean /run/shm "! -type d" || ES=1

>which looks as though (with the "! - xtype d...") that its trying not to
>recurse down the subdirectories of /run (otherwise why follow the clean
>/run with clean /run/lock)

No, that does not stop find recursing into directories. It will just stop
it performing its action on directories. That is, it will not delete
directories.

To stop recursion into directories, there would have to be a -prune
in there somewhere.

>what in effect is happening is its cd to /run
>then calls find

>find . "! -xtype d ! -name utmp ! -name innd.pid" -delete

This is not correct. It will run find without those quotes since the
invocation of the find(1) command in the clean() function does not use
quotes around the variable expansion.

>I tried running
>find . "! -xtype d ! -name utmp ! -name innd.pid"

That is trying to treat the whole part within the quotes as a single
filename, which is why you get the error:

>b) it finishes up with a line which says find: `! -xtype d ! -name utmp
>! -name innd.pid': No such file or directory

It is the same as running:

find dir1 dir2

which will then just print out all the files/directories under these two
directories.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 32f3.4fe16f30.6f564@xionine.xdna.net">http://lists.debian.org/32f3.4fe16f30.6f564@xionine.xdna.net
 

Thread Tools




All times are GMT. The time now is 07:05 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org