Bug #8688

svcadm does not handle multiple partial FMRI arguments

Added by Andy Fiddaman 25 days ago. Updated 4 days ago.

Status:ClosedStart date:2017-09-28
Priority:NormalDue date:
Assignee:Andy Fiddaman% Done:

100%

Category:smf
Target version:-
Difficulty:Medium Tags:needs-triage

Description

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.


Related issues

Related to illumos gate - Feature #5021: SMF: allow svcadm to act on multiple instances simultaneously Closed 2014-07-18
Related to illumos gate - Bug #5593: Recent versions of svcadm invoked for multiple FMRIs say "Partial FMRI matches multiple instances" Closed 2015-02-05
Related to illumos gate - Bug #5112: svcadm manpage needs more 5021-related updates Closed 2014-08-21

History

#1 Updated by Andy Fiddaman 25 days ago

In summary:

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 \
/network/nfs/cbd /network/nfs/mapid

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

At present:

svcadm enable console-login -> Partial FMRI matches multiple instances

but:

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.

#2 Updated by Andy Fiddaman 21 days ago

  • Related to Feature #5021: SMF: allow svcadm to act on multiple instances simultaneously added

#3 Updated by Andy Fiddaman 21 days ago

  • Related to Bug #5593: Recent versions of svcadm invoked for multiple FMRIs say "Partial FMRI matches multiple instances" added

#4 Updated by Andy Fiddaman 20 days ago

  • Related to Bug #5112: svcadm manpage needs more 5021-related updates added

#5 Updated by Electric Monk 4 days ago

  • % Done changed from 0 to 100
  • Status changed from New to Closed

git commit ad3ad82ad2fb99c424a8482bd1908d08b990ccea

commit  ad3ad82ad2fb99c424a8482bd1908d08b990ccea
Author: Andy Fiddaman <omnios@citrus-it.net>
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 <hadfl@omniosce.org>
    Reviewed by: Chris Fraire <cfraire@me.com>
    Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom