Você pode usar padrões (incluindo shell globs ) com comandos systemctl
. Veja man systemctl
:
shell-style globs will be matched against currently loaded units; literal unit names, with or without a suffix, will be treated as in the first case. This means that literal unit names always refer to exactly one unit, but globs may match zero units and this is not considered an error.
Glob patterns use fnmatch(3), so normal shell-style globbing rules are used, and "*", "?", "[]" may be used. See glob(7) for more details. The patterns are matched against the names of currently loaded units, and patterns which do not match anything are silently skipped. For example:
# systemctl stop sshd@*.service
will stop all [email protected] instances.
Portanto, no seu caso: systemctl stop openvpn*
deve parar todos os serviços do OpenVPN.