From ffa16db02673ffa155ffb2649e72a935a1ff70f5 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 3 Apr 2012 22:31:48 +0200 Subject: man: document special journal fields --- src/logs-show.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/logs-show.c b/src/logs-show.c index 0a07a77bed..158223fc0a 100644 --- a/src/logs-show.c +++ b/src/logs-show.c @@ -348,8 +348,8 @@ static int output_export(sd_journal *j, unsigned line, unsigned n_columns, bool } printf("__CURSOR=%s\n" - "__REALTIME=%llu\n" - "__MONOTONIC=%llu\n" + "__REALTIME_TIMESTAMP=%llu\n" + "__MONOTONIC_TIMESTAMP=%llu\n" "__BOOT_ID=%s\n", cursor, (unsigned long long) realtime, @@ -460,8 +460,8 @@ static int output_json(sd_journal *j, unsigned line, unsigned n_columns, bool sh printf("{\n" "\t\"__CURSOR\" : \"%s\",\n" - "\t\"__REALTIME\" : \"%llu\",\n" - "\t\"__MONOTONIC\" : \"%llu\",\n" + "\t\"__REALTIME_TIMESTAMP\" : \"%llu\",\n" + "\t\"__MONOTONIC_TIMESTAMP\" : \"%llu\",\n" "\t\"__BOOT_ID\" : \"%s\"", cursor, (unsigned long long) realtime, -- cgit v1.2.3-54-g00ecf From feb88c9ff52b52a1fc0f075cba1215e4c2a82545 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 3 Apr 2012 22:32:05 +0200 Subject: man: update documentation of special units --- man/systemd.special.xml | 162 +++++++++++++++++++++++++----------------------- src/special.h | 2 +- 2 files changed, 85 insertions(+), 79 deletions(-) (limited to 'src') diff --git a/man/systemd.special.xml b/man/systemd.special.xml index 116a43ccfb..fe85137ffe 100644 --- a/man/systemd.special.xml +++ b/man/systemd.special.xml @@ -44,20 +44,24 @@ systemd.special - special systemd units + Special systemd units basic.target, ctrl-alt-del.target, dbus.service, + dbus.socket, default.target, display-manager.service, emergency.target, exit.service, + final.service, graphical.target, + http-daemon.target, halt.target, kbrequest.target, + kexec.target, local-fs.target, local-fs-pre.target, mail-transfer-agent.target, @@ -79,11 +83,9 @@ sockets.target, swap.target, sysinit.target, + syslog.service, + syslog.socket, syslog.target, - systemd-initctl.service, - systemd-initctl.socket, - systemd-stdout-syslog-bridge.service, - systemd-stdout-syslog-bridge.socket, time-sync.target, umount.target @@ -145,6 +147,18 @@ service. + + dbus.socket + + A special unit for the + D-Bus system bus socket. All + units with + Type=dbus + automatically gain a + dependency on this + unit. + + default.target @@ -168,7 +182,7 @@ The display manager service. Usually this should be aliased (symlinked) to - xdm.service + gdm.service or a similar display manager service. systemd automatically @@ -196,6 +210,19 @@ + + final.target + + A special target unit + that is used during the + shutdown logic and may be used + to pull in late services after + all normal services are + already terminated and all + mounts unmounted. + + + graphical.target @@ -212,6 +239,22 @@ during installation. + + http-daemon.target + + A target for pulling in + an HTTP server if there is + any. + systemd automatically + adds dependencies of type + After for this target unit to + all SysV init script service + units with a LSB header + referring to the + $httpd + facility. + + halt.target @@ -234,6 +277,17 @@ rescue.target. + + kexec.target + + A special target unit + for shutting down and rebooting the system via kexec. + + Applications wanting to + reboot the system with kexec should start + this unit. + + local-fs.target @@ -554,6 +608,28 @@ or b. + + syslog.service + + The syslog service if + any. Implementations should + create a symlink from the + actual syslog implementation + to this generic name for + activating it. + + + + syslog.socket + + The socket unit where + syslog implementations should + listen on. All userspace log + messages will be made + available on this + socket. + + syslog.target @@ -567,74 +643,6 @@ facility. - - systemd-initctl.service - - This provides - compatibility with the SysV - /dev/initctl file system FIFO - for communication with the - init system. - This is a - socket-activated service, see - system-initctl.socket. - - - - systemd-initctl.socket - - Socket activation unit - for - system-initctl.service. - - - - systemd-stdout-syslog-bridge.service - - This is internally used - by systemd to provide syslog - logging to the processes it - maintains. - This is a - socket-activated service, see - system-stdout-syslog-bridge.socket. - - - - systemd-stdout-syslog-bridge.socket - - Socket activation unit - for - system-stdout-syslog-bridge.service. systemd - will automatically add - dependencies of types Requires - and After to all units that - have been configured for - stdout or stderr to be - connected to syslog or the - kernel log buffer. - - - - systemd-shutdownd.service - - This is internally used - by - shutdown8 - to implement delayed shutdowns. - This is a - socket-activated service, see - system-shutdownd.socket. - - - - systemd-shutdownd.socket - - Socket activation unit - for - system-shutdownd.service. - - time-sync.target @@ -676,11 +684,8 @@ following special units are available, which have similar definitions as their system counterparts: default.target, - local-fs.target, - remote-fs.target, shutdown.target, - sockets.target, - swap.target. + sockets.target In addition the following special unit is understood only when systemd runs as service instance: @@ -715,6 +720,7 @@ See Also + systemd1, systemd.unit5, systemd.service5, systemd.socket5, diff --git a/src/special.h b/src/special.h index 8185eaf60e..43e2e6f6d7 100644 --- a/src/special.h +++ b/src/special.h @@ -55,7 +55,7 @@ #define SPECIAL_NETWORK_TARGET "network.target" /* LSB's $network */ #define SPECIAL_NSS_LOOKUP_TARGET "nss-lookup.target" /* LSB's $named */ #define SPECIAL_RPCBIND_TARGET "rpcbind.target" /* LSB's $portmap */ -#define SPECIAL_SYSLOG_TARGET "syslog.target" /* LSB's $syslog; Should pull in syslog.socket or syslog.service */ +#define SPECIAL_SYSLOG_TARGET "syslog.target" /* LSB's $syslog */ #define SPECIAL_TIME_SYNC_TARGET "time-sync.target" /* LSB's $time */ #define SPECIAL_DISPLAY_MANAGER_SERVICE "display-manager.service" /* Debian's $x-display-manager */ #define SPECIAL_MAIL_TRANSFER_AGENT_TARGET "mail-transfer-agent.target" /* Debian's $mail-{transport|transfer-agent */ -- cgit v1.2.3-54-g00ecf From 112301ae4433b59ae602556f455c4065bddb6ad6 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 4 Apr 2012 01:00:09 +0200 Subject: journal: don't export the boot id twice per entry --- src/logs-show.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/logs-show.c b/src/logs-show.c index 158223fc0a..a6220351b6 100644 --- a/src/logs-show.c +++ b/src/logs-show.c @@ -350,7 +350,7 @@ static int output_export(sd_journal *j, unsigned line, unsigned n_columns, bool printf("__CURSOR=%s\n" "__REALTIME_TIMESTAMP=%llu\n" "__MONOTONIC_TIMESTAMP=%llu\n" - "__BOOT_ID=%s\n", + "_BOOT_ID=%s\n", cursor, (unsigned long long) realtime, (unsigned long long) monotonic, @@ -360,6 +360,12 @@ static int output_export(sd_journal *j, unsigned line, unsigned n_columns, bool SD_JOURNAL_FOREACH_DATA(j, data, length) { + /* We already printed the boot id, from the data in + * the header, hence let's suppress it here */ + if (length >= 9 && + memcmp(data, "_BOOT_ID=", 9) == 0) + continue; + if (contains_unprintable(data, length)) { const char *c; uint64_t le64; @@ -462,7 +468,7 @@ static int output_json(sd_journal *j, unsigned line, unsigned n_columns, bool sh "\t\"__CURSOR\" : \"%s\",\n" "\t\"__REALTIME_TIMESTAMP\" : \"%llu\",\n" "\t\"__MONOTONIC_TIMESTAMP\" : \"%llu\",\n" - "\t\"__BOOT_ID\" : \"%s\"", + "\t\"_BOOT_ID\" : \"%s\"", cursor, (unsigned long long) realtime, (unsigned long long) monotonic, @@ -473,6 +479,12 @@ static int output_json(sd_journal *j, unsigned line, unsigned n_columns, bool sh SD_JOURNAL_FOREACH_DATA(j, data, length) { const char *c; + /* We already printed the boot id, from the data in + * the header, hence let's suppress it here */ + if (length >= 9 && + memcmp(data, "_BOOT_ID=", 9) == 0) + continue; + c = memchr(data, '=', length); if (!c) { log_error("Invalid field."); -- cgit v1.2.3-54-g00ecf