[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 0/5] Add systemd socket launching support.
From: |
Matthew Leach |
Subject: |
[PATCH 0/5] Add systemd socket launching support. |
Date: |
Sat, 26 Mar 2016 21:16:37 +0000 |
Systemd has the ability to create a socket, launch a daemon upon
connection to that socket and hand over the socket to the new process
to handle. In Emacs' case, we can delay the start of the Emacs daemon
until emacsclient is called upon a socket.
These patches can be tested by creating minimal systemd setup. First,
create two systemd unit files:
emacs.socket
============
[Socket]
ListenStream=/home/foobar/test.socket
[Install]
WantedBy=sockets.target
emacs.service
=============
[Service]
Type=forking
ExecStart=/path/to/emacs --daemon
Once these files have been created, execute:
# systemctl daemon-reload
# systemctl start enacs.socket
The socket will now be created, and when a connection is made, the
Emacs daemon will be started:
# emacsclient -s /home/foobar/test.socket -t
Feedback & comments welcome!
Thanks,
Matt
Matthew Leach (5):
Check for libsystemd when building Emacs.
Read the number of sockets passed by systemd.
Permit systemd-allocated socket file-descriptors to be used.
Allow the systed socket fd to be retrieved.
When set, use the systemd socket descriptor.
configure.ac | 13 +++++++++++++
lisp/server.el | 5 ++++-
src/Makefile.in | 6 +++++-
src/emacs.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
src/process.c | 28 +++++++++++++++++++++-------
5 files changed, 90 insertions(+), 9 deletions(-)
--
2.7.4
- [PATCH 0/5] Add systemd socket launching support.,
Matthew Leach <=