This patch allows to use a new \S or \S{VARNAME} sequence in the
/etc/issue file. The sequence prints data from /etc/os-release. The
reason is to keep /etc/issue file distribution and release
independent.
The \S{ANSI_COLOR} is converted to the real terminal escape seq.
For example:
\S
Kernel \r on an \m (\l)
or more complex example:
Welcome to \S{ANSI_COLOR}\S{NAME}0m \S{VERSION}
Report bugs at \S{BUG_REPORT_URL}.
See http://www.freedesktop.org/software/systemd/man/os-release.html
fr more details about /etc/issue.
Based on patch from Bill Nottingham <notting@redhat.com>.
Signed-off-by: Karel Zak <kzak@redhat.com>
In include/bits/utmp.h the ut_user and ut_time macros are marked with
comment they are backwards compatibility hacks. It is probably best to
avoid use of these macros where ever possible.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* regression introduced by ef264c830e
* also increase sleep when O_NONBLOCK used (grr.. this is so stupid
thing, do we really need O_NONBLOCK for the stupid serial lines?)
References: https://bugzilla.redhat.com/show_bug.cgi?id=972457
Signed-off-by: Karel Zak <kzak@redhat.com>
- baud_rate is optional
- agetty has been rewritten 2 years ago, so don't blame original
authors in the man page
Signed-off-by: Karel Zak <kzak@redhat.com>
Now the -L option allows to explicitly enable CLOCAL flag.
Unfortunately sometimes it's necessary to clear the flag. This patch
add optional argument =<mode> to specify 'auto', 'always' and 'never'
to control CLOCAL flag.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=816342
Signed-off-by: Karel Zak <kzak@redhat.com>
this one moves the init_chardata to include/ttyutils.h as well as to
lib/include/ttyutils.c. Also the macros CTL/CTRL are fixed in
agetty.c and sulogin.c to use the XOR variant CTL.
[kzak@redhat.com: use macro rather than global variable for default
chardata]
Signed-off-by: Werner Fink <werner@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
- move struct chardata to include/ttyutils.h
- move console.{h,c} to login-utils/sulogin-* (it's sulogin specific)
- fix sulogin and agetty includes
Signed-off-by: Karel Zak <kzak@redhat.com>
We need way to disable the default kill and erase agetty chars to make
the getty usable for Active Directory users with '@' in username.
It seems that the most extendible solution is to add options that
allow to complete control additional erase/kill chars. If you specify
empty strings then the chars are disabled at all.
Note that this patch is backwardly compatible.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=870854
Signed-off-by: Karel Zak <kzak@redhat.com>
The --autologin prints
hostname login: username (automatic login)
message. This commit allows to suppress the message at all if
--skip-login (aka skip prompt) is specified.
It means that
agetty --skip-login --noissue --autologin foouser
does completely silent autologin.
Addresses: https://github.com/karelzak/util-linux/issues/21
Signed-off-by: Karel Zak <kzak@redhat.com>
Let's close all tty file descriptors if called with --hangup option.
References: https://lkml.org/lkml/2012/6/5/145
Signed-off-by: Karel Zak <kzak@redhat.com>
The session setup TIOCSCTTY is optional, so tcsetpgrp() that depends
on controlling terminal should be optional too.
Reported-by: Hilko Bengen <bengen@debian.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
The TIOCSCTTY ioctl requires that caller is session leader -- so it
depends on initd (or we have to add setsid() to aggety). It seems that the
traditional way is to setup tty in agetty and session in login(1).
It means that all session related things (TIOCSCTTY, vhangup, ...) in the
command agetty should be optional. (Note that vhangup() is called when
--hangup is explicitly specified on command line, so log_err() makes
sense there.)
Reported-by: Andrew Walrond <andrew@walrond.org>
Signed-off-by: Karel Zak <kzak@redhat.com>