feat: watch systemd unit new and remove to sync state

add default values to XDG_DATA_DIRS if it dosen't set

Signed-off-by: ComixHe <heyuming@deepin.org>
Signed-off-by: black-desk <me@black-desk.cn>
This commit is contained in:
ComixHe
2023-08-08 15:10:32 +08:00
committed by Comix
parent 4687265e65
commit 799100436c
13 changed files with 313 additions and 52 deletions

View File

@ -6,5 +6,9 @@ target_link_libraries(${APP_LAUNCH_HELPER_BIN} PRIVATE
PkgConfig::SYSTEMD
)
target_include_directories(${APP_LAUNCH_HELPER_BIN} PRIVATE
${PROJECT_SOURCE_DIR}/src
)
include(GNUInstallDirs)
install(TARGETS ${APP_LAUNCH_HELPER_BIN} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/deepin/application-manager/)

View File

@ -15,6 +15,7 @@
#include <cstdlib>
#include <map>
#include <thread>
#include "constant.h"
enum class ExitCode { SystemdError = -3, InvalidInput = -2, InternalError = -1, Done = 0, Waiting = 1 };
@ -25,10 +26,6 @@ struct JobRemoveResult
ExitCode result{ExitCode::Waiting};
};
constexpr static auto SystemdService = "org.freedesktop.systemd1";
constexpr static auto SystemdObjectPath = "/org/freedesktop/systemd1";
constexpr static auto SystemdInterfaceName = "org.freedesktop.systemd1.Manager";
using msg_ptr = sd_bus_message *;
using bus_ptr = sd_bus *;