Sami Kerola [Sat, 9 Aug 2014 08:09:16 +0000 (09:09 +0100)]
docs: mentintion default udp and tcp ports logger is using
The fact that 'syslog tcp/514' does not exist in RFS's, which has lead
to 'syslog-conn 601/tcp' be used in place could be a suprice and should
be told in manual.
Sami Kerola [Fri, 8 Aug 2014 23:49:46 +0000 (00:49 +0100)]
logger: allow use of --id=ppid when logging locally
There is no obvious way to make syslog(3) to print both pid or ppid, so
duplicate the libc syslog() to logger. Making the ppid printing work
using unix socket has side effect of local becoming capable to use both
rfc format output, which is hopefully seen as good thing. The
syslog_local() is format wise one-to-one copy with glibc syslog(3)
format.
Use of --algorithm or --streams is not expected to work without
reseting device, that happens when --size is specified, so ensure the
former options to be combined with the later.
[kzak@redhat.com: - make it more generic]
Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Thu, 31 Jul 2014 08:55:38 +0000 (10:55 +0200)]
Merge branch 'travis' of git://github.com/kerolasa/lelux-utiliteetit
* 'travis' of git://github.com/kerolasa/lelux-utiliteetit:
tests: fix rename subdir check that was failing in travis
build-sys: remove swap-common.h from sys-utils/Makemodule.am
Sami Kerola [Wed, 30 Jul 2014 21:21:08 +0000 (22:21 +0100)]
tests: fix rename subdir check that was failing in travis
Apparently some or all travis build servers has a bit older coreutils
version. The coreutils v8.13 added a feature to readlink that allows
user to specify multiple arguments. Earlier versions gave exactly the
type of error travis_script log has.
+readlink: extra operand `rename_aa/sublink.2'
+Try `readlink --help' for more information.
Reference: https://travis-ci.org/karelzak/util-linux/builds Reviewed-by: Bernhard Voelker <mail@bernhard-voelker.de> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
fdformat: Add new switches -f/--from, -t/--to, -r/--repair
This commit introduces a support for user configurable
from/to track and a basic repair mode for broken floppies.
It also fixes a recently introduced bug that causes
a line breakage when printing the track number.
Karel Zak [Tue, 29 Jul 2014 11:07:44 +0000 (13:07 +0200)]
nsenter: allow to use --set{uid,gid} for all namespaces
Now it's possible to set UID and GID for user namespaces only. This
patch removes this restriction and allow to use --set{uid,gid} in all
cases. The default for user namespaces is still GID=0, UID=0.
Reported-by: Tomas Doran <bobtfish@bobtfish.net> Signed-off-by: Karel Zak <kzak@redhat.com>
When tailf is not using inotify, it seems to sleep for 0.25s between
checks. Just giving a 0.1s time window between update and removal of the
input file thus gives little chance for tailf to succeed.
Similar between startup and append to file, make sure initial
content is read before appending additional data by bumping the time.
This should possibly be bumped much larger to make sure that
the tailf process actually gets a chance to run at all in the
given time window. Otherwise it might fail on really slow/overloaded
machines.
The drawback would then ofcourse be to increase the time it takes
to run the testsuite.
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Karel Zak [Tue, 29 Jul 2014 08:22:21 +0000 (10:22 +0200)]
Merge branch 'logger' of git://github.com/kerolasa/lelux-utiliteetit
* 'logger' of git://github.com/kerolasa/lelux-utiliteetit:
wall: wrap message header when it exceeds 79 characters
logger: add hostname to rfc3164 message
logger: warn when --file and command line message are combined
logger: improve readablity of pencode() function
logger: make --stderr print remote server messages
logger: add process --id=parent optional argument
docs: add logger protocol notes to manual page
logger: add rfc5424 support
logger: tidy up main() by adding small functions and ctl data
logger: add function pointer to choose how logging is done
docs: make logger.1 facilities and levels easier to read
logger: refactor long if clause
logger: do not rely only getlogin(3) telling who ran the command
logger: fix indentation issues
logger: ensure program writes everything to syslog file descriptor
Sami Kerola [Sun, 27 Jul 2014 17:33:22 +0000 (18:33 +0100)]
logger: add hostname to rfc3164 message
This makes the obsolete protocol a little bit more compliant with the
internet standard, but few should care now when we have rfc5424 support,
and rfc3164 feels broken. For example it requires hostname to be not
fully qualified, which is hard to understand, and should make users to
prefer the new protocol.
Reported-by: Frank Thilo <thilo@unix-ag.org>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=705217 CC: Andreas Henriksson <andreas@fatal.se> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sun, 27 Jul 2014 17:01:09 +0000 (18:01 +0100)]
logger: warn when --file and command line message are combined
When --file is combined with command line arguments the later has
silently been ignored. This commit makes user to be aware the logger
will not use command line arguments when --file is specified.
Reported-by: "Daniel 'DaB.' Baur" <debian@daniel.baur4.info>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=467244 CC: Andreas Henriksson <andreas@fatal.se> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sat, 28 Jun 2014 14:37:39 +0000 (15:37 +0100)]
docs: add logger protocol notes to manual page
Inform about rfc5424 support, how to control what it includes to
submission, and that it is the new default when sending syslog messages
to remote server without specifying protocol.
Sami Kerola [Thu, 26 Jun 2014 15:13:55 +0000 (16:13 +0100)]
logger: add rfc5424 support
Add support the more recent syslog protocol and make it default. The
older BSD syslog protocol can still be used with option --rfc3164.
Protocols are meaningful only when messages are sent to remote syslog
server.
Requested-by: Kodiak Firesmith <ksf@sei.cmu.edu> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sat, 26 Jul 2014 12:10:25 +0000 (13:10 +0100)]
logger: tidy up main() by adding small functions and ctl data
Add logger_open(), logger_command_line(), logger_stdin(), and
logger_close() functions, and move all remaining option argument
assignments to control structure.
Proposed-by: Karel Zak <kzak@redhat.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sun, 22 Jun 2014 22:43:09 +0000 (23:43 +0100)]
logger: refactor long if clause
When if clause that continues throughout whole function it usually can be
shorten to immediate action, e.g., in this case return on the spot not at
end of the function.
Sami Kerola [Sun, 22 Jun 2014 22:29:36 +0000 (23:29 +0100)]
logger: do not rely only getlogin(3) telling who ran the command
The getlogin(3) is known not to always work, and when that happens it is
reasonable to try determine user of name by looking process owner and
passwd information.
Reference: http://man7.org/linux/man-pages/man3/getlogin.3.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Stef Walter [Thu, 3 Jul 2014 15:44:41 +0000 (17:44 +0200)]
agetty: Reprompt and reprint /etc/issue when asked
Add an 'agetty --reload' command which asks all running agetty
commands to display their prompts again.
Several of the /etc/issue escape codes such as \4 and \S depend on
variable data which can change after the agetty prompt is displayed.
This can cause stale data to be displayed when a user looks at a VT,
especially in cases of DHCP racing with system start up.
We never want this to occur once the user has started typing a
user name. So we detect when the user starts typing, after which
no further reprompting occurs after that point.
[kzak@redhat.com: - add #ifdefs to make it usable on non-inotify systems,
- use futimens() with NULL timespec
- add --reaload to usage()]
Signed-off-by: Stef Walter <stefw-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> Signed-off-by: Karel Zak <kzak@redhat.com>