Public bug reported:

In order to get the details of volume groups, physical volumes and
logical volumes for the variety of LVM commands the bash completion
script uses vgscan, pvscan and lvscan respectively.

These commands require root permissions, so the auto completion does not
work.

Test case:

  lvextend <tab>

does not show any completions

A 'solution' (more of a hack) is to add the sudo command in front of these  
scan commands (in the completion file).
For example for finding the volume groups:

_lvm_volumegroups()
{
    COMPREPLY=( $(compgen -W "$( sudo vgscan 2>/dev/null | \
        sed -n -e 's|.*Found.*"\(.*\)".*$|\1|p' )" -- "$cur" ) )
}

When one has used sudo recently (so not login is required) the auto
completion, for the example above, works and shows the correct options.

This is obviously/unfortunately not a solution!

$ apt-cache policy bash-completion 
bash-completion:
  Installed: 1:2.1-2ubuntu1
  Candidate: 1:2.1-2ubuntu1
  Version table:
 *** 1:2.1-2ubuntu1 0
        100 /var/lib/dpkg/status
     1:2.0-1ubuntu3 0
        500 http://nl.archive.ubuntu.com/ubuntu/ saucy/main amd64 Packages

** Affects: bash-completion (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1272247

Title:
  Autocompletion of LVM volume groups, physical volumes and logical
  volumes does not work

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/1272247/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to