Revert "Run zsh when starting screen" This reverts commit 68719720b5707d8f8e6e0b4b3569074ede06e285. See https://github.com/grml/grml-scripts/pull/15 + https://github.com/grml/grml/issues/135
Set SHELL variable in tty1 The SHELL variable is not set in our tty1 when `run-welcome` is called (instead of agetty(8) + login(1)). So, when invoking `screen` we end up in `/bin/sh` instead of a zsh shell. We also had the same problem for tty2 - tty4 and fixed it in grml/grml-live@6871972 (to fix grml/grml#14). We now use the same approach to fix tty1 although the SHELL variable should (most probably) be set in `run-welcome` and `run-screen` itself. Issue: grml/grml#135
ssh.service: avoid indirection via /bin/sh + do not run test mode in ExecStartPre There's no point in running ssh-keygen under /bin/sh, so let's drop this unnecessary indirection. Furthermore there shouldn't be any need to run `sshd -t` before starting the ssh daemon on the live system, as we definitely would like to get sshd started if it was requested to so, even if there might be a (possibly intermittent) problem with it. The test run makes sense for reloading an already running ssh daemon, and we keep this in place. Thanks to AndrĂ¡s Korn for spotting this
Enable serial-getty with root autologin on every given device With the kernel command line paramter / bootoption `console=device,options`[1](https://www.kernel.org/doc/html/latest/admin-guide/serial-console.html) it is possible to use a serial port as console. So far we only enabled root autologin for the serial port ttyS0, but it should be enabled on every given device as we do not have any password set for any user, which meant that no login was possible at all (on a serial port other than ttyS0). The serial port ttyS1 can be tested with QEMU/KVM like this:: kvm -m 512 -serial pty -serial pty -cdrom grml.iso This adds two serial ports (ttyS0 and ttyS1) to the VM and redirect its output to /dev/pts/*. On the Grml boot prompt then add "console=ttyS1" to redirect the output to second serial console. Thanks: @MichaelEischer for the bug report Closes: grml/grml#104
ssh service: set RuntimeDirectory=sshd to work with recent openssh versions We need to set RuntimeDirectory=sshd, otherwise /run/sshd doesn't exist and service startup fails with: | grml sshd[1845]: Missing privilege separation directory: /run/sshd While at it sync our ssh service file with Debian's openssh package 1:7.6p1-2 and drop the unused ssh-bootoption.service file (we currently start ssh service via grml-autoconfig). Also see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=864190 Closes grml/grml#80 Thanks: sl0n for bugreport Thanks: Darshaka Pathirana <dpat@grml.org> for feedback
Switch from grml-runtty to agetty also on tty11 + tty12 Closes grml/grml#14 now that grml-runtty is only used with non-systemd systems
Run zsh when starting screen When starting GNU/screen via systemd the SHELL varible is empty whereas SHELL=/bin/zsh when starting screen via grml-runtty. If we can assume that zsh is installed on Grml then this solution is ok. If not, we should address that in the run-screen script with something like: SHELL=/bin/sh [ -x /bin/zsh ] && SHELL=/bin/zsh # now run screen with config if [ `id -u` = 0 ] ; then exec screen -U -c /etc/grml/screenrc -s $SHELL [snip] (partly) fixes grml/grml#14
Get rid of grml-runtty What once was done by grml-runtty can be now be accomplished by systemd. That said, there is a weird behavior when starting GNU/screen via "run-screen". When started via grml-runtty screen runs zsh, but when started directly via systemd screen runs /bin/sh (= dash). The reason for that is, that the SHELL variable is empty when called directly via systemd whereas SHELL=/bin/zsh when started via grml-runtty. I could not figure out why but a solution would be to set the "Environment"-option in the systemd-unit which I will propose in a separate commit. (partly) fixes grml/grml#14
Switch from grml-runtty to agetty grml-runtty used to fix most of the pre-systemd environment problems. It seems that it causes more troubles nowadays than it solved back then. First and foremost grml-runtty does not provide a (systemd) login session which prevents us from starting X reliably. Therefor replacing grml-runtty with agetty with autologin where a grml-shell is used so far. tty1 to tty4, where grml-runtty starts run-welcome (grml-quickconfig), two root- and a grml-GNU-screen session, should also be replaced with a proper systemd-unit. Relates to grml/grml#14 and grml/grml#20
Provide consistent header information for all /etc/systemd/ files that are deployed via grml-live
TTY6/VT6 should start a shell if bootoption startx is not given When the bootoption "startx" is given, the helper-script "/etc/init.d/startx" is created during the bootprocess (via grml-autoconfig). That means, that if the booptions "startx" is not given, the helper-script is not created and tty6/vt6 should not try to start X but should just start a grml-user-shell. Related to grml/grml#20
Make startx boot option work with systemd The desired behavior (with systemd and the boot option "startx") is to start the X window system automatically. This is achieved by getty@tty6.service which starts grml-x as user "grml" on vt6/tty6 and switches back to vt1/tty1 after exit. (This alone could be achieved with systemd-unit option Type=oneshot and Restart=no). But when switiching back to vt6/tty6 (again) we would like to start a zsh (for user "grml") and restart the zsh if exited. That means that grml-x should only be started on the very first run and the zsh on every other. We could not figure out how to change the systemd-unit option "Type" dynamically, so we kept it on "idle" which means that the "actual execution of the service binary is delayed until all active jobs are dispatched". That's why we need to switch to vt6/tty6 (via grml-autoconfig) iff the boot option "startx" is given. We also do not know yet how to dynamically change the behavior of the systemd-unit in a safe way. Rewriting the unit-file (override.conf) after grml-x exits (i.e. with ExecStopPost) doesn't seem to work reliably (especially when calling "systemctl daemon-reload" in it). That's why we use a state-file (/var/run/grml_startx.started) to start up grml-x on the first call and the zsh else. This also means that grml-x is started automatically when switching to vt6/tty6 manually (when no "startx" boot option was given) once and the zsh on the following calls. Closes grml/grml#1
Provide new grml-boot.target With this new target we can now define which services are started on boot. Prior this target some services (without a systemd-service file) were automatically started because of the systemd-sysv-generator (i.e. ser2net). Thanks: Felipe Sateler Closes grml/release-planning#2 @ GH
Use ssh-keygen -A to generate host keys ssh-keygen -A (from manpage): For each of the key types (rsa1, rsa, dsa, ecdsa and ed25519) for which host keys do not exist, generate the host keys with the default key file path, an empty passphrase, default bits for the key type, and default comment. This is used by system administration scripts to generate new host keys.