Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch from /sbin/grml-runtty to /sbin/agetty #14

Closed
mika opened this issue Apr 7, 2017 · 0 comments · Fixed by grml/grml-live#122
Closed

switch from /sbin/grml-runtty to /sbin/agetty #14

mika opened this issue Apr 7, 2017 · 0 comments · Fixed by grml/grml-live#122
Labels
enhancement help-wanted Lack of resources, please contribute if it's important for you

Comments

@mika
Copy link
Member

mika commented Apr 7, 2017

Get rid of our custom historic™ workarounds™. Not a release blocker for our upcoming stable release though, JFTR.

@mika mika added this to the Grml 2017.11 milestone Apr 21, 2017
@mika mika added enhancement help-wanted Lack of resources, please contribute if it's important for you labels May 10, 2017
jkirk added a commit to jkirk/grml-live that referenced this issue May 20, 2017
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
jkirk added a commit to jkirk/grml-live that referenced this issue May 20, 2017
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
jkirk added a commit to jkirk/grml-live that referenced this issue May 21, 2017
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
jkirk added a commit to jkirk/grml-live that referenced this issue May 21, 2017
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
mika pushed a commit to grml/grml-live that referenced this issue May 24, 2017
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
mika added a commit to grml/grml-live that referenced this issue May 24, 2017
Closes grml/grml#14 now that grml-runtty is only used with non-systemd systems
@mika mika removed this from the Grml 2017.12 milestone Nov 17, 2017
jkirk added a commit to jkirk/grml-live that referenced this issue Nov 11, 2022
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
jkirk added a commit to jkirk/grml-scripts that referenced this issue Nov 13, 2022
By default login(1) is called by agetty(8) and sets the SHELL variable
"according to the appropriate fields in the password entry".

Our tty1 calls run-welcome, tty2 - tty4 call run-screen and tty5 - tty7 call
agetty (with autologin grml). So, our tty1 - tty4 bypass agetty(8) + login(1)
and (should) end in a the zsh shell (via the welcome-screen or GNU/screen)
without the SHELL variable set.

run-welcome is designed to be started (only) on tty(1) and starts zsh anyway.
But as we bypass login(1) the SHELL variable is not set.
The same is true for run-screen, but instead of starting the zsh as
login-shell, `screen` is called and runs the shell defined by the SHELL
variable or /bin/sh if not defined.

So, we ended up using the systemd "Environment"-option to set the SHELL
variable (grml/grml-live@6871972 + grml/grml-live@7422d31).
Although this is a working solution, setting the SHELL variable in run-welcome
+ run-screen makes it more transparent, that the script is actually responsible
to set the SHELL variable.

While debugging this problem, also noticed that screen should start the shell
as login-shell (like all other ttys). To do so the given shell command needs to
be prefixed with the '-' character.

grml/grml-live@6871972 + grml/grml-live@7422d31 can/should be reverted
after this change has been applied.

Issues: grml/grml#135 + grml/grml#14
clexanis pushed a commit to clexanis/grml-build that referenced this issue Dec 12, 2022
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement help-wanted Lack of resources, please contribute if it's important for you
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant