Support systemd socket activation #329

Closed
ghost opened this Issue Feb 5, 2012 · 22 comments

Comments

Projects
None yet
@ghost

ghost commented Feb 5, 2012

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

Contributor

pietern commented Feb 6, 2012

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

@ghost

ghost commented Feb 6, 2012

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.

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 )

Contributor

Keruspe commented Dec 10, 2012

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

ovmjm commented May 5, 2013

Would be much appreciated, particularly for dev environments.

Owner

antirez commented May 8, 2013

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

@antirez antirez closed this May 8, 2013

sickill commented Jul 10, 2013

:(

bjne commented Sep 3, 2013

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

Contributor

flyingmutant commented Sep 21, 2013

@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 commented Sep 29, 2013

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.

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

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

Debian and Ubuntu are also now moving to systemd.

Any news about the support of this feature?

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

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

Contributor

jbergstroem commented Sep 13, 2014

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.

Contributor

flyingmutant commented Sep 13, 2014

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.

Contributor

jbergstroem commented Sep 13, 2014

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

Contributor

mattsta commented Sep 13, 2014

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?

Contributor

flyingmutant commented Sep 13, 2014

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.

Contributor

flyingmutant commented Sep 16, 2014

Please review — #2004.

Contributor

flyingmutant commented Oct 22, 2014

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