From ae55415b85ce7739c3816992a08b63f0ef0f34fe Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 28 Jan 2022 17:25:24 +0100 Subject: Restricted user and group of the daemon --- daemon/CMakeLists.txt | 3 +++ daemon/hwd.conf | 1 + daemon/hwd.service.in | 2 ++ 3 files changed, 6 insertions(+) create mode 100644 daemon/hwd.conf (limited to 'daemon') diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 4a3f436..54d3950 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -20,3 +20,6 @@ configure_file(hwd.service.in hwd.service) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/hwd.service DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/systemd/system ) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/hwd.conf + DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/sysusers.d + ) diff --git a/daemon/hwd.conf b/daemon/hwd.conf new file mode 100644 index 0000000..bdd1819 --- /dev/null +++ b/daemon/hwd.conf @@ -0,0 +1 @@ +u hwd - "Daemon for Educational Hardware Simulator" \ No newline at end of file diff --git a/daemon/hwd.service.in b/daemon/hwd.service.in index ae60536..f49f58b 100644 --- a/daemon/hwd.service.in +++ b/daemon/hwd.service.in @@ -3,6 +3,8 @@ Description=Daemon for Educational Hardware Simulator After=network.target [Service] +User=hwd +Group=hwd ExecStart=${CMAKE_INSTALL_BINDIR}/hwd [Install] -- cgit v1.1