diff --git a/CHANGELOG.md b/CHANGELOG.md index b72607cb0..33e3c38f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,14 +4,22 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [Unreleased] +## [20.8.4] - Unreleased ### Added ### Changed +* Changed defaults for installation locations [#1662](https://github.com/greenbone/gvmd/pull/1662) + * SYSCONFDIR is /etc by default now + * LOCALSTATEDIR is /var by default now + * GVM_RUN_DIR is /run/gvm by default now + * OPENVAS_DEFAULT_SOCKET is /run/ospd/ospd-openvas.sock by default now + * SYSTEMD_SERVICE_DIR is /lib/systemd/system by default now + * Removed gvmd.default file and adjusted gvmd.service file accordingly + ### Deprecated ### Removed ### Fixed -[Unreleased]: https://github.com/greenbone/gvmd/compare/v20.8.3...HEAD +[20.8.4]: https://github.com/greenbone/gvmd/compare/v20.8.3...gvmd-20.08 ## [20.8.3] - 2021-08-03 diff --git a/CMakeLists.txt b/CMakeLists.txt index aae1e23a1..c5ff9b527 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,7 +125,7 @@ if (SYSCONF_INSTALL_DIR) endif (SYSCONF_INSTALL_DIR) if (NOT SYSCONFDIR) - set (SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc") + set (SYSCONFDIR "/etc") endif (NOT SYSCONFDIR) if (NOT EXEC_PREFIX) @@ -145,7 +145,7 @@ if (NOT LIBDIR) endif (NOT LIBDIR) if (NOT LOCALSTATEDIR) - set (LOCALSTATEDIR "${CMAKE_INSTALL_PREFIX}/var") + set (LOCALSTATEDIR "/var") endif (NOT LOCALSTATEDIR) if (NOT DATADIR) @@ -196,7 +196,7 @@ set (GVM_CLIENT_KEY "${GVM_STATE_DIR}/private/CA/clientkey.pem") set (GVM_CA_CERTIFICATE "${GVM_STATE_DIR}/CA/cacert.pem") if (NOT GVM_RUN_DIR) - set (GVM_RUN_DIR "${LOCALSTATEDIR}/run") + set (GVM_RUN_DIR "/run/gvm") endif (NOT GVM_RUN_DIR) if (NOT GVM_FEED_LOCK_PATH) @@ -205,7 +205,7 @@ endif (NOT GVM_FEED_LOCK_PATH) add_definitions (-DGVM_FEED_LOCK_PATH="${GVM_FEED_LOCK_PATH}") if (NOT OPENVAS_DEFAULT_SOCKET) - set (OPENVAS_DEFAULT_SOCKET "/var/run/ospd/ospd.sock") + set (OPENVAS_DEFAULT_SOCKET "/run/ospd/ospd-openvas.sock") endif (NOT OPENVAS_DEFAULT_SOCKET) add_definitions (-DOPENVAS_DEFAULT_SOCKET="${OPENVAS_DEFAULT_SOCKET}") diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt index b0524aba8..015bd98cb 100644 --- a/config/CMakeLists.txt +++ b/config/CMakeLists.txt @@ -17,26 +17,18 @@ if (NOT SYSTEMD_SERVICE_DIR) - set (SYSTEMD_SERVICE_DIR "${CMAKE_INSTALL_PREFIX}/lib/systemd/system") + set (SYSTEMD_SERVICE_DIR "/lib/systemd/system") endif (NOT SYSTEMD_SERVICE_DIR) -if (NOT DEFAULT_CONFIG_DIR) - set (DEFAULT_CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/etc/default") -endif (NOT DEFAULT_CONFIG_DIR) - if (NOT LOGROTATE_DIR) - set (LOGROTATE_DIR "${CMAKE_INSTALL_PREFIX}/etc/logrotate.d") + set (LOGROTATE_DIR "${SYSCONFDIR}/logrotate.d") endif (NOT LOGROTATE_DIR) configure_file (gvmd.service.in gvmd.service) configure_file (gvmd.logrotate.in gvmd.logrotate) -configure_file (gvmd.default.in gvmd.default) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/gvmd.service DESTINATION ${SYSTEMD_SERVICE_DIR}/) -install (FILES ${CMAKE_CURRENT_BINARY_DIR}/gvmd.default - DESTINATION ${DEFAULT_CONFIG_DIR}/ RENAME gvmd) - install (FILES ${CMAKE_CURRENT_BINARY_DIR}/gvmd.logrotate DESTINATION ${LOGROTATE_DIR}/ RENAME gvmd) diff --git a/config/gvmd.default.in b/config/gvmd.default.in deleted file mode 100644 index 28c96744b..000000000 --- a/config/gvmd.default.in +++ /dev/null @@ -1,19 +0,0 @@ -# -# The user for running the gvmd in the gvmd.service systemd file -# -GVMD_USER="gvm" - -# -# The group for running the gvmd in the gvmd.service systemd file -# -GVMD_GROUP="gvm" - -# -# Unix socket for OSP NVT update (--osp-vt-update) -# -OSP_VT_UPDATE="${OPENVAS_DEFAULT_SOCKET}" - -# -# Additional options -# -OPTIONS="" diff --git a/config/gvmd.service.in b/config/gvmd.service.in index 3f47b8639..e708952fa 100644 --- a/config/gvmd.service.in +++ b/config/gvmd.service.in @@ -7,11 +7,13 @@ ConditionKernelCommandLine=!recovery [Service] Type=forking -User=$GVMD_USER -Group=$GVMD_GROUP +User=gvm +Group=gvm PIDFile=${GVM_RUN_DIR}/gvmd.pid +RuntimeDirectory=gvm +RuntimeDirectoryMode=2775 EnvironmentFile=${DEFAULT_CONFIG_DIR}/gvmd -ExecStart=${SBINDIR}/gvmd --osp-vt-update=$OSP_VT_UPDATE $OPTIONS +ExecStart=${SBINDIR}/gvmd --osp-vt-update=/run/ospd/ospd-openvas.sock --listen-group=gvm Restart=always TimeoutStopSec=10