summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--disk-utils/blockdev.c5
-rw-r--r--libblkid/src/superblocks/bcache.c2
-rw-r--r--libblkid/src/superblocks/minix.c9
-rw-r--r--sys-utils/hwclock.8.in89
-rw-r--r--tests/expected/logger/errors0
-rw-r--r--tests/expected/logger/errors-id_with_space2
-rw-r--r--tests/expected/logger/errors-invalid_prio1
-rw-r--r--tests/expected/logger/errors-kern_priority1
-rw-r--r--tests/expected/logger/errors-kern_priority_numeric1
-rw-r--r--tests/expected/logger/errors-rfc5424_exceed_size1
-rw-r--r--tests/expected/logger/errors-rfc5424_msgid_with_space1
-rw-r--r--tests/expected/logger/errors-tag_with_space2
-rw-r--r--tests/expected/logger/formats0
-rw-r--r--tests/expected/logger/formats-priorities152
-rw-r--r--tests/expected/logger/formats-rfc31641
-rw-r--r--tests/expected/logger/formats-rfc5424_msgid1
-rw-r--r--tests/expected/logger/formats-rfc5424_nohost1
-rw-r--r--tests/expected/logger/formats-rfc5424_notime1
-rw-r--r--tests/expected/logger/formats-rfc5424_simple1
-rw-r--r--tests/expected/logger/journald3
-rw-r--r--tests/expected/tailf/simple1
-rwxr-xr-xtests/ts/logger/errors65
-rwxr-xr-xtests/ts/logger/formats58
-rwxr-xr-xtests/ts/logger/journald35
25 files changed, 381 insertions, 54 deletions
diff --git a/configure.ac b/configure.ac
index cedf761f4..e070031e0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -106,6 +106,8 @@ UL_WARN_ADD([-fno-common])
UL_WARN_ADD([-Wall])
UL_WARN_ADD([-Werror=sequence-point])
UL_WARN_ADD([-Wextra])
+UL_WARN_ADD([-Wextra-semi])
+UL_WARN_ADD([-Wembedded-directive])
UL_WARN_ADD([-Wmissing-declarations])
UL_WARN_ADD([-Wmissing-parameter-type])
UL_WARN_ADD([-Wmissing-prototypes])
diff --git a/disk-utils/blockdev.c b/disk-utils/blockdev.c
index ef6ee1d4d..2f6681ce2 100644
--- a/disk-utils/blockdev.c
+++ b/disk-utils/blockdev.c
@@ -438,7 +438,6 @@ static void report_device(char *device, int quiet)
long ra;
unsigned long long bytes;
uint64_t start = 0;
- struct sysfs_cxt cxt;
struct stat st;
fd = open(device, O_RDONLY | O_NONBLOCK);
@@ -450,7 +449,9 @@ static void report_device(char *device, int quiet)
ro = ssz = bsz = 0;
ra = 0;
- if (fstat(fd, &st) == 0) {
+ if (fstat(fd, &st) == 0 && !sysfs_devno_is_wholedisk(st.st_rdev)) {
+ struct sysfs_cxt cxt;
+
if (sysfs_init(&cxt, st.st_rdev, NULL))
err(EXIT_FAILURE,
_("%s: failed to initialize sysfs handler"),
diff --git a/libblkid/src/superblocks/bcache.c b/libblkid/src/superblocks/bcache.c
index 4fb16bde2..ba9cf3270 100644
--- a/libblkid/src/superblocks/bcache.c
+++ b/libblkid/src/superblocks/bcache.c
@@ -117,7 +117,7 @@ static int probe_bcache (blkid_probe pr, const struct blkid_idmag *mag)
return BLKID_PROBE_NONE;
return BLKID_PROBE_OK;
-};
+}
const struct blkid_idinfo bcache_idinfo =
{
diff --git a/libblkid/src/superblocks/minix.c b/libblkid/src/superblocks/minix.c
index 9ea49fee8..d6d45bd9b 100644
--- a/libblkid/src/superblocks/minix.c
+++ b/libblkid/src/superblocks/minix.c
@@ -21,6 +21,7 @@ static int get_minix_version(const unsigned char *data, int *other_endian)
struct minix_super_block *sb = (struct minix_super_block *) data;
struct minix3_super_block *sb3 = (struct minix3_super_block *) data;
int version = 0;
+ char *endian;
*other_endian = 0;
@@ -60,13 +61,13 @@ static int get_minix_version(const unsigned char *data, int *other_endian)
if (!version)
return -1;
- DBG(LOWPROBE, ul_debug("minix version %d detected [%s]", version,
#if defined(WORDS_BIGENDIAN)
- *other_endian ? "LE" : "BE"
+ endian = *other_endian ? "LE" : "BE";
#else
- *other_endian ? "BE" : "LE"
+ endian = *other_endian ? "BE" : "LE";
#endif
- ));
+ DBG(LOWPROBE, ul_debug("minix version %d detected [%s]", version,
+ endian));
return version;
}
diff --git a/sys-utils/hwclock.8.in b/sys-utils/hwclock.8.in
index fbc10caa3..96c57d4a0 100644
--- a/sys-utils/hwclock.8.in
+++ b/sys-utils/hwclock.8.in
@@ -758,25 +758,31 @@ You can use an adjtime file that was previously used with the
.PP
You should be aware of another way that the Hardware Clock is kept
synchronized in some systems. The Linux kernel has a mode wherein it
-copies the System Time to the Hardware Clock every 11 minutes.
+copies the System Time to the Hardware Clock every 11 minutes. This mode
+is a compile time option, so not all kernels will have this capability.
This is a good mode to use when you are using something sophisticated
like NTP to keep your System Clock synchronized. (NTP is a way to keep
your System Time synchronized either to a time server somewhere on the
network or to a radio clock hooked up to your system. See RFC 1305.)
.PP
-This mode (we'll call it \%'11\ minute\ mode') is off until something
-turns it on. The NTP daemon ntpd is one thing that turns it on. You
-can turn it off by running anything, including
-.BR \%hwclock\ \-\-hctosys ,
-that sets the System Clock the old fashioned way. However, if the NTP daemon is
-still running, it will turn 11 minute mode back on again the next time it
-synchronizes the System Clock.
-.PP
-When \%'11\ minute\ mode' is active the 64 bit of the kernel's
-.I time_status
-variable is unset. The status variable can be checked with the
+If the kernel is compiled with the \%'11\ minute\ mode' option it will
+be active when the kernel's clock discipline is in a synchronized state.
+When in this state, bit 6 (the bit that is set in the mask 0x0040)
+of the kernel's
+.I \%time_status
+variable is unset. This value is output as the 'status' line of the
.BR \%adjtimex\ --print " or " \%ntptime " commands."
.PP
+It takes an outside influence, like the NTP daemon
+.BR ntpd (1),
+to put the kernel's clock discipline into a synchronized state, and
+therefore turn on \%'11\ minute\ mode'.
+It can be turned off by running anything that sets the System Clock the old
+fashioned way, including
+.BR "\%hwclock\ \-\-hctosys" .
+However, if the NTP daemon is still running, it will turn \%'11\ minute\ mode'
+back on again the next time it synchronizes the System Clock.
+.PP
If your system runs with \%'11\ minute\ mode' on, it may need to use either
.BR \%\-\-hctosys " or " \%\-\-systz
in a startup script, especially if the Hardware Clock is configured to use
@@ -888,7 +894,7 @@ would be
.BR \%adjtimex 's " \-\-log " options.
.PP
It may be more effective to simply track the System Clock drift with
-.BR \%ntpdate\ \-q " , or " \%date\ \-Ins
+.BR \%sntp ", or " \%date\ \-Ins
and a precision timepiece, and then calculate the correction manually.
.PP
After setting the tick and frequency values, continue to test and refine the
@@ -931,30 +937,8 @@ results it will likely need to be adjusted by directly editing the
file. Continue to test and refine the drift factor until the Hardware
Clock is corrected properly at startup. To check this, first make sure
that the System Time is correct before shutdown and then use
-.BR \%ntpdate\ \-q ", or " \%date\ \-Ins
+.BR \%sntp ", or " \%date\ \-Ins
and a precision timepiece, immediately after startup.
-.PP
-Both clocks typically use a quartz crystal oscillator. Crystals are
-used for reference oscillators in electronics because by most measures
-they produce a very clean and stable sine wave. Their greatest
-shortcoming is that they have a Positive Temperature Coefficient;
-meaning that their frequency increases as the temperature increases and
-vise versa. Therefore, both the Hardware and System Clock's drift rate
-changes with intrinsic and extrinsic machine temperatures. These
-characteristics will vary by machine depending upon its design.
-.PP
-Drift correction strategies are many, but as a general guide the goal
-would be to find a longterm average. A year long average to take into
-account seasonal ambient temperature shifts may be a good target period.
-So perhaps the date-time advances a bit in the summer and declines a bit
-in the winter, but at the end of a year it balances to zero.
-.PP
-If this is beginning to sound futile, it is not. Left on its own a
-machine can lose 3 seconds per day or more. Accumulated drift over a
-year may easily exceed half an hour. Using carefully crafted drift
-corrections can make a significant improvement in a machine's ability to
-keep reasonably good date-time.
-.
.SS LOCAL vs UTC
Keeping the Hardware Clock in a local timescale causes inconsistent
daylight saving time results:
@@ -1039,16 +1023,32 @@ time conversion.
Attempting to mix and match files from these separate databases will not
work, because they each require the System Clock to use a different
timescale. The zoneinfo database must be configured to use either posix
-or 'right', as described above.
-.
-.SH "ENVIRONMENT VARIABLES"
-.I TZ
-.
+or 'right', as described above, or by assigning a database path to the
+.SB TZDIR
+environment variable.
+.SH ENVIRONMENT
+.TP
+.B TZ
+If this variable is set its value takes precedence over the system
+configured timezone.
+.TP
+.B TZDIR
+If this variable is set its value takes precedence over the system
+configured timezone database directory path.
.SH FILES
-.br
+.TP
.I @ADJTIME_PATH@
-.br
+The configuration and state file for hwclock.
+.TP
.I /etc/localtime
+The system timezone file.
+.TP
+.I /usr/share/zoneinfo/
+The system timezone database directory.
+.PP
+Device files
+.B hwclock
+may try for Hardware Clock access:
.br
.I /dev/rtc
.br
@@ -1063,9 +1063,6 @@ or 'right', as described above.
.I /dev/port
.br
.I /dev/tty1
-.br
-.I /proc/cpuinfo
-.
.SH "SEE ALSO"
.BR date (1),
.BR adjtimex (8),
diff --git a/tests/expected/logger/errors b/tests/expected/logger/errors
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/expected/logger/errors
diff --git a/tests/expected/logger/errors-id_with_space b/tests/expected/logger/errors-id_with_space
new file mode 100644
index 000000000..081efaccd
--- /dev/null
+++ b/tests/expected/logger/errors-id_with_space
@@ -0,0 +1,2 @@
+test_logger: failed to parse id: 'A B'
+test_logger: failed to parse id: 'A B'
diff --git a/tests/expected/logger/errors-invalid_prio b/tests/expected/logger/errors-invalid_prio
new file mode 100644
index 000000000..cf79cf388
--- /dev/null
+++ b/tests/expected/logger/errors-invalid_prio
@@ -0,0 +1 @@
+test_logger: unknown priority name: 8
diff --git a/tests/expected/logger/errors-kern_priority b/tests/expected/logger/errors-kern_priority
new file mode 100644
index 000000000..6656db089
--- /dev/null
+++ b/tests/expected/logger/errors-kern_priority
@@ -0,0 +1 @@
+<8>Feb 13 23:31:30 prio: message
diff --git a/tests/expected/logger/errors-kern_priority_numeric b/tests/expected/logger/errors-kern_priority_numeric
new file mode 100644
index 000000000..6656db089
--- /dev/null
+++ b/tests/expected/logger/errors-kern_priority_numeric
@@ -0,0 +1 @@
+<8>Feb 13 23:31:30 prio: message
diff --git a/tests/expected/logger/errors-rfc5424_exceed_size b/tests/expected/logger/errors-rfc5424_exceed_size
new file mode 100644
index 000000000..91f69b62a
--- /dev/null
+++ b/tests/expected/logger/errors-rfc5424_exceed_size
@@ -0,0 +1 @@
+<13>1 2009-02-13T23:31:30.123456+00:00 test-hostname rfc5424_exceed_size - - [timeQuality tzKnown="1" isSynced="0"] abc
diff --git a/tests/expected/logger/errors-rfc5424_msgid_with_space b/tests/expected/logger/errors-rfc5424_msgid_with_space
new file mode 100644
index 000000000..273bc9b65
--- /dev/null
+++ b/tests/expected/logger/errors-rfc5424_msgid_with_space
@@ -0,0 +1 @@
+test_logger: --msgid cannot contain space
diff --git a/tests/expected/logger/errors-tag_with_space b/tests/expected/logger/errors-tag_with_space
new file mode 100644
index 000000000..9821d82c0
--- /dev/null
+++ b/tests/expected/logger/errors-tag_with_space
@@ -0,0 +1,2 @@
+<13>Feb 13 23:31:30 A B: tag_with_space
+<13>1 2009-02-13T23:31:30.123456+00:00 test-hostname A B - - [timeQuality tzKnown="1" isSynced="0"] tag_with_space_rfc5424
diff --git a/tests/expected/logger/formats b/tests/expected/logger/formats
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/expected/logger/formats
diff --git a/tests/expected/logger/formats-priorities b/tests/expected/logger/formats-priorities
new file mode 100644
index 000000000..32d136f46
--- /dev/null
+++ b/tests/expected/logger/formats-priorities
@@ -0,0 +1,152 @@
+<32>Feb 13 23:31:30 prio: auth.emerg
+<33>Feb 13 23:31:30 prio: auth.alert
+<34>Feb 13 23:31:30 prio: auth.crit
+<35>Feb 13 23:31:30 prio: auth.err
+<36>Feb 13 23:31:30 prio: auth.warning
+<37>Feb 13 23:31:30 prio: auth.notice
+<38>Feb 13 23:31:30 prio: auth.info
+<39>Feb 13 23:31:30 prio: auth.debug
+<80>Feb 13 23:31:30 prio: authpriv.emerg
+<81>Feb 13 23:31:30 prio: authpriv.alert
+<82>Feb 13 23:31:30 prio: authpriv.crit
+<83>Feb 13 23:31:30 prio: authpriv.err
+<84>Feb 13 23:31:30 prio: authpriv.warning
+<85>Feb 13 23:31:30 prio: authpriv.notice
+<86>Feb 13 23:31:30 prio: authpriv.info
+<87>Feb 13 23:31:30 prio: authpriv.debug
+<72>Feb 13 23:31:30 prio: cron.emerg
+<73>Feb 13 23:31:30 prio: cron.alert
+<74>Feb 13 23:31:30 prio: cron.crit
+<75>Feb 13 23:31:30 prio: cron.err
+<76>Feb 13 23:31:30 prio: cron.warning
+<77>Feb 13 23:31:30 prio: cron.notice
+<78>Feb 13 23:31:30 prio: cron.info
+<79>Feb 13 23:31:30 prio: cron.debug
+<24>Feb 13 23:31:30 prio: daemon.emerg
+<25>Feb 13 23:31:30 prio: daemon.alert
+<26>Feb 13 23:31:30 prio: daemon.crit
+<27>Feb 13 23:31:30 prio: daemon.err
+<28>Feb 13 23:31:30 prio: daemon.warning
+<29>Feb 13 23:31:30 prio: daemon.notice
+<30>Feb 13 23:31:30 prio: daemon.info
+<31>Feb 13 23:31:30 prio: daemon.debug
+<88>Feb 13 23:31:30 prio: ftp.emerg
+<89>Feb 13 23:31:30 prio: ftp.alert
+<90>Feb 13 23:31:30 prio: ftp.crit
+<91>Feb 13 23:31:30 prio: ftp.err
+<92>Feb 13 23:31:30 prio: ftp.warning
+<93>Feb 13 23:31:30 prio: ftp.notice
+<94>Feb 13 23:31:30 prio: ftp.info
+<95>Feb 13 23:31:30 prio: ftp.debug
+<48>Feb 13 23:31:30 prio: lpr.emerg
+<49>Feb 13 23:31:30 prio: lpr.alert
+<50>Feb 13 23:31:30 prio: lpr.crit
+<51>Feb 13 23:31:30 prio: lpr.err
+<52>Feb 13 23:31:30 prio: lpr.warning
+<53>Feb 13 23:31:30 prio: lpr.notice
+<54>Feb 13 23:31:30 prio: lpr.info
+<55>Feb 13 23:31:30 prio: lpr.debug
+<16>Feb 13 23:31:30 prio: mail.emerg
+<17>Feb 13 23:31:30 prio: mail.alert
+<18>Feb 13 23:31:30 prio: mail.crit
+<19>Feb 13 23:31:30 prio: mail.err
+<20>Feb 13 23:31:30 prio: mail.warning
+<21>Feb 13 23:31:30 prio: mail.notice
+<22>Feb 13 23:31:30 prio: mail.info
+<23>Feb 13 23:31:30 prio: mail.debug
+<56>Feb 13 23:31:30 prio: news.emerg
+<57>Feb 13 23:31:30 prio: news.alert
+<58>Feb 13 23:31:30 prio: news.crit
+<59>Feb 13 23:31:30 prio: news.err
+<60>Feb 13 23:31:30 prio: news.warning
+<61>Feb 13 23:31:30 prio: news.notice
+<62>Feb 13 23:31:30 prio: news.info
+<63>Feb 13 23:31:30 prio: news.debug
+<40>Feb 13 23:31:30 prio: syslog.emerg
+<41>Feb 13 23:31:30 prio: syslog.alert
+<42>Feb 13 23:31:30 prio: syslog.crit
+<43>Feb 13 23:31:30 prio: syslog.err
+<44>Feb 13 23:31:30 prio: syslog.warning
+<45>Feb 13 23:31:30 prio: syslog.notice
+<46>Feb 13 23:31:30 prio: syslog.info
+<47>Feb 13 23:31:30 prio: syslog.debug
+<8>Feb 13 23:31:30 prio: user.emerg
+<9>Feb 13 23:31:30 prio: user.alert
+<10>Feb 13 23:31:30 prio: user.crit
+<11>Feb 13 23:31:30 prio: user.err
+<12>Feb 13 23:31:30 prio: user.warning
+<13>Feb 13 23:31:30 prio: user.notice
+<14>Feb 13 23:31:30 prio: user.info
+<15>Feb 13 23:31:30 prio: user.debug
+<64>Feb 13 23:31:30 prio: uucp.emerg
+<65>Feb 13 23:31:30 prio: uucp.alert
+<66>Feb 13 23:31:30 prio: uucp.crit
+<67>Feb 13 23:31:30 prio: uucp.err
+<68>Feb 13 23:31:30 prio: uucp.warning
+<69>Feb 13 23:31:30 prio: uucp.notice
+<70>Feb 13 23:31:30 prio: uucp.info
+<71>Feb 13 23:31:30 prio: uucp.debug
+<128>Feb 13 23:31:30 prio: local0.emerg
+<129>Feb 13 23:31:30 prio: local0.alert
+<130>Feb 13 23:31:30 prio: local0.crit
+<131>Feb 13 23:31:30 prio: local0.err
+<132>Feb 13 23:31:30 prio: local0.warning
+<133>Feb 13 23:31:30 prio: local0.notice
+<134>Feb 13 23:31:30 prio: local0.info
+<135>Feb 13 23:31:30 prio: local0.debug
+<136>Feb 13 23:31:30 prio: local1.emerg
+<137>Feb 13 23:31:30 prio: local1.alert
+<138>Feb 13 23:31:30 prio: local1.crit
+<139>Feb 13 23:31:30 prio: local1.err
+<140>Feb 13 23:31:30 prio: local1.warning
+<141>Feb 13 23:31:30 prio: local1.notice
+<142>Feb 13 23:31:30 prio: local1.info
+<143>Feb 13 23:31:30 prio: local1.debug
+<144>Feb 13 23:31:30 prio: local2.emerg
+<145>Feb 13 23:31:30 prio: local2.alert
+<146>Feb 13 23:31:30 prio: local2.crit
+<147>Feb 13 23:31:30 prio: local2.err
+<148>Feb 13 23:31:30 prio: local2.warning
+<149>Feb 13 23:31:30 prio: local2.notice
+<150>Feb 13 23:31:30 prio: local2.info
+<151>Feb 13 23:31:30 prio: local2.debug
+<152>Feb 13 23:31:30 prio: local3.emerg
+<153>Feb 13 23:31:30 prio: local3.alert
+<154>Feb 13 23:31:30 prio: local3.crit
+<155>Feb 13 23:31:30 prio: local3.err
+<156>Feb 13 23:31:30 prio: local3.warning
+<157>Feb 13 23:31:30 prio: local3.notice
+<158>Feb 13 23:31:30 prio: local3.info
+<159>Feb 13 23:31:30 prio: local3.debug
+<160>Feb 13 23:31:30 prio: local4.emerg
+<161>Feb 13 23:31:30 prio: local4.alert
+<162>Feb 13 23:31:30 prio: local4.crit
+<163>Feb 13 23:31:30 prio: local4.err
+<164>Feb 13 23:31:30 prio: local4.warning
+<165>Feb 13 23:31:30 prio: local4.notice
+<166>Feb 13 23:31:30 prio: local4.info
+<167>Feb 13 23:31:30 prio: local4.debug
+<168>Feb 13 23:31:30 prio: local5.emerg
+<169>Feb 13 23:31:30 prio: local5.alert
+<170>Feb 13 23:31:30 prio: local5.crit
+<171>Feb 13 23:31:30 prio: local5.err
+<172>Feb 13 23:31:30 prio: local5.warning
+<173>Feb 13 23:31:30 prio: local5.notice
+<174>Feb 13 23:31:30 prio: local5.info
+<175>Feb 13 23:31:30 prio: local5.debug
+<176>Feb 13 23:31:30 prio: local6.emerg
+<177>Feb 13 23:31:30 prio: local6.alert
+<178>Feb 13 23:31:30 prio: local6.crit
+<179>Feb 13 23:31:30 prio: local6.err
+<180>Feb 13 23:31:30 prio: local6.warning
+<181>Feb 13 23:31:30 prio: local6.notice
+<182>Feb 13 23:31:30 prio: local6.info
+<183>Feb 13 23:31:30 prio: local6.debug
+<184>Feb 13 23:31:30 prio: local7.emerg
+<185>Feb 13 23:31:30 prio: local7.alert
+<186>Feb 13 23:31:30 prio: local7.crit
+<187>Feb 13 23:31:30 prio: local7.err
+<188>Feb 13 23:31:30 prio: local7.warning
+<189>Feb 13 23:31:30 prio: local7.notice
+<190>Feb 13 23:31:30 prio: local7.info
+<191>Feb 13 23:31:30 prio: local7.debug
diff --git a/tests/expected/logger/formats-rfc3164 b/tests/expected/logger/formats-rfc3164
new file mode 100644
index 000000000..03534609d
--- /dev/null
+++ b/tests/expected/logger/formats-rfc3164
@@ -0,0 +1 @@
+<13>Feb 13 23:31:30 test-hostname rfc3164: message
diff --git a/tests/expected/logger/formats-rfc5424_msgid b/tests/expected/logger/formats-rfc5424_msgid
new file mode 100644
index 000000000..fee0e430d
--- /dev/null
+++ b/tests/expected/logger/formats-rfc5424_msgid
@@ -0,0 +1 @@
+<13>1 2009-02-13T23:31:30.123456+00:00 test-hostname rfc5424 - MSGID [timeQuality tzKnown="1" isSynced="0"] message
diff --git a/tests/expected/logger/formats-rfc5424_nohost b/tests/expected/logger/formats-rfc5424_nohost
new file mode 100644
index 000000000..30af1115e
--- /dev/null
+++ b/tests/expected/logger/formats-rfc5424_nohost
@@ -0,0 +1 @@
+<13>1 2009-02-13T23:31:30.123456+00:00 - rfc5424 - - [timeQuality tzKnown="1" isSynced="0"] message
diff --git a/tests/expected/logger/formats-rfc5424_notime b/tests/expected/logger/formats-rfc5424_notime
new file mode 100644
index 000000000..4572dfad4
--- /dev/null
+++ b/tests/expected/logger/formats-rfc5424_notime
@@ -0,0 +1 @@
+<13>1 - test-hostname rfc5424 - - - message
diff --git a/tests/expected/logger/formats-rfc5424_simple b/tests/expected/logger/formats-rfc5424_simple
new file mode 100644
index 000000000..8ac4038cf
--- /dev/null
+++ b/tests/expected/logger/formats-rfc5424_simple
@@ -0,0 +1 @@
+<13>1 2009-02-13T23:31:30.123456+00:00 test-hostname rfc5424 - - [timeQuality tzKnown="1" isSynced="0"] message
diff --git a/tests/expected/logger/journald b/tests/expected/logger/journald
new file mode 100644
index 000000000..d4b1549e7
--- /dev/null
+++ b/tests/expected/logger/journald
@@ -0,0 +1,3 @@
+MESSAGE_ID=b8f74e14bc714bfc8040a5106dc9376a
+MESSAGE=a b c 1 2 3
+
diff --git a/tests/expected/tailf/simple b/tests/expected/tailf/simple
index 5edc76b2e..ddf72de36 100644
--- a/tests/expected/tailf/simple
+++ b/tests/expected/tailf/simple
@@ -1,3 +1,2 @@
-tailf: warning: use of 'tailf' is deprecated, use 'tail -f' instead
a b c d e f g h i j k l m n o p q r s t u v w x y z
0 1 2 3 4 5 6 7 8 9
diff --git a/tests/ts/logger/errors b/tests/ts/logger/errors
new file mode 100755
index 000000000..369ceb6e2
--- /dev/null
+++ b/tests/ts/logger/errors
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+#
+# Copyright (C) 2015 Sami Kerola <kerolasa@iki.fi>
+#
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+
+TS_TOPDIR="${0%/*}/../.."
+TS_DESC="errors"
+
+. $TS_TOPDIR/functions.sh
+
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_LOGGER"
+
+export TZ="GMT"
+export LOGGER_TEST_TIMEOFDAY="1234567890.123456"
+export LOGGER_TEST_HOSTNAME="test-hostname"
+export LOGGER_TEST_GETPID="98765"
+
+ts_init_subtest "kern_priority"
+$TS_HELPER_LOGGER --no-act -s -t "prio" -p kern.emerg "message" > "$TS_OUTPUT" 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "kern_priority_numeric"
+$TS_HELPER_LOGGER --no-act -s -t "prio" -p 0 "message" > "$TS_OUTPUT" 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "invalid_prio"
+$TS_HELPER_LOGGER --no-act -s -t "prio" -p 8 "message" > "$TS_OUTPUT" 2>&1
+ts_finalize_subtest
+
+# should truncate
+ts_init_subtest "rfc5424_exceed_size"
+$TS_HELPER_LOGGER --no-act -s -t "rfc5424_exceed_size" --rfc5424 --size 3 "abcd" > "$TS_OUTPUT" 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "id_with_space"
+$TS_HELPER_LOGGER --no-act -s -t "id_with_space" --id="A B" "message" > "$TS_OUTPUT" 2>&1
+$TS_HELPER_LOGGER --no-act -s -t "rfc5424_id_with_space" --rfc5424 --id="A B" "message" >> "$TS_OUTPUT" 2>&1
+ts_finalize_subtest
+
+# should not fail
+ts_init_subtest "tag_with_space"
+$TS_HELPER_LOGGER --no-act -s -t "A B" "tag_with_space" > "$TS_OUTPUT" 2>&1
+$TS_HELPER_LOGGER --no-act -s -t "A B" --rfc5424 "tag_with_space_rfc5424" >> "$TS_OUTPUT" 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "rfc5424_msgid_with_space"
+$TS_HELPER_LOGGER --no-act -s -t "rfc5424_msgid_with_space" --rfc5424 --msgid="A B" "message" > "$TS_OUTPUT" 2>&1
+ts_finalize_subtest
+
+ts_finalize
diff --git a/tests/ts/logger/formats b/tests/ts/logger/formats
new file mode 100755
index 000000000..4d11c1d9b
--- /dev/null
+++ b/tests/ts/logger/formats
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+#
+# Copyright (C) 2015 Sami Kerola <kerolasa@iki.fi>
+#
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+
+TS_TOPDIR="${0%/*}/../.."
+TS_DESC="formats"
+
+. $TS_TOPDIR/functions.sh
+
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_LOGGER"
+
+export TZ="GMT"
+export LOGGER_TEST_TIMEOFDAY="1234567890.123456"
+export LOGGER_TEST_HOSTNAME="test-hostname"
+export LOGGER_TEST_GETPID="98765"
+
+ts_init_subtest "rfc3164"
+$TS_HELPER_LOGGER -s --no-act -t "rfc3164" --rfc3164 "message" > "$TS_OUTPUT" 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "rfc5424_simple"
+$TS_HELPER_LOGGER -s --no-act -t "rfc5424" --rfc5424 "message" > "$TS_OUTPUT" 2>&1
+ts_finalize_subtest
+ts_init_subtest "rfc5424_notime"
+$TS_HELPER_LOGGER -s --no-act -t "rfc5424" --rfc5424=notime "message" > "$TS_OUTPUT" 2>&1
+ts_finalize_subtest
+ts_init_subtest "rfc5424_nohost"
+$TS_HELPER_LOGGER -s --no-act -t "rfc5424" --rfc5424=nohost "message" > "$TS_OUTPUT" 2>&1
+ts_finalize_subtest
+ts_init_subtest "rfc5424_msgid"
+$TS_HELPER_LOGGER -s --no-act -t "rfc5424" --rfc5424 --msgid "MSGID" "message" > "$TS_OUTPUT" 2>&1
+ts_finalize_subtest
+
+ts_init_subtest "priorities"
+for facility in auth authpriv cron daemon ftp lpr mail news syslog user uucp local{0..7}; do
+ for level in emerg alert crit err warning notice info debug; do
+ $TS_HELPER_LOGGER -s --no-act -t "prio" -p "$facility.$level" "$facility.$level" >> "$TS_OUTPUT" 2>&1
+ done
+done
+ts_finalize_subtest
+
+ts_finalize
diff --git a/tests/ts/logger/journald b/tests/ts/logger/journald
new file mode 100755
index 000000000..846548aff
--- /dev/null
+++ b/tests/ts/logger/journald
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+#
+# Copyright (C) 2015 Sami Kerola <kerolasa@iki.fi>
+#
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+
+TS_TOPDIR="${0%/*}/../.."
+TS_DESC="journald"
+
+. $TS_TOPDIR/functions.sh
+
+ts_init "$*"
+
+ts_check_test_command "$TS_HELPER_LOGGER"
+
+if ! $TS_HELPER_LOGGER --help | grep -q journald; then
+ ts_skip "unsupported"
+fi
+
+printf "%s\n%s\n%s\n" MESSAGE_ID=b8f74e14bc714bfc8040a5106dc9376a MESSAGE="a b c 1 2 3" |
+$TS_HELPER_LOGGER --no-act --journald --stderr > "$TS_OUTPUT" 2>&1
+
+ts_finalize