5

I'm trying to enable [email protected] to output getty to serial console as well as tty0.

I have tried running systemctl enable serial-getty@ttyS0 but I suspect that systemd might not be running when late_command is running.

Then I tried making the symlink manually with ln -s /lib/systemd/system/[email protected] /etc/systemd/system/getty.target.wants/[email protected] and after the install getty.target.wants only contains [email protected].

I can't use console=tty0 console=ttyS0,115200n8 kernel parameter because then messages from the init system and the system logger will only appear on the first serial port and I want them to appear on tty0.

I'm using in-target with late_command.

Example:

d-i preseed/late_command string in-target \
    ln -s /lib/systemd/system/[email protected] \
    /etc/systemd/system/getty.target.wants/[email protected]‌​rvice

Does anyone have any experience or any idea on how to enable services in preseed config?

tshepang
  • 64,472
  • 86
  • 223
  • 290
granra
  • 151
  • 2
  • `systemctl enable` does not require systemd to be running. You can verify if the command worked (or not) just by looking for the symlink in `/etc/systemd/system/getty.target.wants/`. If it's there and things are not working, your problem is something else. – larsks Aug 29 '16 at 16:04
  • There's only [email protected] in `/etc/systemd/system/getty.target.wants/`after `d-i preseed/late_command string in-target systemctl enable serial-getty@ttyS0` – granra Aug 29 '16 at 19:21
  • 1
    Looks like cloud-init is disabling serial-getty@ttyS0 for some reason. If I don't install cloud-init it seems to work. – granra Aug 30 '16 at 13:00

0 Answers0