Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use better defaults for installation locations #3045

Merged
merged 6 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [21.4.2] (unreleased)
### Added
### Changed
- Changed defaults for installation locations [#3045](https://github.com/greenbone/gsa/pull/3045)
- LOCALSTATEDIR is /var by default now
- SYSCONFDIR is /etc by default now
- GVM_RUN_DIR and GSAD_PID_DIR are /run/gvm by default now
- SYSTEMD_SERVICE_DIR is /lib/systemd/system by default now

### Deprecated
### Removed
- Removed gsad.default file and adjusted gsad.service file accordingly.
Packagers should patch gsad.service file to adjust it on their requirements or
just ship their own [#3045](https://github.com/greenbone/gsa/pull/3045)

### Fixed
- Initialize severity value with 0 in powerfilter SeverityValuesGroup [#3031](https://github.com/greenbone/gsa/pull/3031)

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