#661 Issue closed: remove mingetty from dependency list

Labels: cleanup, fixed / solved / done

gdha opened issue at 2015-09-25 17:49:

mingetty is no longer a dependency for rear as it uses agetty if it finds it.

schlomo commented at 2015-10-17 18:00:

See http://pikachu.3ti.be/pipermail/rear-users/2015-October/003223.html for a user report who had to manually install mingetty on Ubuntu.

Maybe we should keep mingetty as a dependency? Or add it to REQUIRED_PROGS on those systems that need mingetty? Or somehow make sure that at least one of the supported *getty progs is available?

gdha commented at 2015-10-19 07:06:

@schlomo I opt for the last option - will review the code in the coming days

gdha commented at 2015-10-19 08:41:

The following files/scripts contain references to mingetty:

skel/default/etc/inittab
skel/default/etc/event.d/tty2
skel/default/etc/event.d/tty5
skel/default/etc/event.d/tty4
skel/default/etc/event.d/tty1
skel/default/etc/event.d/tty3
skel/default/etc/init/tty.conf
skel/Linux-ppc64/etc/inittab
rescue/GNU/Linux/41_use_xen_console.sh

Perhaps we should produce an (more) intelligent prep script which indenties if the Linux system still uses mingetty as primary tty program and if that is the case add it to REQUIRED_PROGS?
Otherwise, agetty would do.

schlomo commented at 2015-10-19 09:15:

+1 for the intelligent prep script.

mmitsugi commented at 2015-10-20 06:59:

Hi @gdha
This change breaks RHEL ppc64 platform...
Here is the grep "getty " result in ppc64. It also hit agetty.

# ps ax | grep "getty " | grep -v grep
  872 hvc0     Ss+    0:00 /sbin/agetty --keep-baud 115200 38400 9600 hvc0
25820 tty1     Ss+    0:00 /sbin/agetty --noclear tty1

So could you please change the search word of getty, maybe "/getty" ??

gdha commented at 2015-10-20 07:18:

@mmitsugi great catch - thanks - corrected it (hopefully correct this time)

gdha commented at 2015-10-30 20:42:

Checked if new script 45_symlink_mingetty.sh did work:
lrwxrwxrwx. 1 root root 6 Oct 30 21:30 mingetty -> agetty (yes it does). We are good now to remobe mingetty from the rear.spec file

mmitsugi commented at 2015-11-03 07:38:

@gdha @schlomo

I tested the latest code with Ubuntu 14.04.2 ppc64le and Ubuntu 15.04 ppc64le.
And as a result,

  • 15.04 is using systemd and there is no mingetty dependency in rear iso. It works well without mingetty.
  • 14.04.2 is using upstart and there is mingetty dependency in rear iso.
    As @schlomo mentioned: http://pikachu.3ti.be/pipermail/rear-users/2015-October/003223.html
    upstart is using skel/default/etc/init/tty.conf and there is mingetty call in it.
    So, it doesn't work well without mingetty.
  • As far as I know RHEL6 is also using upstart, so rear iso for RHEL6 also needs mingetty.

There are 2 options to fix the above problems:
option 1: change rpm spec and deb control to check distro version and add dependency of mingetty if needed. Add mingetty dependency if it's RHEL6 or Ubuntu 14.04

  • we can keep using mingetty for upstart distribution.
    option 2: change upstart tty.conf not to use mingetty
  • console will be changed from mingetty to others for upstart distribution
  • default terminal of each distro seems to be: RHEL6 -> agetty / Ubuntu 14.04 -> getty

Both changes needs a little bit ugly distro switching code in spec/deb control file or tty.conf.
Let's discuss how to fix the above problem and let me know if you have better option.

gdha commented at 2015-11-03 18:44:

@mmitsugi there should be a symlink toward mingetty from (a)getty. Was it missing?

mmitsugi commented at 2015-11-04 06:31:

@gdha thanks for quick reply. In tty.conf, mingetty is called with mingetty unique parameter... So, we should consider which options in the above is taken.

gdha commented at 2015-11-04 08:47:

@mmitsugi Could you try if you change the line in ./skel/default/etc/init/tty.conf file from:

exec /exec /sbin/mingetty --noclear --autologin root $TTY

into

exec /sbin/mingetty  $TTY

What the effect is?

mmitsugi commented at 2015-11-06 03:32:

@gdha as far as I tried,

  • getty and agetty needs parameter
  • getty and agetty are parameter compatible
  • mingetty parameter is not compatible with that of getty/aggetty

So, I added the fix like following and it works fine so far.

respawn
instance $TTY

script
    if [ ! -L /sbin/mingetty ]; then
        exec /sbin/mingetty --noclear --autologin root $TTY
    else
        if [ "$TTY" == "/dev/xvc0" ||
             "$TTY" == "/dev/hvc0" ||
             "$TTY" == "/dev/hvsi0" ]; then
            exec /sbin/mingetty -L ${TTY#/dev/} 9600 vt100
        else
            exec /sbin/mingetty -8 38400 ${TTY#/dev}
        fi
    fi
end script

[Export of Github issue for rear/rear.]