How to show own welcome message during boot with lolcat, Debian 8 (and systemd)?

2

1

I would like to run this command in boot time:

/usr/games/lolcat /home/decker/file-with-text-content

This command prints "colored" content of /home/decker/test text file.So it would be something like welcome message during bootup process.

Tested this command when logged in in terminal.

I tried following, but nothing works:

  1. added "/usr/games/lolcat /home/decker/test" to /etc/rc.local
  2. created systemd service that should start this in boot time. (and was successfuly started, but I did not see colored content...)
  3. (very) desperately added "/usr/games/lolcat /home/decker/test" to /etc/init.d/procps. I was very desperate...

Tried with and without "quite" kernel boot arg.

Back in my days, when no systemd was here, this was simple. I have no idea what to do now.

In ideal world, I would like to place it after fsck messages while using "quite" kernel boot arg. (So there would be only messages with booting kernel name, fsck and colored welcome message). I dont want to use plymouth.

EDIT: So, thanks again for answers guys. We moved forward, but still no go. No rainbows. I added 3 mentioned lines to journalctl.conf. There is everything else commented out, so these 3 lines are there "alone". Then I added 2 mentioned lines to my unit. Content of my unit is:

[Unit]
Description=Peace Unicorn

[Service]
Type=simple
ExecStart=/bin/cat /home/decker/test5
StandardOutput=tty-force
TTYPath=/dev/tty12

[Install]
WantedBy=multi-user.target

When I restarted system, systemd printed this error:

[    4.817429] systemd[1]: [/etc/systemd/system/unicorn.service:7] Failed to parse output specifier, ignoring: tty-force

7th line is this: StandardOutput=tty-force. I tried to change it to "tty" only, but that did not printed anything.

Also I changed to "/bin/cat" from "lolcat" to focus on systemd problem for now.

Askmeanything

Posted 2015-04-05T22:28:03.297

Reputation: 33

Answers

2

Your rainbows are being sent to journalctl, which manages stderr and stdout for all systemd units. If you want to enable tty output for a single unit, add this under your unit's [Service] section

StandardOutput=journal+console
TTYPath=/dev/tty12

This won't preserve any formatting codes, such as colors and extra spaces

Source

Outurnate

Posted 2015-04-05T22:28:03.297

Reputation: 138

1It is far better, surely, to simply adjust the standard output and error settings of the relevant unit so that they don't go through the journal in the first place, rather than change how all journalling is handled system-wide just for one thing? – JdeBP – 2015-04-06T01:03:07.880

Would be, yes, but that's provided there's a unit created. In the question, output from /etc/rc.local was going to journalctl as well. While the proper way is with a unit, I'm assuming the asker wants to duplicate the pre-systemd style boot – Outurnate – 2015-04-06T02:14:07.833

You've missed item #2 of the question. – JdeBP – 2015-04-06T10:00:44.890

Hrrm, still no go, but we are moving. I have edited the question with latest results. – Askmeanything – 2015-04-07T23:07:21.360

Updated the answer. Try it again. Seems I don't know systemd as well as I thought. – Outurnate – 2015-04-07T23:13:23.443

awesome! That worked! Thank you for leading me throught this! Few things - 1)when both files (unit's [Service] section and journactl.conf) are enhanced by your advice, it does not work. I deleted "your" 3 lines from journal.conf and it started working. But I suppose I should not use both files - just mentioning this for others. 2) my unit is started too late. For one minute there is black screen with kernel and fsck and my text shows up only for a half of a second at the end, then X server is started. Tried to do some "Before=" magic, but I was unsuccessful. Is there a way to start sooner? – Askmeanything – 2015-04-08T21:26:44.723

...and 3) output from lolcat is the same as from cat. No colors. No rainbow. No unicorns. It simply looks like systemd do not know colors or do not accept them. Or, systemd adds "lolcat[pid]:" to every line and it loses its color and formating (yes, my ASCII drawing loses some formating, so it is not "clean" or "direct" output from script). I repaired formating, but not colors. :( – Askmeanything – 2015-04-08T21:37:14.040

Should I make a new question for 2 and 3? I am new here. – Askmeanything – 2015-04-09T20:35:38.197

I'll update the answer with that info. I would suggest making a new question for 2/3, as those are more related to customizing output – Outurnate – 2015-04-09T22:47:06.523

OK, thank you very much. You have helped me a lot! – Askmeanything – 2015-04-11T10:45:49.157

Alright. Unfortunately, I don't know the answers to the other two. Hopefully someone else will have an answer – Outurnate – 2015-04-16T21:22:22.453