Log Rotation Happens But File Descriptor not changed


In the logrotate aerospike conf file we find the following:

    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.

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.

In the doc, it says default path is /var/run/aerospike/asd.pid based on config file. We mean that the default config file that you get with the installation has it. Its not default value in its purest sense. I understand your confusion because of it.

You need to specify the config parameter in your custom config file. Otherwise, log rotate will not work.