grml-etc-core
grml-etc-core copied to clipboard
grml-zshrc: provide native systemd support in Start/Stop/... functions and cmdline completion
Our __start_stop
function, which is used as helper function within our Start
, Stop
, Restart
,... functions doesn't provide native support for systemd. While usage of service
still works, it would be nice if we could support systemctl usage.
Also our _grmlinitd
function doesn't complete systemd unit files, but only init scripts. This means that e.g. Start N<tab>
doesn't detect/complete NetworkManager.service
, as the network-manager Debian package ships a systemd unit file but not an init script.
Are you aiming at supporting both, or only systemd?
I don't have any intentions to drop sysv-rc/init-script support :)
@evgeni care to elaborate? :) Is there any drawback, if we still support init scripts?
More code with IMHO zero benefit, unless you intend to run with something else than systemd as pid 1.
Actually, it makes things even more complicated. If you have systemd with sysv-generator enabled, you get a unit file per sysv init script, and your completion would show both, unless you deduplicate somehow. And if you have sysv-generator disabled, you get completion for scripts that can't be run.
Alright, I'll look into it and see what we could do, thanks for your prompt (nice word-play! :)) feedback!