blog部署在/tmp目录下,导致网页一直报404错误
原因是nginx的配置中PrivateTmp值默认为TRUE。当这个值设置了true,进程启动时/tmp会挂载一个全新的mount namespace,可以理解成每个进程看到的都是全新的空的/tmp。
PrivateTmp= Takes a boolean argument. If true, sets up a new file system namespace for the executed processes and mounts private /tmp and /var/tmp directories inside it that is not shared by processes outside of the namespace. This is useful to secure access to temporary files of the process, but makes sharing between processes via /tmp or /var/tmp impossible. If this is enabled, all temporary files created by a service in these directories will be removed after the service is stopped. Defaults to false. It is possible to run two or more units within the same private /tmp and /var/tmp namespace by using the JoinsNamespaceOf= directive, see system