Systemd应该在什么时候不设置RUNTIME_DIRECTORY env?

问题描述 投票:0回答:1

我有一个非常简单的测试服务。最终,我将运行node守护程序,但现在使用env调试此问题...

$ systemctl cat http-endpoints
# /etc/systemd/system/http-endpoints.service
[Unit]
Description=HTTP endpoints for triggering events
After=network.target

[Service]
Type=simple
;PassEnvironment=RUNTIME_DIRECTORY
RuntimeDirectory=endpoints
Environment=TEST=asdf
ExecStart=/usr/bin/env

[Install]
WantedBy=default.target

我正在尝试使用systemd的RuntimeDirectory=功能。我期望环境变量RUNTIME_DIRECTORY

没有设置。

systemd[1]: Started HTTP endpoints for triggering events.
env[26794]: LANG=en_US.UTF-8
env[26794]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
env[26794]: INVOCATION_ID=fb24db240f454722b847ab7cefd5eb59
env[26794]: JOURNAL_STREAM=9:8063338
env[26794]: TEST=asdf

我尝试了一些事情。

如果手动设置Environment=RUNTIME_DIRECTORY=/run/endpoints,它将起作用。但是该配置不是必需的。

/run/endpoints目录已按预期创建(并由于env退出而立即删除,但这不是问题。)>

$ systemd --version
systemd 237
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid

我有一个非常简单的测试服务。最终,我将运行一个节点守护程序,但现在使用env调试此问题... $ systemctl cat http-endpoints#/ etc / systemd / system / http-endpoints ....

environment-variables systemd
1个回答
0
投票

Ubuntu 18.04.3没有最新的systemd。

© www.soinside.com 2019 - 2024. All rights reserved.