【发布时间】:2013-11-25 20:11:12
【问题描述】:
我有一个在 Vagrant 虚拟环境中运行的 Ubuntu Linux 服务器。我使用服务器来开发 Web 服务。当服务器启动时,我有一个 shell 脚本需要运行一次,以便在 /tmp/ 文件系统上设置缓存目录结构。
description "setup web cache"
start on startup
script
mkdir -p /tmp/cache/persistent
mkdir -p /tmp/cache/models
mkdir -p /tmp/cache/views
chmod -R 777 /tmp/cache/
end script
当我启动服务器时,我收到一条错误消息,显示在 /var/log/upstart/webcache.log:
mkdir: cannot create directory `/tmp/cache': Read-only file system
显然startup 对start on 来说太早了。问题是,/tmp 什么时候可以写,我应该将什么传递给start on?
【问题讨论】: