Skip to content

Commit

Permalink
Merge pull request #1662 from greenbone/bricks/adjust-default-paths
Browse files Browse the repository at this point in the history
Use better defaults for installation directories
  • Loading branch information
bjoernricks authored Aug 4, 2021
2 parents b48ca24 + 3541c2b commit 0df97cc
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 38 deletions.
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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}")

Expand Down
12 changes: 2 additions & 10 deletions config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
19 changes: 0 additions & 19 deletions config/gvmd.default.in

This file was deleted.

8 changes: 5 additions & 3 deletions config/gvmd.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0df97cc

Please sign in to comment.