Bug 1121212 - bash-completion for systemctl is somewhat broken
Summary: bash-completion for systemctl is somewhat broken
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 20
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2014-07-18 16:10 UTC by Vadim Raskhozhev
Modified: 2014-07-18 16:16 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-07-18 16:16:54 UTC

Attachments (Terms of Use)
Patch for bash-completion for systemctl (633 bytes, patch)
2014-07-18 16:10 UTC, Vadim Raskhozhev
no flags Details | Diff

Description Vadim Raskhozhev 2014-07-18 16:10:56 UTC
Created attachment 919136 [details]
Patch for bash-completion for systemctl

Description of problem:

bash-completion does not work as expected when I try to see possible completions after, for example, systemctl show -p <Tab>

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Ensure you have bash-completion working
2. type something like `systemctl show -p ` and press <Tab>

Actual results:
bash: systemd: command not found...

Expected results:
Display all 239 possibilities? (y or n)
Accept                              ExecStopPost                        MemoryLimit                         SecureBits
After                               ExecStopPre                         MessageQueueMaxMessages             SendBuffer
Alias                               Features                            MessageQueueMessageSize             SendSIGHUP
AllowIsolate                        FinishTimestamp                     MountFlags                          SendSIGKILL
Also                                FinishTimestampMonotonic            NFailedJobs                         Service
Backlog                             FirmwareTimestampMonotonic          Nice                                ShowStatus
Before                              FreeBind                            NInstalledJobs                      ShutdownWatchdogUSec
BindIPv6Only                        FsckPassNo                          NJobs                               Slice
BindsTo                             GeneratorsFinishTimestamp           NNames                              SmackLabel
BindTo                              GeneratorsFinishTimestampMonotonic  NonBlocking                         SmackLabelIPIn
BindToDevice                        GeneratorsStartTimestamp            NoNewPrivileges                     SmackLabelIPOut
BlockIOAccounting                   GeneratorsStartTimestampMonotonic   NotifyAccess                        SocketMode
BlockIODeviceWeight                 Group                               OnActiveSec                         Sockets
BlockIOReadBandwidth                GuessMainPID                        OnBootSec                           SourcePath
BlockIOWeight                       IgnoreOnIsolate                     OnCalendar                          StandardError
BlockIOWriteBandwidth               IgnoreOnSnapshot                    OnFailure                           StandardInput
Broadcast                           IgnoreSIGPIPE                       OnFailureIsolate                    StandardOutput
BusName                             InaccessibleDirectories             OnStartupSec                        StartLimitAction
Capabilities                        InitRDTimestamp                     OnUnitActiveSec                     StartLimitBurst
CapabilityBoundingSet               InitRDTimestampMonotonic            OnUnitInactiveSec                   StartLimitInterval
ConditionACPower                    IOSchedulingClass                   OOMScoreAdjust                      StopWhenUnneeded
ConditionCapability                 IOSchedulingPriority                Options                             SuccessExitStatus
ConditionDirectoryNotEmpty          IPTOS                               PAMName                             SupplementaryGroups
ConditionFileIsExecutable           IPTTL                               PartOf                              SyslogFacility
ConditionFileNotEmpty               JobTimeoutSec                       PassCredentials                     SyslogIdentifier
ConditionHost                       KeepAlive                           PassSecurity                        SyslogLevel
ConditionKernelCommandLine          KernelTimestamp                     PathChanged                         SyslogLevelPrefix
ConditionNull                       KernelTimestampMonotonic            PathExists                          SystemCallFilter
ConditionPathExists                 KillMode                            PathExistsGlob                      SysVStartPriority
ConditionPathExistsGlob             KillSignal                          PathModified                        TCPCongestion
ConditionPathIsDirectory            LimitAS                             PermissionsStartOnly                TCPWrapName
ConditionPathIsMountPoint           LimitCORE                           PIDFile                             TimeoutSec
ConditionPathIsReadWrite            LimitCPU                            PipeSize                            TimeoutStartSec
ConditionPathIsSymbolicLink         LimitDATA                           Priority                            TimeoutStopSec
ConditionSecurity                   LimitFSIZE                          PrivateNetwork                      TimerSlackNSec
ConditionVirtualization             LimitLOCKS                          PrivateTmp                          Transparent
ConfirmSpawn                        LimitMEMLOCK                        Progress                            TTYPath
Conflicts                           LimitMSGQUEUE                       PropagateReloadFrom                 TTYReset
CPUAccounting                       LimitNICE                           PropagateReloadTo                   TTYVHangup
CPUAffinity                         LimitNOFILE                         PropagatesReloadTo                  TTYVTDisallocate
CPUSchedulingPolicy                 LimitNPROC                          ReadOnlyDirectories                 Type
CPUSchedulingPriority               LimitRSS                            ReadWriteDirectories                UMask
CPUSchedulingResetOnFork            LimitRTPRIO                         ReceiveBuffer                       Unit
CPUShares                           LimitRTTIME                         RefuseManualStart                   UnitPath
DefaultDependencies                 LimitSIGPENDING                     RefuseManualStop                    UnitsLoadFinishTimestamp
DefaultStandardError                LimitSTACK                          ReloadPropagatedFrom                UnitsLoadFinishTimestampMonotonic
DefaultStandardOutput               ListenDatagram                      RemainAfterExit                     UnitsLoadStartTimestamp
Description                         ListenFIFO                          RequiredBy                          UnitsLoadStartTimestampMonotonic
DeviceAllow                         ListenMessageQueue                  Requires                            User
DevicePolicy                        ListenNetlink                       RequiresMountsFor                   UserspaceTimestamp
DirectoryMode                       ListenSequentialPacket              RequiresOverridable                 UserspaceTimestampMonotonic
DirectoryNotEmpty                   ListenSpecial                       Requisite                           UtmpIdentifier
Documentation                       ListenStream                        RequisiteOverridable                Version
Environment                         LoaderTimestampMonotonic            Restart                             WantedBy
EnvironmentFile                     LogLevel                            RestartPreventExitStatus            Wants
ExecReload                          LogTarget                           RestartSec                          WatchdogSec
ExecStart                           MakeDirectory                       ReusePort                           What
ExecStartPost                       Mark                                RootDirectory                       Where
ExecStartPre                        MaxConnections                      RootDirectoryStartOnly              WorkingDirectory
ExecStop                            MemoryAccounting                    RuntimeWatchdogUSec                 

Additional info:
The problem goes away after replacing systemd with /usr/lib/systemd/systemd in /usr/share/bash-completion/completions/systemctl (see patch attached) and reloading bash-completion rules.

Comment 1 Zbigniew Jędrzejewski-Szmek 2014-07-18 16:16:54 UTC
Thank you for the patch. The fix is more complicated, because we support installation of systemd binary in different paths (e.g. on Debian). A proper fix is upstream in http://cgit.freedesktop.org/systemd/systemd/commit/?id=c0a67aef31bb97.

Note You need to log in before you can comment on or make changes to this bug.