INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/conf/org.tizen.system.storage.conf DESTINATION /etc/dbus-1/system.d)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/systemd/org.tizen.system.storage.service DESTINATION /usr/share/dbus-1/system-services)
INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/systemd/ DESTINATION lib/systemd/system
FILES_MATCHING
PATTERN "storaged.service")
%manifest %{name}.manifest
%license LICENSE.Apache-2.0
%config %{_sysconfdir}/dbus-1/system.d/org.tizen.system.storage.conf
+%{_datadir}/dbus-1/system-services/org.tizen.system.storage.service
%{_unitdir}/multi-user.target.wants/storaged.service
%{_unitdir}/storaged.service
%{_bindir}/storaged
return G_SOURCE_CONTINUE;
}
-static gboolean storaged_notify(gpointer data)
+static void dbus_name_acquired(GDBusConnection *connection, const gchar *name, gpointer user_data)
{
_I("sd_notify(READY=1)");
sd_notify(0, "READY=1");
- return G_SOURCE_REMOVE;
}
int main(int argc, char **argv)
modules_init(NULL);
- ret = dbus_handle_request_bus_name(handle, STORAGED_BUS_NAME, NULL, NULL);
+ ret = dbus_handle_request_bus_name(handle, STORAGED_BUS_NAME, dbus_name_acquired, NULL);
if (ret <= 0) {
_E("Fail to request bus name");
dbus_handle_check_owner_name(NULL, STORAGED_BUS_NAME);
_E("aw_register failed");
}
- g_idle_add(storaged_notify, NULL);
-
g_main_loop_run(loop);
modules_deinit(NULL);