Commit ad15924a authored by Link Mauve's avatar Link Mauve

Allow cmake to configure the systemd unit’s user and group

parent 272c0e49
...@@ -267,6 +267,12 @@ else() ...@@ -267,6 +267,12 @@ else()
set(SYSTEMD_SERVICE_TYPE "simple") set(SYSTEMD_SERVICE_TYPE "simple")
set(WATCHDOG_SEC "") set(WATCHDOG_SEC "")
endif() endif()
if(NOT DEFINED SERVICE_USER)
set(SERVICE_USER "nobody")
endif()
if(NOT DEFINED SERVICE_GROUP)
set(SERVICE_GROUP "nobody")
endif()
configure_file(unit/biboumi.service.cmake biboumi.service) configure_file(unit/biboumi.service.cmake biboumi.service)
# The date MUST be in english format # The date MUST be in english format
......
...@@ -9,8 +9,8 @@ ExecStart=${CMAKE_INSTALL_PREFIX}/bin/biboumi /etc/biboumi/biboumi.cfg ...@@ -9,8 +9,8 @@ ExecStart=${CMAKE_INSTALL_PREFIX}/bin/biboumi /etc/biboumi/biboumi.cfg
ExecReload=/bin/kill -s USR1 $MAINPID ExecReload=/bin/kill -s USR1 $MAINPID
WatchdogSec=${WATCHDOG_SEC} WatchdogSec=${WATCHDOG_SEC}
Restart=always Restart=always
User=nobody User=${SERVICE_USER}
Group=nobody Group=${SERVICE_GROUP}
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment