Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

database.json的权限问题 #8

Closed
deepure opened this issue Sep 12, 2013 · 4 comments
Closed

database.json的权限问题 #8

deepure opened this issue Sep 12, 2013 · 4 comments

Comments

@deepure
Copy link
Contributor

deepure commented Sep 12, 2013

这个文件的读写权限有问题,要设置777或者用root执行才可以,否则报错
fs.js:427
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: EACCES, permission denied '/var/www/site/database.json'
at Object.fs.openSync (fs.js:427:18)
at Object.fs.writeFileSync (fs.js:966:15)
at Object.exports.set (/var/www/site/pkg.js:9:12)
at new Server (/var/www/site/app.js:22:9)
at Object. (/var/www/site/server.js:3:5)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10

@deepure
Copy link
Contributor Author

deepure commented Sep 12, 2013

style.css这个文件也比较奇怪,同目录下的duoshuo.css相同权限,载入没有问题,style.css的读取就会出问题,要设置777

error: Error: EACCES, open '/var/www/site/public/stylesheets/style.css' errno=3, code=EACCES, path=/var/www/site/public/stylesheets/style.css
[server-371 (err) 2013-09-12T15:15:30] Error: EACCES, open 'errors.log'

@guo-yu
Copy link
Owner

guo-yu commented Sep 12, 2013

我看看 fs.writeFile 的默认权限是啥

@deepure
Copy link
Contributor Author

deepure commented Sep 12, 2013

嗯,刚试了下,因为pm2默认是从app.js中读取程序的配置信息,导致env=production没读到,在upstart脚本里传了参数以后没问题了。

@guo-yu
Copy link
Owner

guo-yu commented Sep 30, 2013

话说我最近也在尝试用pm2代替forever,正在写一个pm2panel,欢迎关注~ 国庆期间应该可以完成~

@guo-yu guo-yu closed this as completed Sep 30, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants