From 96eb92f2e301b4b249eae710d51715931a683656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans=20H=C3=BCbner?= Date: Mon, 26 Jun 2023 14:25:10 +0200 Subject: [PATCH] fix(service): explicitly set user in systemd definition (#11066) Previously, no User clause was present. While this still made systemd run kong under the 'root' user id, the HOME environment variable would not be set in the Kong process. This caused the datafile library to fail with various error conditions. --- CHANGELOG.md | 3 +++ build/package/kong.service | 1 + 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 938173d60e34..dd8b903ef5ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,9 @@ [#10896](https://github.com/Kong/kong/pull/10896) - Fix a bug when worker consuming dynamic log level setting event and using a wrong reference for notice logging [#10897](https://github.com/Kong/kong/pull/10897) +- Added a `User=` specification to the systemd unit definition so that + Kong can be controlled by systemd again. + [#11066](https://github.com/Kong/kong/pull/11066) #### Admin API diff --git a/build/package/kong.service b/build/package/kong.service index eeaa6502af97..4ea3e5d17e99 100644 --- a/build/package/kong.service +++ b/build/package/kong.service @@ -4,6 +4,7 @@ Documentation=https://docs.konghq.com/ After=syslog.target network.target remote-fs.target nss-lookup.target [Service] +User=root ExecStartPre=/usr/local/bin/kong prepare -p /usr/local/kong ExecStart=/usr/local/openresty/nginx/sbin/nginx -p /usr/local/kong -c nginx.conf ExecReload=/usr/local/bin/kong prepare -p /usr/local/kong