grub2 confusion

JB jb.1234abcd at gmail.com
Thu Oct 6 19:25:19 UTC 2011


David Lehman <dlehman <at> redhat.com> writes:

> ... 
> >   # rpmls grub2|grep ^l
> >   lrwxrwxrwx  /etc/grub2.cfg
> >   # file /etc/grub2.cfg
> >   /etc/grub2.cfg: symbolic link to `/boot/grub2/grub.cfg'
> > 
> > So, more symlink madness. /etc/grub2.cfg -> /boot/grub2/grub.cfg
> > and it doesn't even work flawlessly:
> > 
> >   # grub2-mkconfig -o /etc/grub2.cfg
> >   Generating grub.cfg ...
> 
> Why would you do that? You're asking for trouble specifying a symlink as
> an output file unless you know the program you're running will be
> appending to it instead of creating it. You know where the config
> actually is, so why test fate by using a symlink? Do we need to stop
> creating that symlink to prevent you from misusing it?
> ...

I think you criticize him unjustly.

$ man 2 open
...
      O_APPEND
              The file is opened in append mode. 
...
       O_CREAT
              If  the file does not exist it will be created.
...

$ man 7 symlink
...
   System calls
       The  first area is symbolic links used as filename arguments for system
       calls.

       Except as noted below, all system calls  follow  symbolic  links.   For
       example,  if  there  were a symbolic link slink which pointed to a file
       named afile, the system call open("slink"  ...)  would  return  a  file
       descriptor referring to the file afile.
       ...
       ... Certain other system calls optionally  follow  symbolic
       links.   They  are:  faccessat(2),  fchownat(2), fstatat(2), linkat(2),
       open(2), openat(2),  and  utimensat(2);  see  their  manual  pages  for
       details.
...

JB





More information about the test mailing list