[systemd-devel] How to get used to systemd vs init

Chad ccolumbu at gmail.com
Tue Jun 23 16:43:53 PDT 2015


On 6/23/2015 4:26 PM, Reindl Harald wrote:
>
> Am 24.06.2015 um 01:07 schrieb Chad:
>>> You could do something like:
>>>
>>> systemctl start htt<tab>
>>> systemctl st<tab>
>>>
>>> or else, and it will complete it.
>> I use bash. This is a cool trick that systemd has over init.d. I know
>> not all programs can do that shell completion, for example
>> /etc/init.d/httpd res<tab> does not work (I try it all the time out of
>> tab completion habit!)
>
> not true, that's just because you don't use the correct command and call a script which is not known to 
> bash-completion directly
>
> [root at honeypot:~]$ service honeypot
> restart  start    status   stop
> [root at honeypot:~]$ service honeypot ^C
> [root at honeypot:~]$ cat /etc/redhat-release
> CentOS release 6.6 (Final)
>
> Name        : bash-completion
> Arch        : noarch
> Epoch       : 1
> Version     : 1.3
> Release     : 7.el6
> Size        : 576 k
> Repo        : installed
> Summary     : Programmable completion for Bash
> URL        : http://bash-completion.alioth.debian.org/
> License     : GPLv2+
> Beschreibung : bash-completion is a collection of shell functions that take advantage
>              : of the programmable completion feature of bash.
>
> [root at honeypot:~]$ rpm -q --file /etc/bash_completion.d/service
> bash-completion-1.3-7.el6.noarch
>
>
Mr. Harald,
Thanks again for your reply, I did not have bash-completion installed (and did not know it existed).
I installed it on one of the servers and sure enough res<tab> completes to "restart" now!
Cool, I will be adding that to all my servers and to my new server set-up scripts and notes.
Super awesome feature!

^C



More information about the systemd-devel mailing list