Skip to content

Commit

Permalink
Merge pull request #3046 from greenbone/mergify/bp/gsa-20.08/pr-3045
Browse files Browse the repository at this point in the history
Use better defaults for installation locations (backport #3045)
  • Loading branch information
y0urself authored Jul 1, 2021
2 parents ced585d + f483a80 commit f48e62c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 47 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ 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.3] (unreleased)

### Added
### Changed
### Deprecated
Expand Down
13 changes: 7 additions & 6 deletions gsad/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ else (CLANG_FORMAT)
endif (CLANG_FORMAT)

if (NOT SYSCONFDIR)
set (SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc")
set (SYSCONFDIR "/etc")
endif (NOT SYSCONFDIR)

if (NOT EXEC_PREFIX)
Expand All @@ -81,7 +81,7 @@ if (NOT LIBDIR)
endif (NOT LIBDIR)

if (NOT LOCALSTATEDIR)
set (LOCALSTATEDIR "${CMAKE_INSTALL_PREFIX}/var")
set (LOCALSTATEDIR "/var")
endif (NOT LOCALSTATEDIR)

if (NOT INCLUDEDIR)
Expand All @@ -95,13 +95,14 @@ endif (NOT DATADIR)
set (GSAD_DATA_DIR "${DATADIR}/gvm/gsad")
set (GSAD_CONFIG_DIR "${SYSCONFDIR}/gvm/")

if (NOT GVM_RUN_DIR)
set (GVM_RUN_DIR "/run/gvm")
endif (NOT GVM_RUN_DIR)

if (NOT GSAD_PID_DIR)
set (GSAD_PID_DIR "${LOCALSTATEDIR}/run")
set (GSAD_PID_DIR "${GVM_RUN_DIR}")
endif (NOT GSAD_PID_DIR)

if (NOT GVM_RUN_DIR)
set (GVM_RUN_DIR "${LOCALSTATEDIR}/run")
endif (NOT GVM_RUN_DIR)

if (NOT GVM_STATE_DIR)
set (GVM_STATE_DIR "${LOCALSTATEDIR}/lib/gvm")
Expand Down
11 changes: 2 additions & 9 deletions gsad/config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@


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 (gsad.service.in gsad.service)
Expand All @@ -34,8 +30,5 @@ configure_file (gsad.logrotate.in gsad.logrotate)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/gsad.service
DESTINATION ${SYSTEMD_SERVICE_DIR}/)

install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/gsad.default
DESTINATION ${DEFAULT_CONFIG_DIR}/ RENAME gsad)

install (FILES ${CMAKE_CURRENT_BINARY_DIR}/gsad.logrotate
DESTINATION ${LOGROTATE_DIR}/ RENAME gsad)
24 changes: 0 additions & 24 deletions gsad/config/gsad.default

This file was deleted.

15 changes: 8 additions & 7 deletions gsad/config/gsad.service.in
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
[Unit]
Description=Greenbone Security Assistant daemon (gsad)
After=network.target networking.service gvmd.service
Documentation=man:gsad(8)
ConditionKernelCommandLine=!recovery
Documentation=man:gsad(8) https://www.greenbone.net
After=network.target gvmd.service
Wants=gvmd.service

[Service]
Type=forking
User=$GSAD_USER
Group=$GSAD_GROUP
PIDFile=${GVM_RUN_DIR}/gsad.pid
EnvironmentFile=${DEFAULT_CONFIG_DIR}/gsad
ExecStart=${SBINDIR}/gsad --listen $GSAD_ADDRESS --port $GSAD_PORT $GSAD_OPTIONS
User=gvm
Group=gvm
PIDFile=${GVM_PID_DIR}/gsad.pid
ExecStart=${SBINDIR}/gsad --listen 127.0.0.1 --port 9392 --http-only
Restart=always
TimeoutStopSec=10

[Install]
WantedBy=multi-user.target
Alias=greenbone-security-assistant.service

0 comments on commit f48e62c

Please sign in to comment.