Skip to content

Commit

Permalink
tmpfiles.d: install and use systemd-tmpfiles.d mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihalko committed May 15, 2024
1 parent fe7ee72 commit 3d07b29
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions .packit/polkit.spec
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
%{_bindir}/pkttyagent
%dir %{_prefix}/lib/polkit-1
%{_prefix}/lib/polkit-1/polkitd
%{_tmpfilesdir}/polkit-tmpfiles.conf

# see upstream docs for why these permissions are necessary
%attr(4755,root,root) %{_bindir}/pkexec
Expand Down
1 change: 1 addition & 0 deletions data/polkit-tmpfiles.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d /etc/polkit-1/rules.d 0750 root polkitd - -
16 changes: 16 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,18 @@ if enable_logind
endif
config_h.set('HAVE_LIBSYSTEMD', enable_logind)

systemd_dep = dependency('systemd').found()
if systemd_dep
tmpfiles_conf = files(
'data/polkit-tmpfiles.conf'
)

install_data(
tmpfiles_conf,
install_dir: pk_prefix / 'lib/tmpfiles.d/'
)
endif

config_h.set('HAVE_PIDFD_OPEN', cc.get_define('SYS_pidfd_open', prefix: '#include <sys/syscall.h>') != '')

# User for running polkitd
Expand Down Expand Up @@ -404,6 +416,10 @@ output += ' Session tracking: ' + session_tracking + '\n'
if enable_logind
output += ' systemdsystemunitdir: ' + systemd_systemdsystemunitdir + '\n'
endif
if systemd_dep
output += ' systemdtmpfilesdir: ' + pk_prefix + '/lib/tmpfiles.d' + '\n'
endif

output += ' polkitd user: ' + polkitd_user + ' \n'
if polkitd_uid != '-'
output += ' polkitd UID: ' + polkitd_uid + ' \n'
Expand Down

0 comments on commit 3d07b29

Please sign in to comment.