Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Support systemd socket activation #329

Closed
ghost opened this Issue · 22 comments
@ghost

Main Project Pages
http://www.freedesktop.org/wiki/Software/systemd/
http://0pointer.de/blog/projects/systemd-docs.html

How-to on patching a service to use socket activation.
http://0pointer.de/blog/projects/socket-activation.html

Man Pages for sd-daemon and sd_listen_fds();
http://0pointer.de/public/systemd-man/sd-daemon.html
http://0pointer.de/public/systemd-man/sd_listen_fds.html

Using the above information, I was able to patch the 2.4 branch
and it seems to work as advertised :)
https://gist.github.com/1741478

I linked systemd-daemon, but as the docs above state, the two files
(sd-daemon.c and sd-daemon.h) could be added to /deps.

You would know the git front-end at freedesktop.org seems to be down atm :/
If you'd like to quickly view these two files, I've pulled the most recent
copies from their repo here: https://gist.github.com/1741350

@pietern

What does this patch do, and why should it be included in Redis?

@ghost

It allows you to launch the redis-server as a service, using the systemd init daemon.
Instead of redis creating the socket, it gets the file descriptor for the socket from systemd when it starts the service.
The socket is created and managed separately by systemd. So if redis-server crashes or you stop/restart the service, the socket queues the messages. You can configure systemd to automatically restart the service if it crashes, and it will receive the same socket and pick up where it left off. You could even use this to upgrade redis with no interruption in service. The service can also be controlled/monitored using cgroups.

@alesguzik

Any updates so far? I need this feature. Will it be merged upstream? Also seems like there is no redis.service file present at time( you may check this one https://bbs.archlinux.org/viewtopic.php?id=135922 )

@Keruspe

Providing a systemd service, and better, also supporting socket activation would be appreciated a lot !

@ovmjm

Would be much appreciated, particularly for dev environments.

@antirez
Owner

Hello, for now there is no plan to add this feature. Thanks for your contrib anyway. Closing.

@antirez antirez closed this
@sickill

:(

@bjne

antirez: Why is there no plan to add this? Sounds silly!

@flyingmutant

@antirez, can you please explain the reasoning behind closing this issue? Would you accept a socket activation patch that does not add build dependency on systemd?

systemd provides many desirable features for system administration, and it would be greatly appreciated if redis will be able to benefit from socket activation in particular.

@polvi

Major distributions, such as Redhat, Fedora, SUSE, Arch, and CoreOS, all support systemd. Socket activation is a critical component large distributed systems. Please consider adding it native to redis.

@davidstrauss

We're watching this, too. We use systemd and Redis on Pantheon.

@mitsuhiko

Why did this get closed? This is a very useful feature, not just because of systemd but also for things like circus.

@davidstrauss

Debian and Ubuntu are also now moving to systemd.

@phndiaye

Any news about the support of this feature?

@james-lawrence

Also interested in this feature. And interested in why it was closed without explaination.

@tahajahangir

RHEL/CentOS 7 came with systemd, and Debian 8 uses systemd, Why not support socket activation?

@jbergstroem

How about moving the discussion to having your linux distribution running systemd of choice carry this patch instead? Guessing ubuntu, redhat or debian package maintainers would consider it.

@flyingmutant

Or one can say that a tiny patch with no external dependencies which benefits users of 90% of linux systems out there warrants place in the upstream.

@jbergstroem

@flyingmutant Upstream has already chimed in. My suggestion at least tries to help out moving forward. I don't think "please" or "why" does.

@mattsta

a tiny patch with no external dependencies

The last I saw, it required including systemd headers and building against systemd libraries directly to use systemd functions for systemd specific network behavior. Is there an alternative?

@flyingmutant

a tiny patch with no external dependencies

The last I saw, it required including systemd headers and building against systemd libraries directly to use systemd functions for systemd specific network behavior. Is there an alternative?

I am working on it right now and hope to submit a proper PR soon.

@flyingmutant

Please review — #2004.

@flyingmutant

For those who are interested in this feature, discussion is now continued in #2004.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.