Skip to content

Commit

Permalink
Fixed creating /run directory
Browse files Browse the repository at this point in the history
Relates to: #997

The /run directory is being cleaned up on every system boot.
If the /run/bluechi directory is only created during RPM
install, it is removed on the next system shutdown.
Therefore, the tmpfiles.d is being used to ensure that the
/run/bluechi directory will be recreated on each boot - similar
to /run/podman.

Signed-off-by: Michael Engel <[email protected]>
  • Loading branch information
engelmi committed Dec 18, 2024
1 parent 759f3a4 commit dab4207
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bluechi.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ This package contains the controller service.
%ghost %{_sysconfdir}/bluechi/controller.conf
%dir %{_sysconfdir}/bluechi
%dir %{_sysconfdir}/bluechi/controller.conf.d
%dir %{_rundir}/bluechi
%doc README.md
%doc README.developer.md
%license LICENSE
Expand All @@ -92,6 +91,11 @@ This package contains the controller service.
%{_unitdir}/bluechi-controller.service
%{_unitdir}/bluechi-controller.socket

# Create UDS directory on install and setup tmpfile for reboots
%dir %{_rundir}/bluechi
%attr(700, root, root) %{_rundir}/bluechi
%{_tmpfilesdir}/%{name}.conf


#####################
### bluechi-agent ###
Expand Down
5 changes: 5 additions & 0 deletions config/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,8 @@ install_data(
'controller.conf.d/README.md',
install_dir : join_paths(get_option('sysconfdir') / 'bluechi' / 'controller.conf.d')
)

install_data(
'tmpfile/bluechi.conf',
install_dir : join_paths(get_option('prefix'), 'lib', 'tmpfiles.d')
)
1 change: 1 addition & 0 deletions config/tmpfile/bluechi.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
D! /run/bluechi 0700 root root

0 comments on commit dab4207

Please sign in to comment.