Print this page
7711 SMF: Finish implementing support for degraded state
*** 23,32 ****
--- 23,33 ----
* Use is subject to license terms.
*/
/*
* Copyright 2015, Joyent, Inc. All rights reserved.
+ * Copyright 2017 RackTop Systems.
*/
/*
* svcadm - request adminstrative actions for service instances
*/
*** 1929,1938 ****
--- 1930,1946 ----
uu_warn(gettext("Instance \"%s\" is not online.\n"), wip->fmri);
exit_status = 1;
return (0);
}
+ if ((flags & MARK_TEMPORARY) == 0) {
+ uu_warn(gettext("Instance \"%s\" cannot be degraded "
+ "permantently.\n"), wip->fmri);
+ exit_status = 1;
+ return (0);
+ }
+
set_inst_action(wip->fmri, wip->inst, (flags & MARK_IMMEDIATE) ?
SCF_PROPERTY_DEGRADE_IMMEDIATE : SCF_PROPERTY_DEGRADED);
return (0);
}
*** 2505,2519 ****
if (argc - optind < 2)
usage();
if (strcmp(argv[optind], "degraded") == 0) {
- if (flags & MARK_TEMPORARY)
- uu_xdie(UU_EXIT_USAGE, gettext("-t may not be "
- "used with degraded.\n"));
callback = force_degraded;
-
} else if (strcmp(argv[optind], "maintenance") == 0) {
callback = force_maintenance;
} else {
usage();
}
--- 2513,2523 ----
*** 2527,2537 ****
if (argc > 0 && svcsearch)
usage();
if ((err = scf_walk_fmri(h, argc, argv, WALK_FLAGS, callback,
! NULL, &exit_status, pr_warn)) != 0) {
pr_warn(gettext("failed to iterate over "
"instances: %s\n"),
scf_strerror(err));
exit_status = UU_EXIT_FATAL;
}
--- 2531,2541 ----
if (argc > 0 && svcsearch)
usage();
if ((err = scf_walk_fmri(h, argc, argv, WALK_FLAGS, callback,
! (void *)flags, &exit_status, pr_warn)) != 0) {
pr_warn(gettext("failed to iterate over "
"instances: %s\n"),
scf_strerror(err));
exit_status = UU_EXIT_FATAL;
}