1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CentOS7で/tmp に書き込めるようにする

Posted at

CentOS7では、アプリケーションから /tmp ディレクトリにファイルを書き込めないので、使えるように設定する方法。

設定

  • CentOS7では、PrivateTmpというオプションがあり、PrivateTmpがtrueの場合、/tmpではなく、/tmp/systemd-private-[UUID]/tmp/ に格納される
  • PrivateTmpはデフォルトでtrueになっているため、設定を変更しないと/tmpの直下には書き込めない
  • PrivateTmpオプションは、serivceごとに修正する必要がある
  • 以下、httpdのPrivateTmpをfalseにする場合の設定例
# cp /usr/lib/systemd/system/httpd.service /etc/systemd/system/
# chmod 777 /etc/systemd/system/httpd.service
# vi /etc/systemd/system/httpd.service
PrivateTmp=true → PrivateTmp=false
# systemctl daemon-reload
1
2
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?