X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=man%2Fdaemon.xml;h=fb22e6c6165d88f4d950542fba0e7a37baf0d25a;hb=3dda9fc3a738241e42df43dbebf9e479e5ad1da8;hp=8e9e9395321c657a6f6c85ca802f1d4473843b9d;hpb=72f957066d9ccc43699c813d0498fc7f6732a838;p=elogind.git
diff --git a/man/daemon.xml b/man/daemon.xml
index 8e9e93953..fb22e6c61 100644
--- a/man/daemon.xml
+++ b/man/daemon.xml
@@ -384,7 +384,7 @@
communication channels are established already, and no
request is lost because client requests will be queued
by the bus system (in case of D-Bus) or the kernel (in
- case of sockets), until the activation
+ case of sockets), until the activation is
completed.
@@ -678,7 +678,8 @@
If your daemon
registers a D-Bus name on the bus,
make sure to use
- Type=dbus if
+ Type=dbus in the
+ service file if
possible.Make sure to set a
@@ -703,16 +704,45 @@
operating
system-independent.
+ Since not all syslog
+ implementations are socket-activatable
+ yet, it is recommended to place an
+ After=syslog.target
+ dependency in service files for
+ daemons that can log to
+ syslog. syslog.target
+ then either pulls in the syslog daemon
+ itself or simply the activation
+ socket. A Wants= or
+ even Requires=
+ dependency should generally not be
+ added, since it should be up to the
+ administrator whether he wants to
+ enable logging or not, and most syslog
+ clients work fine if no log daemon is
+ running.
+
Make sure to include
- an [Install] section including
- installation information for the unit
- file. See
+ an [Install]
+ section including installation
+ information for the unit file. See
systemd.unit5
for details. To activate your service
on boot make sure to add a
WantedBy=multi-user.target
or
- WantedBy=graphical.target directive.
+ WantedBy=graphical.target
+ directive. To activate your socket on
+ boot, make sure to add
+ WantedBy=sockets.target. Usually
+ you also want to make sure that when
+ your service is installed your socket
+ is installed too, hence add
+ Also=foo.socket in
+ your service file
+ foo.service, for
+ a hypothetical program
+ foo.
@@ -726,7 +756,7 @@
install their systemd unit files in the
directory returned by pkg-config
systemd
- --variable=systemdsystemnunitdir
+ --variable=systemdsystemunitdir
(for system services),
resp. pkg-config systemd
--variable=systemdsessionunitdir
@@ -793,13 +823,22 @@ endif
package managers:
%post
-/usr/bin/systemd-install --start enable foobar.service foobar.socket >/dev/null 2>&1 || :
+/usr/bin/systemd-install --realize enable foobar.service foobar.socket >/dev/null 2>&1 || :
%preun
if [ "$1" -eq 0 ]; then
- /usr/bin/systemd-install --start disable foobar.service foobar.socket >/dev/null 2>&1 || :
+ /usr/bin/systemd-install --realize disable foobar.service foobar.socket >/dev/null 2>&1 || :
fi
+ Depending on whether your service should
+ or should not be started/stopped/restarted
+ during package installation, deinstallation or
+ upgrade, a different argument to
+ may be
+ specified. See
+ systemd-install1
+ for details.
+
@@ -809,8 +848,8 @@ fi
Since new-style init systems such as systemd are
compatible with traditional SysV init systems it is
not strictly necessary to port existing daemons to the
- new style. However doing this offers additional
- functionality to the daemons as well as it simplifies
+ new style. However doing so offers additional
+ functionality to the daemons as well as simplifying
integration into new-style init systems.To port an existing SysV compatible daemon the
@@ -849,7 +888,7 @@ fi
left-over file descriptors are passed to
executed processes, it might be a good choice
to simply skip the closing of all remaining
- open file descriptors if file descriptors are
+ open file descriptors if sockets are
passed.Write and install a systemd