Re: How can I avoid completion using chkconfig on RHEL10?

"Chris Ross (cross2)" <[email protected]> Tue, 24 Feb 2026 19:34:47 +0000
Newsgroups gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user
Message-ID <MN2PR11MB464573BE9741A311F633D9168C74A@MN2PR11MB4645.namprd11.prod.outlook.com>
It turns out to be more complicated than that. This machine can’t really even run service. I mean, if I ask it a very specific and well-formed question it’s okay:



* cross2@build2 ~ ❯ service autofs status
* Redirecting to /bin/systemctl status autofs.service
* ● autofs.service - Automounts filesystems on demand
* Loaded: loaded (/usr/lib/systemd/system/autofs.service; enabled; preset: disabled) 
* Active: active (running) since Fri 2026-02-20 12:52:49 EST; 4 days ago
* Invocation: 99bb6a418769452a9e3466905bbcff88
* Main PID: 7052 (automount)
* Tasks: 8 (limit: 3355442)
* Memory: 28.3M (peak: 37.1M)
* CPU: 10.000s
* CGroup: /system.slice/autofs.service
* └─7052 /usr/sbin/automount --systemd-service --dont-check-daemon
* cross2@build2 ~ ❯



But, if I try to do something like you mention below, it goes “less well”. 



* cross2@build2 ~ ❯ service --status-all
* /etc/init.d/filebeat: line 40: /etc/rc.d/init.d/functions: No such file or directory
* /etc/init.d/filebeat: line 44: status: command not found
* /etc/init.d/filebeat: line 90: status: command not found
* cross2@build2 ~ ❯ ls -l /etc/rc.d/init.d/
* total 4
* -rw-r--r--. 1 root root 1131 Mar 9 2025 README
* cross2@build2 ~ ❯ ls -l /etc/init.d
* total 4
* -rwxr-xr-x. 1 root root 2602 Nov 15 2022 filebeat
* cross2@build2 ~ ❯ 



Apparently there is an “initscripts” package that will install these things, and I don’t know why the “filebeat” package is the only thing still supplying an init.d script. But. 😉


So I’m not sure what to suggest with the _services completer, but a more specific and/or complicated solution may be needed.


I’ll try to cons up a chkconfig() function as you suggested, with what I have that works.


Thanks all.


-Chris



From: Bart Schaefer <[email protected]>
Date: Tuesday, 24 February 2026 at 13:32
To: Chris Ross (cross2) <[email protected]>
Cc: [email protected] <[email protected]>, [email protected] <[email protected]>
Subject: Re: How can I avoid completion using chkconfig on RHEL10?


On Tue, Feb 24, 2026 at 10:12 AM Chris Ross (cross2) <[email protected]> wrote:
>
> Anyway. Has this changed already in more recent versions, and if not, I think it should. It should at least confirm that chkconfig is an installed command before invoking it.

The _services completer hasn't been updated since 2012, so it probably
is due for some maintenance.

This is a poor but possibly useful substitute in the meantime:
chkconfig() { service --status-all | awk '{print $4}' }
smime.p7s (application/x-pkcs7-signature, 9.1 KB) - not displayed