Mailinglist Archive: opensuse (1239 mails)

< Previous Next >
[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 15:48:30 +0200 (CEST)
  • Message-id: <alpine.LNX.2.00.1306161543120.7538@Telcontar.valinor>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



I have:

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

[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=-/usr/local/bin/helloworld

[Install]
WantedBy=multi-user.target
Telcontar:~


which runs this script:

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

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

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



The script runs, but the output of grep goes to syslog; I want it to got to the terminal (tty1, actually), in order to see at a glance which services failed to start (this was something that systemv did).


- -- Cheers

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

iEYEARECAAYFAlG9wi4ACgkQtTMYHG2NR9Wa5QCfWlfYRhciB0z3gTw0qnAgRrs9
NIIAoI3dPsSHI5g5NurqolGas+OW9bFV
=5XAR
-----END PGP SIGNATURE-----
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >