summaryrefslogtreecommitdiff
path: root/support-files
diff options
context:
space:
mode:
authorChristian Hesse <mail@eworm.de>2017-05-19 15:45:07 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2017-12-20 12:54:19 +0200
commit7bbc6c14d1e8fcf1f4737e0a5fcf6237fe18bd23 (patch)
tree20816089f914d146a881bfa444f7b69b08fed098 /support-files
parentc58df0cdd40258254b40f501857106c843347e39 (diff)
downloadmariadb-git-7bbc6c14d1e8fcf1f4737e0a5fcf6237fe18bd23.tar.gz
Generate and install sysusers and tmpfiles configuration
Using systemd we can automate creating users and directories. So generate and install the configuration files. Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org> Small change in cmake/install_layout.cmake compared to original contributor patch to also install SYSTEMD_SYSUSERS and SYSTEMD_TMPFILES directories. The variables were being set, but the loop which defines the final install files was not updated.
Diffstat (limited to 'support-files')
-rw-r--r--support-files/CMakeLists.txt15
-rw-r--r--support-files/sysusers.conf.in1
-rw-r--r--support-files/tmpfiles.conf.in1
3 files changed, 17 insertions, 0 deletions
diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt
index 71e9b3fad3d..3b6e86030ab 100644
--- a/support-files/CMakeLists.txt
+++ b/support-files/CMakeLists.txt
@@ -104,6 +104,21 @@ IF(UNIX)
${CMAKE_CURRENT_BINARY_DIR}/mariadb.service
DESTINATION ${inst_location}/systemd COMPONENT SupportFiles)
+ IF(INSTALL_SYSTEMD_SYSUSERSDIR)
+ CONFIGURE_FILE(sysusers.conf.in
+ ${CMAKE_CURRENT_BINARY_DIR}/sysusers.conf @ONLY)
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/sysusers.conf
+ DESTINATION ${INSTALL_SYSTEMD_SYSUSERSDIR} COMPONENT Server)
+ ENDIF()
+
+ IF(INSTALL_SYSTEMD_TMPFILESDIR)
+ get_filename_component(MYSQL_UNIX_DIR ${MYSQL_UNIX_ADDR} DIRECTORY)
+ CONFIGURE_FILE(tmpfiles.conf.in
+ ${CMAKE_CURRENT_BINARY_DIR}/tmpfiles.conf @ONLY)
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/tmpfiles.conf
+ DESTINATION ${INSTALL_SYSTEMD_TMPFILESDIR} COMPONENT Server)
+ ENDIF()
+
# @ in directory name broken between CMake version 2.8.12.2 and 3.3
# http://public.kitware.com/Bug/view.php?id=14782
IF(NOT CMAKE_VERSION VERSION_LESS 3.3.0 OR NOT RPM)
diff --git a/support-files/sysusers.conf.in b/support-files/sysusers.conf.in
new file mode 100644
index 00000000000..a975b29476a
--- /dev/null
+++ b/support-files/sysusers.conf.in
@@ -0,0 +1 @@
+u @MYSQLD_USER@ - "MariaDB" @MYSQL_DATADIR@
diff --git a/support-files/tmpfiles.conf.in b/support-files/tmpfiles.conf.in
new file mode 100644
index 00000000000..03d66abc0c7
--- /dev/null
+++ b/support-files/tmpfiles.conf.in
@@ -0,0 +1 @@
+d @MYSQL_UNIX_DIR@ 0755 @MYSQLD_USER@ @MYSQLD_USER@ -