src/modules/systemd/systemd.c
/*
 * systemd_get_service_path fills the given buffer with the first segment of the
 * Service.ExecStart value for the given service object
 */
systemd_get_service_path fills the given buffer with the first segment of the
Service.ExecStart value for the given service object
systemd_get_service_path fills the given buffer with the first segment of the Service . ExecStart value for the given service object
int systemd_get_service_path(char *s, size_t n, const char *path)
{
  DBusMessageIter *val;
  DBusMessageIter arr, obj;
  char *v = NULL;
  val = dbus_get_property(
                      SYSTEMD_SERVICE_NAME,
                      path,
                      SYSTEMD_SERVICE_INTERFACE,
                      "ExecStart");
  if (NULL == val)
    return FAIL;
  dbus_message_iter_recurse(val, &arr);   
  dbus_message_iter_recurse(&arr, &obj);  
  dbus_message_iter_get_basic(&obj, &v);  
  if (NULL == v)
    return FAIL;
  zbx_strlcpy(s, v, n);
  return SUCCEED;
}
int systemd_get_service_path ( char * s , size_t n , const char * path ) { DBusMessageIter * val ; DBusMessageIter arr , obj ; char * v = NULL ; val = dbus_get_property ( SYSTEMD_SERVICE_NAME , path , SYSTEMD_SERVICE_INTERFACE , " " ) ; if ( NULL == val ) return FAIL ; dbus_message_iter_recurse ( val , & arr ) ; dbus_message_iter_recurse ( & arr , & obj ) ; dbus_message_iter_get_basic ( & obj , & v ) ; if ( NULL == v ) return FAIL ; zbx_strlcpy ( s , v , n ) ; return SUCCEED ; }
systemd_get_service_path fills the given buffer with the first segment of the
 Service.ExecStart value for the given service object
systemd_get_service_path fills the given buffer with the first segment of the Service . ExecStart value for the given service object
// type: a(sasbttuii) // -> array // -> struct // string