svcadm does not handle multiple partial FMRI arguments
Considering the following behaviour of svcadm in illumos gate:
1. svcadm enable console-login -> Partial FMRI matches multiple instances
2. svcadm enable \*console-login\* -> Okay
3. svcadm enable console-login:vt2 -> Okay
4. svcadm enable console-login:vt2 console-login:vt3 -> Partial FMRI matches multiple instances
5. svcadm enable console-login \*console-login:vt3 -> Okay
I consider that examples 4 and 5 exhibit the wrong behaviour. Each argument should be evaluated independently to determine if it matches multiple FMRIs with or without wildcards, rather than considering the arguments as a whole.
Updated by Andy Fiddaman about 3 years ago
5021 broke a behaviour of svcadm; the ability to specify multiple partial FMRIs as arguments, e.g.:
svcadm disable /network/nfs/nlockmgr /network/nfs/status \
This is because the change for 5021 looks at the entire set of arguments
at once and if any partial FMRI is found in conjunction with more than one
argument, then it generates an error.
So this is a specific regression and will be fixed under this issue.
However the automatic promotion of wildcards from any wildcard fmri to any other partial fmri seems wrong
svcadm enable console-login -> Partial FMRI matches multiple instances
svcadm enable console-login '*vtdaemon*' -> ok
However, there's a comment in the code that could be read in a way that
implies that this is desired behaviour so more discussion is required.
Taking this to the illumos developer list.
Updated by Electric Monk about 3 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit ad3ad82ad2fb99c424a8482bd1908d08b990ccea Author: Andy Fiddaman <email@example.com> Date: 2017-10-18T20:16:11.000Z 5112 svcadm manpage needs more 5021-related updates 5593 Recent versions of svcadm invoked for multiple FMRIs say "Partial FMRI matches multiple instances" 8688 svcadm does not handle multiple partial FMRI arguments Reviewed by: Dominik Hassler <firstname.lastname@example.org> Reviewed by: Chris Fraire <email@example.com> Reviewed by: Jerry Jelinek <firstname.lastname@example.org> Approved by: Robert Mustacchi <email@example.com>