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

Re: rcS



Ren Weili wrote:
> 
> hallo,
>         I can not understand line 41 in /etc/init.d/rcS:
> 
>                 [ ! -f "$i" ] && continue
> 
>         all files under /etc/rcS.d are symbolinks.
>         and [ ! -f "$i" ] equals false.
> 
>         so is this line yet necessary here ?
> 

The comment '# Ignore dangling symlinks for now' seems pretty
self-explanatory to me...  try this:

# touch thing
# ln -s thing thing2
# [ ! -f thing2 ] && echo "thing2 doesn't exist"
# rm thing
# [ ! -f thing2 ] && echo "thing2 doesn't exist"
thing2 doesn't exist
#

It is just skipping any links in rc?.d where the 'real' file linked to
has been removed from /etc/init.d - this is something in the nature of a
sanity check.

Tom



Reply to: