问题原文
原帖链接 · roelvanmeer · CC BY-SA 3.0
When configuring an application, you can often use /dev/null as config file if you want the application to read an empty file. But, if the application reads a list of files from a directory, you cannot use this trick. You would need to give it an empty directory to read.
I was wondering: does Linux have a default empty directory that can be used for such purposes? I know OpenSSH used /var/empty for a while, and I can of course create an empty dir myself, but maybe the FHS has specified a standard directory for this?
社区高分解答
原帖链接 · HBruijn · CC BY-SA 3.0
For services systemd provides the option PrivateTmp to create private /tmp and /var/tmp directories that are not shared by processes outside of the namespace for that service and which should be empty (initially).
[Service]
ExecStart=...
PrivateTmp=yes
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
