$TERM is not set for /etc/rc.local

Bug #1624967 reported by Removed by request
6
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I'm using Ubuntu 16.10 dev with systemd 231-6 and after upgrading from upstart to systemd I'm noticing that a setterm command fails that I have put into /etc/rc.local in the past (to make specific settings on the console without requiring a login). On making a look at this I figured out that $TERM is not set at default anymore and maybe it makes sense to set it at default again.

Revision history for this message
Martin Pitt (pitti) wrote :

$TERM only gets set for units which have Standard{Output,Error}=tty. By default services only have a stdout/err pipe to the journal, and rc-local.service uses journal+console which is still a pipe. So it would be actively wrong to set $TERM there as it is not actually a terminal. (See man systemd.exec).

You can create your own unit with Standard{Output,Error}=tty and a setterm call, of course.

Changed in systemd (Ubuntu):
status: New → Invalid
Revision history for this message
Removed by request (removed3425744) wrote :

But causing some output for example with echo in /etc/rc.local causes it to be written on the console on booting. Or is this the expected behavior even if the journal is used?

Revision history for this message
Martin Pitt (pitti) wrote : Re: [Bug 1624967] Re: $TERM is not set for /etc/rc.local

Sworddragon [2016-09-19 6:52 -0000]:
> But causing some output for example with echo in /etc/rc.local causes it
> to be written on the console on booting. Or is this the expected
> behavior even if the journal is used?

It's what "journal+console" does, yes -- it's similar to "tee".

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.