Skip to content

Commit b715a10

Browse files
committed
Add systemd D-Bus activation
1 parent c956dd4 commit b715a10

8 files changed

+53
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[D-BUS Service]
22
Name=xyz.iinuwa.credentialsd.Credentials
33
Exec=@DAEMON_EXECUTABLE@
4+
SystemdService=xyz.iinuwa.credentialsd.Credentials.service
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[D-BUS Service]
22
Name=xyz.iinuwa.credentialsd.FlowControl
33
Exec=@DAEMON_EXECUTABLE@
4+
SystemdService=xyz.iinuwa.credentialsd.FlowControl.service
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[D-BUS Service]
22
Name=xyz.iinuwa.credentialsd.UiControl
33
Exec=@UI_EXECUTABLE@
4+
SystemdService=xyz.iinuwa.credentialsd.UiControl.service

meson.build

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ meson.add_dist_script(
2323
subdir('credentialsd-common')
2424
subdir('credentialsd')
2525
subdir('credentialsd-ui')
26-
subdir('dbus')
26+
subdir('dbus')
27+
subdir('systemd')

systemd/meson.build

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
systemd_config = configuration_data()
2+
# HACK: Not using libdir option, since on some distros (Fedora), libdir is `lib64`, but systemd is always in `lib`
3+
# If you know of a better way to do this, let me know
4+
systemd_user_service_dir = prefix / 'lib' / 'systemd' / 'user'
5+
systemd_config.set('DAEMON_EXECUTABLE', bindir / backend_executable_name)
6+
systemd_config.set(
7+
'UI_EXECUTABLE',
8+
bindir / gui_executable_name,
9+
)
10+
configure_file(
11+
input: 'xyz.iinuwa.credentialsd.Credentials.service.in',
12+
install_dir: systemd_user_service_dir,
13+
output: 'xyz.iinuwa.credentialsd.Credentials.service',
14+
configuration: systemd_config,
15+
)
16+
configure_file(
17+
input: 'xyz.iinuwa.credentialsd.FlowControl.service.in',
18+
install_dir: systemd_user_service_dir,
19+
output: 'xyz.iinuwa.credentialsd.FlowControl.service',
20+
configuration: systemd_config,
21+
)
22+
configure_file(
23+
input: 'xyz.iinuwa.credentialsd.UiControl.service.in',
24+
install_dir: systemd_user_service_dir,
25+
output: 'xyz.iinuwa.credentialsd.UiControl.service',
26+
configuration: systemd_config,
27+
)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[Unit]
2+
Description=Service for creating and storing user credentials
3+
4+
[Service]
5+
Type=dbus
6+
BusName=xyz.iinuwa.credentialsd.Credentials
7+
ExecStart=@DAEMON_EXECUTABLE@
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[Unit]
2+
Description=Internal helper service for credentialsd
3+
4+
[Service]
5+
Type=dbus
6+
BusName=xyz.iinuwa.credentialsd.FlowControl
7+
ExecStart=@DAEMON_EXECUTABLE@
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[Unit]
2+
Description=Internal helper service for credentialsd
3+
4+
[Service]
5+
Type=dbus
6+
BusName=xyz.iinuwa.credentialsd.UiControl
7+
ExecStart=@UI_EXECUTABLE@

0 commit comments

Comments
 (0)