From 7c3ab7b3ab2afde645c1eb135f2ef8dbae5774d3 Mon Sep 17 00:00:00 2001 From: Jan-Michael Brummer Date: Mon, 30 Jan 2023 11:09:15 +0100 Subject: Add dbus service files (#21) Add proxyd service file and install it to systemd user dir. --- src/backend/dbus/meson.build | 20 ++++++++++++++++++++ src/backend/dbus/proxyd.service.in | 18 ++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 src/backend/dbus/proxyd.service.in diff --git a/src/backend/dbus/meson.build b/src/backend/dbus/meson.build index 5222a5f..8ab3bfe 100644 --- a/src/backend/dbus/meson.build +++ b/src/backend/dbus/meson.build @@ -1,6 +1,12 @@ if get_option('dbus') gdbus_codegen = find_program('gdbus-codegen') + unitdir = '' + systemd = dependency('systemd', required: false) + if systemd.found() + unitdir = systemd.get_variable(pkgconfig: 'systemduserunitdir') + endif + px_interface = [ 'org.libproxy.proxy.xml' ] @@ -43,6 +49,20 @@ if get_option('dbus') 'proxyd', proxyd_sources, dependencies: proxyd_deps, + install_dir: join_paths(px_prefix, get_option('libexecdir')), install: true, ) + + service_data = configuration_data() + service_data.set('LIBEXECDIR', join_paths(px_prefix, get_option('libexecdir'))) + + service = configure_file( + input: 'proxyd.service.in', + output: 'proxyd.service', + configuration: service_data + ) + + if unitdir != '' + install_data(service, install_dir: unitdir) + endif endif diff --git a/src/backend/dbus/proxyd.service.in b/src/backend/dbus/proxyd.service.in new file mode 100644 index 0000000..2e2a7cc --- /dev/null +++ b/src/backend/dbus/proxyd.service.in @@ -0,0 +1,18 @@ +[Unit] +Description=Libproxy user service + +[Service] +Type=dbus +BusName=org.libproxy.proxy +ExecStart=@LIBEXECDIR@/proxyd +#Environment="G_MESSAGES_DEBUG=all" +Restart=on-failure + +MemoryDenyWriteExecute=yes +PrivateTmp=yes +ProtectHome=yes +ProtectSystem=full +RestrictRealtime=yes + +[Install] +WantedBy=default.target \ No newline at end of file -- cgit v1.2.1