From eb14026f6e0f0a4530aa7e454cc3be52dd43092b Mon Sep 17 00:00:00 2001 From: Jo Vandeginste Date: Mon, 5 Aug 2019 14:26:26 +0200 Subject: [PATCH] Add `Environment` & `EnvironmentFile` directives Since we can now override settings through environment variables, it's handy to contain those changes in a separate file. This way, sysadmins can generate such a file without having to touch the systemd file. Meanwhile the current flags are converted to `Environment` entries, which can be overridden in the `EnvironmentFile` if so desired. If the file is not present, the directive [is ignored](https://www.freedesktop.org/software/systemd/man/systemd.exec.html#EnvironmentFile=) --- init/sftpgo.service | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/init/sftpgo.service b/init/sftpgo.service index 558ccdf2..c51cd0da 100644 --- a/init/sftpgo.service +++ b/init/sftpgo.service @@ -7,7 +7,10 @@ User=root Group=root Type=simple WorkingDirectory=/etc/sftpgo -ExecStart=/usr/bin/sftpgo --config-dir /etc/sftpgo --log-file-path /var/log/sftpgo.log +Environment=SFTPGO_CONFIG_DIR=/etc/sftpgo/ +Environment=SFTPGO_LOG_FILE_PATH=/var/log/sftpgo.log +EnvironmentFile=-/etc/sftpgo/sftpgo.env +ExecStart=/usr/bin/sftpgo KillMode=mixed Restart=always RestartSec=10s