Project

General

Profile

Actions

Bug #5593

closed

Recent versions of svcadm invoked for multiple FMRIs say "Partial FMRI matches multiple instances"

Added by Jim Klimov over 7 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
smf
Start date:
2015-02-05
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

Initial discussion on the mailing list: http://comments.gmane.org/gmane.os.illumos.devel/20204

With recent illumos-based distros (OI Hipster, OmniOS bloody) unlike older distros (from Solaris 10 up to OI 151a8 at least) there is a regression in that calling "svcadm <command> abbrfmri1 abbrfmri2 ... abbrfmriN" no longer works and instead complains that "Partial FMRI matches multiple instances". This happens for abbreviated FMRIs that do unambiguously name a service instance, be it a shortened name of a single-instance service or a unique name of a non-"default" instance (where no other services have an instance with the same name). Thus, each partial FMRI in reality matches one instance, so the message is wrong as well as the ultimate failure of the command (as a way to protect from mistakes due to ambiguity).

  1. svcadm clear frequent hourly weekly daily monthly
    svcadm: Partial FMRI matches multiple instances
  1. svcadm clear {frequent,hourly,weekly,daily,monthly}
    svcadm: Partial FMRI matches multiple instances
Single-argument works as it should, and also proves that the short FMRI names are not in fact ambiguous:
  1. for X in frequent hourly weekly daily monthly; do svcadm clear $X; done
Also "svcs" proves that:
  1. svcs frequent hourly weekly daily monthly
    STATE STIME FMRI
    online Feb_03 svc:/system/filesystem/zfs/auto-snapshot:weekly
    online Feb_03 svc:/system/filesystem/zfs/auto-snapshot:monthly
    maintenance Feb_03 svc:/system/filesystem/zfs/auto-snapshot:hourly
    maintenance Feb_03 svc:/system/filesystem/zfs/auto-snapshot:frequent
    maintenance Feb_04 svc:/system/filesystem/zfs/auto-snapshot:daily
Same for separate single-instance services:
  1. svcadm restart autofs nfs/client
    svcadm: Partial FMRI matches multiple instances
  1. svcs autofs nfs/client
    STATE STIME FMRI
    disabled Jan_28 svc:/network/nfs/client:default
    online Jan_28 svc:/system/filesystem/autofs:default
Overall, "svcs -a" also finds nothing hidden:
  1. svcs -a | egrep 'frequent|hourly|weekly|daily|monthly|autofs|nfs/client'
    disabled Jan_28 svc:/network/nfs/client:default
    online Jan_28 svc:/system/filesystem/autofs:default
    online Feb_03 svc:/system/filesystem/zfs/auto-snapshot:weekly
    online Feb_03 svc:/system/filesystem/zfs/auto-snapshot:monthly
    maintenance Feb_03 svc:/system/filesystem/zfs/auto-snapshot:hourly
    maintenance Feb_03 svc:/system/filesystem/zfs/auto-snapshot:frequent
    maintenance Feb_04 svc:/system/filesystem/zfs/auto-snapshot:daily

The regression was probably introduced in this commit:
https://github.com/joyent/illumos-joyent/commit/5d047bee30f80f141cc55b60b0f84cb75f5ad80d
(jjelinek authored on Oct 22, 2013: OS-2567 SMF: allow svcadm to act on multiple instances simultaneously)
and the error may be lurking around usr/src/lib/libscf/common/lowlevel.c:6826 as of that commit:
https://github.com/joyent/illumos-joyent/commit/5d047bee30f80f141cc55b60b0f84cb75f5ad80d#diff-d873aa76861657c835899e99f573a6f1R6826

Following the comments of the code above, I see that a contrived wildcard in command-line solves the issue:
  1. svcadm clear frequent hourly weekly daily monthly
    (this worked)

At the very least, this looks like a regression (worked before, but no longer does, and some scripts/habits may and do rely on old behavior) and the usecase in example is not something the manpage says it is protecting against (abbreviated FMRI is not ambiguous).


Related issues

Related to illumos gate - Bug #8688: svcadm does not handle multiple partial FMRI argumentsClosedAndy Fiddaman2017-09-28

Actions
Actions

Also available in: Atom PDF