Hello, I am trying to figure out a way to output some information to the console (system boots to runlevel 3) from an init script.
Here is what I've tried: add echo "$SOMEINFO" into the init script and pipe it to wall, and put that in the init script.
This doesn't seem to work, I was thinking of outputting to motd to achieve this, but wondered if anyone knows a better way. Perhaps using the at command?
On 11/29/2010 11:42 AM, msacks wrote:
Hello, I am trying to figure out a way to output some information to the console (system boots to runlevel 3) from an init script.
Here is what I've tried: add echo "$SOMEINFO" into the init script and pipe it to wall, and put that in the init script.
This doesn't seem to work, I was thinking of outputting to motd to achieve this, but wondered if anyone knows a better way. Perhaps using the at command?
Er, make sure you have a rule in your /etc/rsyslog.conf that outputs to the console, then use logger(1) to send the message, e.g.:
(in /etc/rsyslog.conf:)
local5.* /dev/console
(in script:)
logger -p local5.info This is message text
should result in
date-time hostname root: This is message text
on the console. ---------------------------------------------------------------------- - Rick Stevens, Systems Engineer, C2 Hosting ricks@nerd.com - - AIM/Skype: therps2 ICQ: 22643734 Yahoo: origrps2 - - - - Always remember you're unique, just like everyone else. - ----------------------------------------------------------------------
On 29Nov2010 11:42, msacks ntwrkd@gmail.com wrote: | Hello, | I am trying to figure out a way to output some information to the | console (system boots to runlevel 3) from an init script. | | Here is what I've tried: | add echo "$SOMEINFO" into the init script and pipe it to wall, and put | that in the init script. | | This doesn't seem to work, I was thinking of outputting to motd to | achieve this, but wondered if anyone knows a better way. | Perhaps using the at command?
Perhaps by writing to the console?
echo blah >/dev/console
Just a thought...