sbin_PROGRAMS += agetty
MANPAGES += term-utils/agetty.8
dist_noinst_DATA += term-utils/agetty.8.adoc
-agetty_SOURCES = term-utils/agetty.c
+agetty_SOURCES = term-utils/agetty.c \
+ lib/logindefs.c
if USE_PLYMOUTH_SUPPORT
agetty_SOURCES += lib/plymouth-ctrl.c
endif
if BSD
agetty_LDADD += -lutil
endif
+if HAVE_ECONF
+agetty_LDADD += -leconf
+endif
endif # BUILD_AGETTY
Do not print hints about Num, Caps and Scroll Locks.
*--nohostname*::
-By default the hostname will be printed. With this option enabled, no hostname at all will be shown.
+By default the hostname will be printed. With this option enabled, no hostname at all will be shown. This seeting is also possible to able by LOGIN_PLAIN_PROMPT option in the _/etc/login.defs_ configuration file (see below for more details).
*--long-hostname*::
By default the hostname is only printed until the first dot. With this option enabled, the fully qualified hostname by *gethostname*(3P) or (if not found) by *getaddrinfo*(3) is shown.
include::man-common/help-version.adoc[]
+== CONFIG FILE ITEMS
+*agetty* reads the _/etc/login.defs_ configuration file (see *login.defs*(5)).
+Note that the configuration file could be distributed with another package (usually shadow-utils).
+The following configuration items are relevant for *aggety*:
+
+*LOGIN_PLAIN_PROMPT* (boolean)::
+
+Tell *agetty* that printing the hostname should be suppressed in the login: prompt. This is an alternative to the *--nohostname* command line option. The default value is _no_.
+
== EXAMPLE
This section shows examples for the process field of an entry in the _/etc/inittab_ file. You'll have to prepend appropriate values for the other fields. See *inittab*(5) for more details.
#include <sys/socket.h>
#include <langinfo.h>
#include <grp.h>
+#include <pwd.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <ifaddrs.h>
#include "color-names.h"
#include "env.h"
+#include "logindefs.h"
+
#ifdef USE_PLYMOUTH_SUPPORT
# include "plymouth-ctrl.h"
#endif
if (options.flags & F_NOPROMPT) { /* --skip-login */
eval_issue_file(&issue, &options, &termios);
print_issue_file(&issue, &options, &termios);
+
} else { /* regular (auto)login */
+ if ((options.flags & F_NOHOSTNAME) == 0 &&
+ getlogindefs_bool("LOGIN_PLAIN_PROMPT", 0) == 1)
+ /* /etc/login.defs enbles --nohostname too */
+ options.flags |= F_NOHOSTNAME;
+
if (options.autolog) {
/* Autologin prompt */
eval_issue_file(&issue, &options, &termios);