zapty / forever-service

Provision node script as a service via forever, allowing it to automatically start on boot, working across various Linux distros and OS
https://github.com/zapty/forever-service
MIT License
594 stars 65 forks source link

logrotateFrequency not working #53

Closed ssstuckey closed 8 years ago

ssstuckey commented 8 years ago

It appears that the option is mis-spelled in the template for upstart and sysvinit as "logroateFrequency". I attempted to modify my local copy but was still unable to get the logs to rotate at "size 10k". Can you confirm/deny this is an issue?

This is my test run which is not rotating

forever-service install test3 --script testSql.js --logrotateFrequency "size 10k"

Environment

uname -a
Linux nodejs 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u3 (2015-08-04) x86_64 GNU/Linux

logrotate
logrotate 3.8.7 - Copyright (C) 1995-2001 Red Hat, Inc.

While trying to dig into logrotate, I found the config file (which I assume this would write to...?) and did not find any trace of test3.

arvind-agarwal commented 8 years ago

@ssstuckey logrotate script is provisioned in /etc/logrotate.d/ directory, please check there.

As far as size based rotation is concerned look at http://serverfault.com/questions/480551/logrotate-not-rotating-file-after-file-size-exceeds-the-limit

Basically size rotation is not immediately, it is based on, when logrotate job is scheduled to be run. Check if this is what is causing the size based rotation to not work.

ssstuckey commented 8 years ago

@arvind-agarwal Thanks! I was sure it wasn't going to work, but I copied logrotate from /etc/cron.daily to /etc/cron.hourly and sure enough it picked up the size settings fine.