安装daloraidus时发现无法访问daloraidus.log,经过研究发现主要原因是systemd服务会将/tmp目录重定向到/tmp下的另外一个目录.
/tmp/systemd-private-97ccc36271c24ddeb9f5d2b2a0904a49-apache2.service-4VOdnf
systemd服务的这个特性,是由PrivateTmp属性来设定的,可以通过修改相关服务的配置文件来选择是否需要重定向。
比如在我的系统中配置文件在以下路径:
/etc/systemd/system/multi-user.target.wants/apache2.service
apache2.service内容如下:
[Unit]
Description=The Apache HTTP Server
After=network.target remote-fs.target nss-lookup.target
Documentation=https://httpd.apache.org/docs/2.4/
[Service]
Type=forking
Environment=APACHE_STARTED_BY_SYSTEMD=true
ExecStart=/usr/sbin/apachectl start
ExecStop=/usr/sbin/apachectl stop
ExecReload=/usr/sbin/apachectl graceful
PrivateTmp=false
Restart=on-abort
[Install]
WantedBy=multi-user.target