[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [leafnode-list] Ever wanted to change the verbosity level of a



Joerg Dietrich schrieb:
> 
> In this case I usually do a
> strace -p `cat /var/lock/news/fetchnews.lck'.
> 
> > + static void catch_sig_usr( int signo )
> > + {
> > +     if (signo == SIGUSR1)
> > +     {
> > +         verbose++;
> > +     }
> 
> Please note, that within a signal handler you are only allowed to
> call a small set of reentrant functions, longjmp() and modify
> variables of type volatile sig_atomic_t. So you better change the
> type of verbose as well. Shouldn't be a problem. Otherwise, I
> like it. Although the strace solution is probably more Unix like.
> 

strace may be more Unix like, but at least on my UnixWare system a
little bit hard to use.

extract from the man page:

Synopsis
   strace [mid sid level] ...
   Description
   strace without arguments writes all STREAMS event trace messages from
   all drivers and modules to its standard output. These messages are
   obtained from the STREAMS log driver (see log(7)). If arguments are
   provided they must be in triplets of the form:
   mid, sid, level

   where mid is a STREAMS module ID number, sid is a sub-ID number, and
   level is a tracing priority level. Each triplet indicates that
tracing
   messages are to be received from the given module/driver, sub-ID
   (usually indicating minor device), and priority level equal to or
less
   than the given level. The token ``all'' may be used for any member to
   indicate no restriction for that attribute.

   ...

I'm afraid to say that I didn't use it yet, because I simply don't know
how :-(

Therefore signal handling for changing the verbosity level is a great
idea.  I think I'll give it a try.
-- 

Stefan Bauer

-- 
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list