summaryrefslogtreecommitdiff
path: root/src/getty-generator
AgeCommit message (Collapse)Author
2015-02-03util: rework strappenda(), and rename it strjoina()Lennart Poettering
After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
2014-11-28treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt
If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
2014-08-13util: allow strappenda to take any number of argsDave Reisner
This makes strappenda3 redundant, so we remove its usage and definition. Add a few tests along the way for sanity.
2014-07-31Reject invalid quoted stringsZbigniew Jędrzejewski-Szmek
String which ended in an unfinished quote were accepted, potentially with bad memory accesses. Reject anything which ends in a unfished quote, or contains non-whitespace characters right after the closing quote. _FOREACH_WORD now returns the invalid character in *state. But this return value is not checked anywhere yet. Also, make 'word' and 'state' variables const pointers, and rename 'w' to 'word' in various places. Things are easier to read if the same name is used consistently. mbiebl_> am I correct that something like this doesn't work mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-passwd "Unlock EncFS"' mbiebl_> systemd seems to strip of the quotes mbiebl_> systemctl status shows mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-password Unlock EncFS $RootDir $MountPoint mbiebl_> which is pretty weird
2014-06-19getty-generator: properly escape instance namesZbigniew Jędrzejewski-Szmek
Otherwise the add_symlink() function tries to make directories for each slash even for the slash after the @ symbol in the final link name, failing for /dev/3270/tty1. Based on a patch by Werner Fink <werner@suse.de>.
2014-06-19getty-generator: use strappendaZbigniew Jędrzejewski-Szmek
Allocating on the stack should be fine for the fixed number of items.
2014-03-13getty: Start getty on 3270 terminals available on Linux on System zHendrik Brueckner
Add the first 3270 terminal device that is associated with the Linux preferred console to the list of virtualization consoles. This is required to automatically start a getty if the conmode=3270 kernel parameter is specified for Linux on z/VM instances. Note that a queued upstream patch also enable the 3270 terminal device if it is associated with the Linux preferred console. How To successfully start agetty on a 3270 terminal, a change in the agetty parameter order is required. Previously, agetty would started like this: /sbin/agetty --keep-baud 3270/tty1 115200,38400,9600 TERM The agetty program interprets the "3270/tty1" as baud rate and fails to start with the "bad speed: 3270/tty1" error message. Fixing this in agetty is more complex rather than reordering the command line parameters like this: /sbin/agetty --keep-baud 115200,38400,9600 3270/tty1 TERM According to agetty sources and "agetty --help", agetty accepts the "tty", "baudrate tty", and "tty baudrate" specifications. P.S. The "tty: Set correct tty name in 'active' sysfs attribute" introduces a change to display the terminal device which is associated with the Linux preferred console. This change helps to let systemd handle this particular case only. Without the changes of this commit, no additional 3270 terminal device can be managed by systemd. https://git.kernel.org/cgit/linux/kernel/git/gregkh/tty.git/commit/?id=723abd87f6e536f1353c8f64f621520bc29523a3
2014-02-24getty-generator: verify ttys before we make use of themLennart Poettering
The ttyS[0-3] devices are weird. They may be enumerated, but when one actually tries to open and use them they return EIO, because they don't actually exist. Because they may be enumerated they may be specified on the kernel command line as console=. And some people do that as default. As response to that we'll spawn a getty on the tty that will quickly fail, and we retry a couple of time before giving up. That is quite noisy. With this new change we will validate all serial terminals configured with console= on the kernel cmdline before adding gettys on them, and remove the invalid ones. THis should remove the noise later on. This should make Eric Paris happy!
2014-01-31s390/getty-generator: initialize essential system terminals/consolesHendrik Brueckner
Ensure to start getty programs on all essential system consoles on Linux on System z. Add these essential devices to the list of virtualization_consoles to always generate getty configurations. For the sake of completion, the list of essential consoles is: /dev/sclp_line0 - Operating system messages applet (LPAR) /dev/ttysclp0 - Integrated ASCII console applet (z/VM and LPAR) /dev/ttyS0 - Already handled by systemd (3215 console on z/VM) /dev/hvc0 - Already handled by systemd (IUCV HVC terminal on z/VM) Depending on the environment, z/VM or LPAR, only a subset of these terminals are available. See also RH BZ 860158[1] "Cannot login via Operating System Console into RHEL7 instance installed on a LPAR". This bugzilla actually blocks the installation of Linux on System z instances in LPAR mode. [1] https://bugzilla.redhat.com/show_bug.cgi?id=860158
2013-12-13getty-generator: fix stripping /dev/Thomas Hindoe Paaboel Andersen
2013-12-13getty-generator: fix segfault when $container_ttys is not setLennart Poettering
2013-12-13getty-generator: look add an environment variable $container_ttys set for ↵Lennart Poettering
PID 1 and start gettys on all ttys listed therein
2013-10-31getty-generator: modernizationsLennart Poettering
2013-09-12getty-generator: Enable getty on all active serial consoles.Michael Marineau
This enables a getty on active kernel consoles even when they are not the last one specified on the kernel command line and mapped to /dev/console. Now the order "console=ttyS0 console=tty0" works in addition to "console=tty0 console=ttyS0".
2013-04-24Standarize on one spelling of symlink error messageZbigniew Jędrzejewski-Szmek
It's polite to print the name of the link that wasn't created, and it makes little sense to print the target.
2013-02-14honor SELinux labels, when creating and writing config filesHarald Hoyer
Also split out some fileio functions to fileio.c and provide a SELinux aware pendant in fileio-label.c see https://bugzilla.redhat.com/show_bug.cgi?id=881577
2012-12-02getty-generator: fix handling systems without a consoleDavid Herrmann
If the system does not have any active console, we should not try to create an empty symlink. Instead, create no symlink at all. Otherwise, on systems with CONFIG_VT=n and no serial console, we will create a symlink with an empty template parameter.
2012-07-26log.h: new log_oom() -> int -ENOMEM, use itShawn Landden
also a number of minor fixups and bug fixes: spelling, oom errors that didn't print errors, not properly forwarding error codes, few more consistency issues, et cetera
2012-07-25use "Out of memory." consistantly (or with "\n")Shawn Landden
glibc/glib both use "out of memory" consistantly so maybe we should consider that instead of this. Eliminates one string out of a number of binaries. Also fixes extra newline in udev/scsi_id
2012-07-13util: rename join() to strjoin()Lennart Poettering
This is to match strappend() and the other string related functions.
2012-05-31mkdir: append _label to all mkdir() calls that explicitly set the selinux ↵Kay Sievers
context
2012-05-23manager: rework generator logicLennart Poettering
Previously generated units were always placed at the end of the search path. With this change there will be three unit dirs instead of one, to place generated entries at the beginning, in the middle and at the end of the search path: beginning: for units that need to override all configuration, regardless of user or vendor. Example use: system-update-generator uses this to temporarily redirect default.target. middle: for units that need to override vendor configuration, but not vendor configuration. Example use: /etc/fstab should override vendor supplied configuration (think /tmp), but should not override native user configuration. end: does not override anything but is available as well. Possible usage might be to convert D-Bus bus service files to native units but allowing vendor supplied native units to win.
2012-05-22log: make sure generators never log into the journal to avoid activation ↵Lennart Poettering
deadlocks This makes all generators log to kmsg by default.
2012-04-22container: spawn a getty instead of a sulogin in a containerLennart Poettering
2012-04-13build-sys: add stub makefiles to all subdirs to ease development with emacsLennart Poettering
2012-04-12move all tools to subdirsKay Sievers