X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=man%2Fdaemon.xml;h=99c75a7a18eb9b5d48452b012ef33100c9aae411;hb=1b600437bac3c0676cc72f589909c4cbfe38ba10;hp=ab58d08a76424b9bd9ea3b64016e215538479f12;hpb=27d14fb331ba8144f99f4da2d13f15cf5c8b8a9f;p=elogind.git
diff --git a/man/daemon.xml b/man/daemon.xml
index ab58d08a7..99c75a7a1 100644
--- a/man/daemon.xml
+++ b/man/daemon.xml
@@ -74,8 +74,8 @@
Close all open file
- descriptors except stdin, stdout,
- stderr (i.e. the first three file
+ descriptors except standard input, output,
+ and error (i.e. the first three file
descriptors 0, 1, 2). This ensures
that no accidentally passed file
descriptor stays around in the daemon
@@ -85,13 +85,14 @@
with a fallback of iterating from file
descriptor 3 to the value returned by
getrlimit() for
- RLIMIT_NOFILE.
+ RLIMIT_NOFILE.
+
Reset all signal
handlers to their default. This is
best done by iterating through the
available signals up to the limit of
- _NSIG and resetting them to
+ _NSIG and resetting them to
SIG_DFL.
Reset the signal mask
@@ -158,9 +159,7 @@
it is verified at the same time that
the PID previously stored in the PID
file no longer exists or belongs to a
- foreign process. Commonly, some kind of
- file locking is employed to implement
- this logic.
+ foreign process.
In the daemon process,
drop privileges, if possible and
@@ -323,29 +322,21 @@
interface.
Instead of using the
- syslog() call to log directly to the
- system syslog service, a new-style daemon may
- choose to simply log to standard error via
- fprintf(), which is then forwarded to
- syslog by the init system. If log
- priorities are necessary, these can be
- encoded by prefixing individual log
- lines with strings like "<4>"
- (for log priority 4 "WARNING" in the
- syslog priority scheme), following a
- similar style as the Linux kernel's
- printk() priority system. In fact,
- using this style of logging also
- enables the init system to optionally
- direct all application logging to the
- kernel log buffer (kmsg), as
- accessible via
- dmesg1. This
- kind of logging may be enabled by
- setting
- StandardError=syslog
- in the service unit file. For details,
- see
+ syslog() call to
+ log directly to the system syslog
+ service, a new-style daemon may choose
+ to simply log to standard error via
+ fprintf(), which
+ is then forwarded to syslog by the
+ init system. If log priorities are
+ necessary, these can be encoded by
+ prefixing individual log lines with
+ strings like <4> (for log
+ priority 4 "WARNING" in the syslog
+ priority scheme), following a similar
+ style as the Linux kernel's
+ printk() priority
+ system. For details, see
sd-daemon3
and
systemd.exec5.
@@ -354,7 +345,7 @@
These recommendations are similar but
not identical to the Apple
+ url="https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html">Apple
MacOS X Daemon Requirements.
@@ -620,7 +611,7 @@
on a network interface, because network
sockets shall be bound to the
address. However, an alternative to implement
- this is by utilizing the Linux IP_FREEBIND
+ this is by utilizing the Linux IP_FREEBIND
socket option, as accessible via
FreeBind=yes in systemd
socket files (see
@@ -758,7 +749,7 @@
boot.
Packages using
- autoconf1
+ autoconf1
are recommended to use a configure script
excerpt like the following to determine the
unit installation path during source
@@ -793,7 +784,7 @@ AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"])
Makefile.am
file in
- automake1-based
+ automake1-based
projects:
DISTCHECK_CONFIGURE_FLAGS = \
@@ -808,7 +799,7 @@ systemdsystemunit_DATA = \
endif
In the
- rpm8
+ rpm8
.spec file, use snippets
like the following to enable/disable the
service during
@@ -942,6 +933,14 @@ fi
+
+ Placing Daemon Data
+
+ It is recommended to follow the general
+ guidelines for placing package files, as discussed in
+ file-hierarchy7.
+
+
See Also
@@ -950,7 +949,8 @@ fi
sd_listen_fds3,
sd_notify3,
daemon3,
- systemd.service5
+ systemd.service5,
+ file-hierarchy7