2

When using Ubuntu 14.04, I used to have a custom /etc/init/tty2.conf that started a program in this virtual terminal. But after upgrade to Ubuntu 16.04, these files seem to be ignored. Regardless of my modifications, virtual terminal ends up running getty after boot.

I understand that Ubuntu 16.04 includes a systemd side by side with upstart subsystem. But since /etc/init/tty?.conf files are present by default in an installed system, I'd expect them to be respected.

Should I enable some systemd service to restore old behaviour (like it is done for /etc/rc.local)?

2 Answers 2

2

I understand that Ubuntu 16.04 includes a systemd side by side with upstart subsystem.

The only role of Upstart in a default 16.04 is for user sessions. It has nothing to do with system init, which is entirely handled by systemd. It might be possible to force Upstart to be init, but it is not supported.

The /etc/init/*.conf are therefore ignored (and are probably just residual files). If you want to configure TTY2, you'll have to edit systemd services. See my posts in How to create ubuntu server 16.04 autologin? and How do I override or configure systemd services?

2
  • so is the presence of /etc/init/*.conf files a bug since they are silently ignored?
    – Dmitriusan
    Apr 20, 2018 at 13:52
  • @Dmitriusan meh, nope. You'll find that many packages provide at least two out of (systemd, upstart, sysv) init files, and that means one of them gets ignored anyway.
    – muru
    Apr 20, 2018 at 14:40
1

Thanks to instructions at accepted answer, accomplished my target with /etc/systemd/system/[email protected]/override.conf

[Unit]
Description=Vim for notes on %I

[Install]
WantedBy=graphical.target


[Service]
User=my_user
Group=my_group
ExecStart=
ExecStart=/bin/bash -lc '/usr/bin/vim /media/notes/note_`LC_ALL=us_US.utf8 /bin/date "+%%b%%g"`'
StandardInput=tty-force
StandardOutput=inherit
StandardError=inherit

Caveats:

  • had to escape % as %%, otherwise they have been replaced by systemd variables

  • did not get input/output streams without Standard* statements at [Service]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .