mh, daemon mode, logging and display on tty

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

mh, daemon mode, logging and display on tty

rbolen
Hello again,

I know I've read about this somewhere before, but can't find it anymore...

I'm running mh on Debian Sarge (linux) as a daemon. In addition to logging
stuff to ..data/logs/* I'd like to also output the runtime chatter to a tty,
preferrably tty6.

However, the higher number ttyX don't startup until after MH has launched.

Any recommendations?

Thanks, Rick




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: mh, daemon mode, logging and display on tty

Tim Sailer-2
On Fri, January 20, 2006 11:35, Rick Bolen said:

> Hello again,
>
> I know I've read about this somewhere before, but can't find it anymore...
>
> I'm running mh on Debian Sarge (linux) as a daemon. In addition to logging
> stuff to ..data/logs/* I'd like to also output the runtime chatter to a
> tty,
> preferrably tty6.
>
> However, the higher number ttyX don't startup until after MH has launched.
>
> Any recommendations?

I'm not sure what you mean when yo usay the ttys don't 'start up'. You
want the chatter going to a virtual screen that is *not* being controlled
but a getty process, no? It would be quite annoying to log in and have the
stuff splattered amongst your typing and command output. Under Debian and
derivitives, tty1-6 are normal login-enabled consoles, and tty7 is the
default for your X session. You should use tty8 or higher. Ubuntu uses
tty8 for the boot messages. I regularly spit output from certain daemons
to tty10 so I can easily switch to that console and see what's going on
without having to log in, and grep the syslog outputs.

Tim




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

RE: mh, daemon mode, logging and display on tty

rbolen
Tim,

> You
> want the chatter going to a virtual screen that is *not* being controlled
> but a getty process, no?

Exactly. But I also want the MH stuff to continue to write to logs so I was
afraid that a simple redirection (e.g., mh > tty#) might prevent its' normal
logging.

> I regularly spit output from certain daemons
> to tty10 so I can easily switch to that console and see what's going on
> without having to log in, and grep the syslog outputs.

Perfect. What would be the proper syntax for achieving this, and then how do
I access tty10 (ALT+F10?)?

I know this is standard UNIX stuff, but I haven't really mastered tty yet.

Thanks,

Rick




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: mh, daemon mode, logging and display on tty

Neil Cherry
Rick Bolen wrote:

> Tim,
>
>> You
>> want the chatter going to a virtual screen that is *not* being controlled
>> but a getty process, no?
>
> Exactly. But I also want the MH stuff to continue to write to logs so I was
> afraid that a simple redirection (e.g., mh > tty#) might prevent its' normal
> logging.
>
>> I regularly spit output from certain daemons
>> to tty10 so I can easily switch to that console and see what's going on
>> without having to log in, and grep the syslog outputs.
>
> Perfect. What would be the proper syntax for achieving this, and then how do
> I access tty10 (ALT+F10?)?
>
> I know this is standard UNIX stuff, but I haven't really mastered tty yet.

This will probably do what you want:

mh -tk 0 | tee /var/log/mh.log >/dev/tty10

BTW, if you need to startup mh after the virtual console just start
it later in the rc.x directory (if you're running a SYSV init).
S99mh would start up after S99local (ASCII order). On a BSD init
you should move it to the end of the startup section of rc.local
(I think that's what it's called).

--
Linux Home Automation         Neil Cherry       [hidden email]
http://www.linuxha.com/                         Main site
http://linuxha.blogspot.com/                    My HA Blog
http://home.comcast.net/~ncherry/               Backup site


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: mh, daemon mode, logging and display on tty

Neil Cherry
In reply to this post by rbolen
Rick Bolen wrote:

> Tim,
>
>> You
>> want the chatter going to a virtual screen that is *not* being controlled
>> but a getty process, no?
>
> Exactly. But I also want the MH stuff to continue to write to logs so I was
> afraid that a simple redirection (e.g., mh > tty#) might prevent its' normal
> logging.
>
>> I regularly spit output from certain daemons
>> to tty10 so I can easily switch to that console and see what's going on
>> without having to log in, and grep the syslog outputs.
>
> Perfect. What would be the proper syntax for achieving this, and then how do
> I access tty10 (ALT+F10?)?
>
> I know this is standard UNIX stuff, but I haven't really mastered tty yet.

Let me amend my last message with this:

(mh -tk 0 | tee /var/log/mh.log >/dev/tty10) &

That lets it run in the background.

Does anyone have a good method of making MH a real daemon? I could
add code to mh/bin/mh to do that and redirect std* to the log. I
just thought there might be another way.

--
Linux Home Automation         Neil Cherry       [hidden email]
http://www.linuxha.com/                         Main site
http://linuxha.blogspot.com/                    My HA Blog
http://home.comcast.net/~ncherry/               Backup site



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: mh, daemon mode, logging and display on tty

Matthew Williams-3
Neil Cherry wrote:
>
> Does anyone have a good method of making MH a real daemon? I could
> add code to mh/bin/mh to do that and redirect std* to the log. I
> just thought there might be another way.
>

Take a look at my daemontools page on the wiki.

http://misterhouse.wikispaces.com/DaemonTools

Daemontools is a set of programs designed to make anything into a daemon,
including capturing output into a auto-rotating log file with optional
timestamps.

Matt
__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: mh, daemon mode, logging and display on tty

Matthew Williams-2
In reply to this post by Neil Cherry
Neil Cherry wrote:
> Does anyone have a good method of making MH a real daemon? I could
> add code to mh/bin/mh to do that and redirect std* to the log. I
> just thought there might be another way.
>

Take a look at my daemontools page on the wiki.

http://misterhouse.wikispaces.com/DaemonTools

Daemontools is a set of programs designed to make anything into a daemon,
including capturing output into a auto-rotating log file with optional
timestamps.

Matt
__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: mh, daemon mode, logging and display on tty

Neil Cherry
Matthew Williams wrote:

> Neil Cherry wrote:
>> Does anyone have a good method of making MH a real daemon? I could
>> add code to mh/bin/mh to do that and redirect std* to the log. I
>> just thought there might be another way.
>>
>
> Take a look at my daemontools page on the wiki.
>
> http://misterhouse.wikispaces.com/DaemonTools
>
> Daemontools is a set of programs designed to make anything into a daemon,
> including capturing output into a auto-rotating log file with optional
> timestamps.

Excellent! That is exactly what I wanted (right down to the
watchdog!).

THANKS!

--
Linux Home Automation         Neil Cherry       [hidden email]
http://www.linuxha.com/                         Main site
http://linuxha.blogspot.com/                    My HA Blog
http://home.comcast.net/~ncherry/               Backup site


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

RE: mh, daemon mode, logging and display on tty

Tim Sailer-2
In reply to this post by rbolen
On Sun, January 22, 2006 18:11, Rick Bolen said:

> Tim,
>
>> You
>> want the chatter going to a virtual screen that is *not* being
>> controlled
>> but a getty process, no?
>
> Exactly. But I also want the MH stuff to continue to write to logs so I
> was
> afraid that a simple redirection (e.g., mh > tty#) might prevent its'
> normal
> logging.

not knowing exactly what you are doing, how, and why, may I suggest 'man tee'

>
>> I regularly spit output from certain daemons
>> to tty10 so I can easily switch to that console and see what's going on
>> without having to log in, and grep the syslog outputs.
>
> Perfect. What would be the proper syntax for achieving this, and then how
> do

I tend to write files for logging, and start a background process that
does 'tail -f /var/log/logfile > /dev/tty10&'

> I access tty10 (ALT+F10?)?

Yup, or ctrl-alt-f10 if in X11

Tim




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

Reply | Threaded
Open this post in threaded view
|

Re: mh, daemon mode, logging and display on tty

David Lynch Jr.


Tim Sailer wrote:

>  
>
>>I access tty10 (ALT+F10?)?
>>    
>>
>
>Yup, or ctrl-alt-f10 if in X11
>  
>
    I could have swore I had tried that unsuccessfully in X11 before.

    But that worked for me - as did the other ctrl-alt-Fn's
   
    Thanks;

--

Dave Lynch DLA Systems
Software Development:       Embedded Linux
717.627.3770 [hidden email] http://www.dlasys.net:8888



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365