razzberry pi and log rotation

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
dirkx
Posts: 13
Joined: 03 Nov 2013 20:52

razzberry pi and log rotation

Post by dirkx »

Build in/easy log rotation by default may be quite essential on the razzbery-pi; as to avoid it to 'hang' once the (often very small ) SD disk is full.
jtylerhall
Posts: 11
Joined: 07 Feb 2013 17:59

as its linux, installing

Post by jtylerhall »

as its linux, installing logrotate is probably the best option.

I checked my raz and its already installed, it just needs to be configured to rotate the z-way-server log.
dirkx
Posts: 13
Joined: 03 Nov 2013 20:52

logrotate

Post by dirkx »

The issue here is that you need to re-HUP Z-Way server; to have it re-open the file handle of the log file; or have to use a unix pipe to the apache-log rotate; with the right sundry added to the server to survive / have good child daycare.

Both are not quite there in Z-Way server; and restarting z-way server on a rasberry pi or similar low end platform means an outage of several minutes; as it restarts; with quite a bit of state loss.

So my guess (experience) is that logrotate is not quite cutting it ? Or am I missing a signal/USR1 or other trick here ?
jtylerhall
Posts: 11
Joined: 07 Feb 2013 17:59

that seems like a bug to me.

Post by jtylerhall »

that seems like a bug to me. A log file should recreate itself when deleted, regardless of the state of , and if there is some technical reason why it can't, it shouldn't be *.log file, but rather some type of data file, and then yes , it should be self maintaining at its minimum size.
dirkx
Posts: 13
Joined: 03 Nov 2013 20:52

bug - close on file open

Post by dirkx »

jtylerhall: that is not quite so easy on unix (linux). When you delete a file; the process that has the file open does generally notice nothing; its file handle stays valid, writable (and will take up space on disk) until the last process closes the file. Only then does the removal of the entry from the directory propagate and actually releases the inodes used on disk.

Hence the general pattern where after/on log file rotation one sents a kill -1 (or HUP) to the process to have it re-open its log files. Most unix log rotates (e.g. http://www.freebsd.org/cgi/man.cgi?quer ... &sektion=8) have this as an easy to use feature.
User avatar
PoltoS
Posts: 7601
Joined: 26 Jan 2011 19:36

Z-Way supports SIGHUP to be

Post by PoltoS »

Z-Way supports SIGHUP to be compatibl with logrotate, so it should work.
Post Reply