+ rc = snprintf(userid, sizeof userid, "%d", uid);
+ assert(rc < (int)(sizeof userid));
+ /* try dpath for the user */
+ if (j_read_string_at(odp, userid, dpath))
+ return 0;
+ }
+
+ /* get uname */
+ if (!j_read_string_at(appli, "unit-name", &uname)) {
+ ERROR("'unit-name' missing in appli description %s", json_object_get_string(appli));
+ goto inval;
+ }
+
+ /* is user parametric? */
+ arodot = strchr(uname, '@');
+ if (arodot && *++arodot == '.') {
+ if (!odp) {
+ /* get userid */
+ if (uid < 0) {
+ ERROR("unexpected uid %d", uid);
+ goto inval;
+ }
+ rc = snprintf(userid, sizeof userid, "%d", uid);
+ assert(rc < (int)(sizeof userid));
+
+ /* create the dpaths of known users */
+ odp = json_object_new_object();
+ if (!odp)
+ goto nomem;
+ json_object_object_add(appli, key_unit_d_path, odp);
+ }
+
+ /* get dpath of userid */
+ nun = alloca((size_t)(arodot - uname) + strlen(userid) + strlen(arodot) + 1);
+ stpcpy(stpcpy(stpncpy(nun, uname, (size_t)(arodot - uname)), userid), arodot);
+ dp = systemd_unit_dpath_by_name(*isuser, nun, 1);
+ if (dp == NULL) {
+ ERROR("Can't load unit of name %s for %s: %m", nun, uscope);
+ goto error;
+ }
+ /* record the dpath */
+ if (!j_add_string(odp, userid, dp)) {
+ free(dp);
+ goto nomem;
+ }
+ free(dp);
+ j_read_string_at(odp, userid, dpath);
+ } else {
+ /* get dpath */