summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2011-09-09 01:36:03 +0000
committerRobert Mustacchi <rm@joyent.com>2011-09-09 01:37:07 +0000
commit1f921722bc6f8c341f56e29c2469635800de3f6b (patch)
tree887bea1f4f0adcd46c2941335a7a33cb7d5adf8e /usr/src
parentf6388c7b9ebc79d93ea9e173ed8a0a2ea9e71d1e (diff)
downloadillumos-joyent-1f921722bc6f8c341f56e29c2469635800de3f6b.tar.gz
OS-593 lscf_instance_verify uses stale property group
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/svc/svccfg/svccfg_libscf.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/usr/src/cmd/svc/svccfg/svccfg_libscf.c b/usr/src/cmd/svc/svccfg/svccfg_libscf.c
index 8ac8590724..0bedae4261 100644
--- a/usr/src/cmd/svc/svccfg/svccfg_libscf.c
+++ b/usr/src/cmd/svc/svccfg/svccfg_libscf.c
@@ -6876,6 +6876,9 @@ lscf_instance_verify(scf_scope_t *scope, entity_t *svc, entity_t *inst)
* svcadm also expects that the SCF_PROPERTY_STATE property is present.
* So in addition to the property group being present, we need to wait
* for the property to be there in some form.
+ *
+ * Note that a property group is a frozen snapshot in time. To properly
+ * get beyond this, you have to refresh the property group each time.
*/
while ((ret = scf_pg_get_property(imp_pg, SCF_PROPERTY_STATE,
imp_prop)) != 0) {
@@ -6904,6 +6907,25 @@ lscf_instance_verify(scf_scope_t *scope, entity_t *svc, entity_t *inst)
ts.tv_nsec = pg_timeout % NANOSEC;
(void) nanosleep(&ts, NULL);
+
+ ret = scf_instance_get_pg(imp_inst, SCF_PG_RESTARTER, imp_pg);
+ if (ret != SCF_SUCCESS) {
+ warn(gettext("Failed to get restarter property "
+ "group for instance: %s\n"), inst->sc_name);
+ switch (ret) {
+ case SCF_ERROR_DELETED:
+ err = ENODEV;
+ break;
+ case SCF_ERROR_CONNECTION_BROKEN:
+ warn(gettext("Lost repository connection\n"));
+ err = ECONNABORTED;
+ break;
+ default:
+ bad_error("scf_service_get_instance", ret);
+ }
+
+ return (err);
+ }
}
/*