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

wrapper.js crashes when /var/log runs out of space #17

Open
RazZziel opened this issue Apr 1, 2015 · 1 comment
Open

wrapper.js crashes when /var/log runs out of space #17

RazZziel opened this issue Apr 1, 2015 · 1 comment

Comments

@RazZziel
Copy link
Contributor

RazZziel commented Apr 1, 2015

My program crashed when launched from a /etc/init.d/ script created by node-linux

This is the error, from /var/log/parkberry-error.log:

Wed Apr 01 2015 15:44:17 GMT+0200 (CEST) - SVCMGR - Uncaught exception: Error: ENOSPC, no space left on device
    at Object.fs.writeSync (fs.js:540:18)
    at Object.fs.writeFileSync (fs.js:987:21)
    at Object.fs.appendFileSync (fs.js:1024:6)
    at Socket.<anonymous> (/home/pi/node_modules/package/node_modules/node-linux/lib/wrapper.js:155:8)
    at Socket.emit (events.js:95:17)
    at Socket.<anonymous> (_stream_readable.js:765:14)
    at Socket.emit (events.js:92:17)
    at emitReadable_ (_stream_readable.js:427:10)
    at emitReadable (_stream_readable.js:423:5)
    at readableAddChunk (_stream_readable.js:166:9)

Indeed, /var/log is full, and my program is to blame, but if node-linux is in charge of creating the log, it should be in charge or splitting/rotating it

pi@0000000023593fb2 /var/log $ df -h
Filesystem      Size  Used Avail Use% Mounted on
(...)
tmpfs           100M  100M     0 100% /var/log
(...)

pi@0000000023593fb2 /var/log $ du -sh parkberry.log 
100M    parkberry.log
@RazZziel
Copy link
Contributor Author

RazZziel commented Apr 2, 2015

For now I've workarounded the problem with logrotate, creating a /etc/logrotate.d/parkberry that reads:

/var/log/parkberry.log {
  rotate 4
  size 10M
  compress
  missingok
  notifempty
}

(still untested, but should be fine)

This way I make sure I never have more than 40M in logs (at least for this app), so wrapper.js shouldn't crash (unless /var/log gets full by some other app)

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

1 participant