Mailinglist Archive: opensuse (1239 mails)

< Previous Next >
Re: [opensuse] systemd: What is the proper manner to print a message to the screen from a service file?
  • From: "Carlos E. R." <robin.listas@xxxxxxxxxxxxxx>
  • Date: Sun, 16 Jun 2013 20:49:34 +0200 (CEST)
  • Message-id: <alpine.LNX.2.00.1306162032110.16617@Telcontar.valinor>
Hash: SHA1

On Sunday, 2013-06-16 at 14:29 -0400, Cristian Rodríguez wrote:
El 16/06/13 14:21, Carlos E. R. escribió:

I do not want to execute anything by hand. I want just to look at my
screen be told if there is something to see. Just tell me how to print
the output of a command on the screen, please, from inside a service file.

You are trying to solve a problem the weirdest and arcanest way possible!

I'm simply customising my system to my tastes, as simple as that. :-)

If you want to see "failed" or "sucess" of services like you did in sysvinit at boot in tty1 remove "quiet" from the boot command line.

I have that removed since days, that's not it. I want a summary at the end of the boot; to be exact, the output of a command.

Otherwise please read the documentation, man page systemd.exec , option StandardOutput, yoiu can send the output to a tty/syslog/journal etc.

It works, thanks :-)

Ok, I have:

Telcontar:~ # cat /etc/systemd/system/helloworld.service
Name=Plays a welcome sound when target multi-user is reached
# -


Telcontar:~ #

Telcontar:~ # cat /usr/local/bin/helloworld
# -x
# Author: Carlos E. R.
# Supersedes /etc/init.d/helloworld
# called from /etc/systemd/system/helloworld.service

cat /usr/share/sounds/au/ > /dev/audio &
/bin/logger -t Mine -p "Saying hello world"

#Does not print - it does on syslog, not to terminal.
grep FAILED /var/log/boot.log
Telcontar:~ #

It plays that cute sound file, and echoes the failed list to tty1, just what I want, at the end of the boot sequence.

- -- Cheers,
Carlos E. R.
(from 12.3 x86_64 "Dartmouth" at Telcontar)
Version: GnuPG v2.0.19 (GNU/Linux)

< Previous Next >
Follow Ups