rc.local output does not go to console

Bug #1468102 reported by Scott Moser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Fix Released
Low
Martin Pitt

Bug Description

provided is user-data that should write:
[stdout] Tue, 23 Jun 2015 20:17:52 +0000 ====== successfull boot 1 =======

to the console on the first boot.

currently in wily, rc.local's output is not being written to the console, so you wont see this.

Note, that because of bug 1468103, you wont see it on first boot. If this bug were fixed then you'd see it on reboots.

Related bugs:
 * bug 1468103: rc.local runs too early.

ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: systemd 220-7ubuntu1
ProcVersionSignature: User Name 3.19.0-22.22-generic 3.19.8-ckt1
Uname: Linux 3.19.0-22-generic x86_64
ApportVersion: 2.17.3-0ubuntu4
Architecture: amd64
Date: Tue Jun 23 20:26:30 2015
Ec2AMI: ami-00000434
Ec2AMIManifest: FIXME
Ec2AvailabilityZone: nova
Ec2InstanceType: m1.small
Ec2Kernel: aki-00000002
Ec2Ramdisk: ari-00000002
Lsusb: Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
MachineType: OpenStack Foundation OpenStack Nova
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.19.0-22-generic root=LABEL=cloudimg-rootfs ro console=tty1 console=ttyS0
SourcePackage: systemd
UdevLog: Error: [Errno 2] No such file or directory: '/var/log/udev'
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 01/01/2011
dmi.bios.vendor: Bochs
dmi.bios.version: Bochs
dmi.chassis.type: 1
dmi.chassis.vendor: Bochs
dmi.modalias: dmi:bvnBochs:bvrBochs:bd01/01/2011:svnOpenStackFoundation:pnOpenStackNova:pvr2014.1.4:cvnBochs:ct1:cvr:
dmi.product.name: OpenStack Nova
dmi.product.version: 2014.1.4
dmi.sys.vendor: OpenStack Foundation

Revision history for this message
Scott Moser (smoser) wrote :
description: updated
Changed in systemd (Ubuntu):
status: New → Confirmed
Scott Moser (smoser)
description: updated
Revision history for this message
Martin Pitt (pitti) wrote :

So the gist of this is that rc.local writes to /dev/console but you don't see this? I added this to /etc/rc.local on a normal installation:

echo hello_stdout
echo hello_console > /dev/console

and "systemctl start rc-local.service" does print the hello_console on the console (you need to run it on a VT, you won't see it in X), and the hello_stdout goes to the journal. So apparently I'm missing something.

How do you test this exactly? Some OpenStack instance, and nova console-log? Local VM? something else?

Changed in systemd (Ubuntu):
importance: Undecided → High
Martin Pitt (pitti)
Changed in systemd (Ubuntu):
importance: High → Low
Revision history for this message
Scott Moser (smoser) wrote :

you can test easily enough on a local vm.
previously output of things run in rc.local went to wherever /dev/console went.

that meant if you ran 'echo hello world' from rc.local when 'console=ttyS0' on the kernel command line, you'd dsee 'hello world' on the serial console.

this is important to maintain for automated testing and I would suspect for real world use cases where people write some human friendly status or information from /etc/rc.local.

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

Ah, understood. I was misled as your userdata explicitly sends output to /dev/console (or whatever you configured). This can be done with Standard{Output,Error}=journal+console.

Changed in systemd (Ubuntu):
status: Confirmed → Triaged
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Martin Pitt (pitti) wrote :
Changed in systemd (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (5.6 KiB)

This bug was fixed in the package systemd - 221-1ubuntu2

---------------
systemd (221-1ubuntu2) wily; urgency=medium

  * Disable test-netlink during package build, fails on some buildds.

systemd (221-1ubuntu1) wily; urgency=medium

  * Merge with Debian unstable. Remaining Ubuntu changes:
    - Hack to support system-image read-only /etc, and modify files in
      /etc/writable/ instead.
    - Keep our much simpler udev maintainer scripts (all platforms must
      support udev, no debconf).
    - initramfs init-top: Drop scsi_wait_scan and udevadm settle, we do that
      in a more sensible way with wait-for-root.
    - initramfs init-bottom: If LVM is installed, settle udev,
      otherwise we get missing LV symlinks. Workaround for LP #1185394.
    - Add debian/udev.lvm2.init: Dummy SysV init script to satisfy insserv
      dependencies to "lvm2" which is handled with udev rules in Ubuntu.
    - Add debian/udev.lvm2.service to avoid running the dummy lvm2 init
      script.
    - Provide shutdown fallback for upstart. (LP: #1370329)
    - debian/extra/ifup@.service: Additionally run for "auto" class. We don't
      really support "allow-hotplug" in Ubuntu at the moment, so we need to
      deal with "auto" devices appearing after "/etc/init.d/networking start"
      already ran. (LP: #1374521) Also run ifup in the background during boot,
      to avoid blocking network.target. (LP: #1425376)
    - ifup@.service: Drop dependency on networking.service (i. e.
      /etc/init.d/networking), and merely ensure that /run/network exists.
      This avoids unnecessary dependencies/waiting during boot and dependency
      cycles if hooks wait for other interfaces to come up (like ifenslave
      with bonding interfaces). (LP: #1414544)
    - Add Get-RTC-is-in-local-time-setting-from-etc-default-rc.patch: In
      Ubuntu we currently keep the setting whether the RTC is in local or UTC
      time in /etc/default/rcS "UTC=yes|no", instead of /etc/adjtime.
      (LP: #1377258)
    - Put session scopes into all cgroup controllers. This makes unprivileged
      user LXC containers work under systemd. (LP: #1346734)
    - systemctl: Don't forward telinit u to upstart. This works around
      upstart's Restart() always reexec'ing /sbin/init on Restart(), even if
      that changes to point to systemd during the upgrade. This avoids running
      systemd during a dist-upgrade. (LP: #1430479)
    - Drop hwdb-update dependency from udev-trigger.service, which got
      introduced in v219-stable. This causes udev and plymouth to start too
      late and isn't really needed in Ubuntu yet as we don't support stateless
      systems yet and handle hwdb.bin updates through dpkg triggers. This can
      be dropped again with initramfs-tools 0.117.
    - Lower Breaks: to plymouth version which has the udev inotify fix in
      Ubuntu.
    - Lower apparmor Breaks: to the Ubuntu version that dropped $remote_fs.
    - Change systemd-sysv's conflicts to upstart-sysv. (LP: #1422681)

    Upgrade fixes, keep until 16.04 LTS release:
    - systemd Conflicts/Replaces/Provides systemd-services.
    - Remove obsolete systemd-logind upstart job.
    - Clean up obsolete /etc/u...

Read more...

Changed in systemd (Ubuntu):
status: Fix Committed → Fix Released
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.