Run zsh when starting screen
authorDarshaka Pathirana <dpat@syn-net.org>
Sun, 21 May 2017 17:56:58 +0000 (19:56 +0200)
committerMichael Prokop <mika@grml.org>
Wed, 24 May 2017 06:35:53 +0000 (08:35 +0200)
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

etc/grml/fai/config/files/etc/systemd/system/getty@tty2.service.d/override.conf/GRMLBASE
etc/grml/fai/config/files/etc/systemd/system/getty@tty3.service.d/override.conf/GRMLBASE
etc/grml/fai/config/files/etc/systemd/system/getty@tty4.service.d/override.conf/GRMLBASE

index 87b9e67..41761bd 100644 (file)
@@ -6,6 +6,7 @@ Restart=always
 StandardInput=tty
 StandardOutput=tty
 TTYPath=/dev/tty2
 StandardInput=tty
 StandardOutput=tty
 TTYPath=/dev/tty2
+Environment="SHELL=/bin/zsh"
 ExecStart=
 ExecStart=-/usr/share/grml-scripts/run-screen
 
 ExecStart=
 ExecStart=-/usr/share/grml-scripts/run-screen
 
index 786468e..072e055 100644 (file)
@@ -6,6 +6,7 @@ Restart=always
 StandardInput=tty
 StandardOutput=tty
 TTYPath=/dev/tty3
 StandardInput=tty
 StandardOutput=tty
 TTYPath=/dev/tty3
+Environment="SHELL=/bin/zsh"
 ExecStart=
 ExecStart=-/usr/share/grml-scripts/run-screen
 
 ExecStart=
 ExecStart=-/usr/share/grml-scripts/run-screen
 
index a94f83a..fcf42ef 100644 (file)
@@ -6,6 +6,7 @@ Restart=always
 StandardInput=tty
 StandardOutput=tty
 TTYPath=/dev/tty4
 StandardInput=tty
 StandardOutput=tty
 TTYPath=/dev/tty4
+Environment="SHELL=/bin/zsh"
 User=$USERNAME
 ExecStart=
 ExecStart=-/usr/share/grml-scripts/run-screen
 User=$USERNAME
 ExecStart=
 ExecStart=-/usr/share/grml-scripts/run-screen