I have a custom systemd service that runs during the first boot.

If the user has no bootsplash I would like to write to the console and give some info on what's going on. Is there a way to do that from my service?

Here's my systemd service:

Description=Prepare operator after installation
Before=getty@tty1.service getty@tty2.service getty@rrt3.service getty@tty4.service getty@tty5.service getty@tty6.service
After=network.target network-online.target


  • selinux-autorelabel.service does this with StandardInput=tty [sic], but I don't know how it works if you do have a bootsplash. – sourcejedi Mar 17 '17 at 15:11

In man systemd.directives, you can search for "output" and find that StandardOutput= is documented in in man systemd.exec. There you can find options including journal+console to send output to the systemd Journal and the system console. You might also try kmsg+console. According to the docs kmsg "connects standard output with the kernel log buffer which is accessible via dmesg(1),"

| improve this answer | |

I did it like this. I don't have a login prompt in tty1. So it does not show MOTD out of the box.

ExecStartPre=/bin/sleep 10
ExecStart=-/bin/cat /etc/motd

Where oneshot says: exec only once. Restart=no requirement of oneshot. Not sure why there are two ExecStart and why "-", this was copy and paste. I added After= / ExecStartPre= because the message did not show up, probably screen was cleared by someone else. So it should be after target "login prompt".

Disclaimer: Use this answer as a collection of ideas. I didn't want them to get lost. Do your own research if you have any questions and feel free to contribute your findings.

This was done on Debian stretch w/o X.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.