I use the following command to compile redis source code
make BUILD_TLS=yes PREFIX=/usr/local/redis/ USE_SYSTEMD=yes
It runs as expected, finally prints the following Hint
Hint: It's a good idea to run 'make test' ;)
Then I execute make install, finally it prints
Hint: It's a good idea to run 'make test' ;)
INSTALL redis-server INSTALL redis-benchmark INSTALL redis-cli
well, I thought USE_SYSTEMD=yes will finally generate a redis.service file and auto install it to /etc/systemd/system/, but it didn't, I didn't find any systemd service file was generated, so it seems USE_SYSTEMD=yes option doesn't any difference here. I still need to create a redis.service file myself, but if I create it myself, I didn't need USE_SYSTEMD=yes option at all.
So, is there anyone who knows what does USE_SYSTEMD=yes use for?
Comment From: yossigo
This flag only controls compilation: it enables systemd support logic and linking against libsystemd.
Comment From: xiebruce
This flag only controls compilation: it enables systemd support logic and linking against
libsystemd.
I don't familiar with systemd, I just know it needs a xxx.service(in this case redis.service) file put into /etc/systemd/system/ then I can use systemctl start|stop|restart redis to control it start/stop/restart. seems no needs what you called "support logic". Actually, not only redis, any executable can start a daemon by systemctl, what we all need is a correct xxx.service file.
BTW, since USE_SYSTEMD=yes option is provided, why not just prepare a redis.service(or auto generate it) ?