ideawu / ssdb

SSDB - A fast NoSQL database, an alternative to Redis
http://ssdb.io/
BSD 3-Clause "New" or "Revised" License
8.19k stars 1.4k forks source link

ssdb does not create pidfile when not running as daemon #1368

Closed ghen2 closed 4 years ago

ghen2 commented 4 years ago

ssdb does not write a pid file when not running as daemon (eg. under systemd). Although it logs the pidfile creation: 2020-09-01 16:01:00.091 [INFO ] ssdb-server.cpp(85): pidfile: /data/ssdb/ssdb.pid, pid: 29369

See src/util/app.cpp line 150:

void Application::write_pid(){
        if(!app_args.is_daemon){
                return;
        }
        ...
}

Why is this is_daemon check there? Can't it create a pidfile unconditionally, when configured to do so?