Hi,
In the logrotate aerospike conf file we find the following:
postrotate
kill -HUP `cat /var/run/aerospike/asd.pid`
The thing is if pidfile
is not mentioned in the service stanza of “aerospike.conf”, /var/run/aerospike/asd.pid
does not get created, which results in no HUP
signal being sent to asd when the rotations done, which results in the file descriptors remaining the same, which means asd keeps writing to the old log file.
As per documents, if the pid file is not specified defaults to the same var/run/aerospike/asd.pid
.
Does it look like a bug?
The following code in as.c
in write_pidfile(char* pidfile)
if (! pidfile) {
// If there's no pid file specified in the config file, just move on.
return;
}
Should this peice of code be changed to create default or should logrotate conf be changed to work with something like pgrep
or pidof
instead of cat
Also asd does not clean up the pid file after it.