From: Raymond Wiker
Subject: Re: CMUCL (on Unix) question, how to bleep a user's terminal?
Date: 
Message-ID: <86k7urrivx.fsf@raw.grenland.fast.no>
·······@Yahoo.Com writes:

> The later ideas in this thread all seemed bad. In particular filing
> a system log just because somebody wants me on IRC seems very bad taste.

        Did you check the manual pages for syslog?

-- 
Raymond Wiker                        Mail:  ·············@fast.no
Senior Software Engineer             Web:   http://www.fast.no/
Fast Search & Transfer ASA           Phone: +47 23 01 11 60
P.O. Box 1677 Vika                   Fax:   +47 35 54 87 99
NO-0120 Oslo, NORWAY                 Mob:   +47 48 01 11 60

Try FAST Search: http://alltheweb.com/

From: ·······@Yahoo.Com
Subject: Re: CMUCL (on Unix) question, how to bleep a user's terminal?
Date: 
Message-ID: <ffdf399b.0201261405.46ceb10e@posting.google.com>
Raymond Wiker <·············@fast.no> wrote in message news:<··············@raw.grenland.fast.no>...
> ·······@Yahoo.Com writes:
> > The later ideas in this thread all seemed bad. In particular filing
> > a system log just because somebody wants me on IRC seems very bad taste.
>         Did you check the manual pages for syslog?

Yes. It starts right off saying:
  The syslog() function writes message to the system message logger.
When some private party is wishing to tell me privately that she's on IRC
and wants me to join her, one thing I most definitely do **not** want is
for this information to be put in the SYSTEM MESSAGE LOG!!!!
Likewise if one of the users of my CGI/CMUCL WebServer application wants
to ask me a question about that application. I want to be alerted privately,
not have it entered as if a unix system problem.
Accordingly syslog seems totally inappropriate for my purpose.
From: Raymond Wiker
Subject: Re: CMUCL (on Unix) question, how to bleep a user's terminal?
Date: 
Message-ID: <86bsfeidww.fsf@raw.grenland.fast.no>
·······@Yahoo.Com writes:

> Raymond Wiker <·············@fast.no> wrote in message news:<··············@raw.grenland.fast.no>...
> > ·······@Yahoo.Com writes:
> > > The later ideas in this thread all seemed bad. In particular filing
> > > a system log just because somebody wants me on IRC seems very bad taste.
> >         Did you check the manual pages for syslog?
> 
> Yes. It starts right off saying:
>   The syslog() function writes message to the system message logger.
> When some private party is wishing to tell me privately that she's on IRC
> and wants me to join her, one thing I most definitely do **not** want is
> for this information to be put in the SYSTEM MESSAGE LOG!!!!
> Likewise if one of the users of my CGI/CMUCL WebServer application wants
> to ask me a question about that application. I want to be alerted privately,
> not have it entered as if a unix system problem.
> Accordingly syslog seems totally inappropriate for my purpose.

        The *second* sentence says

 | The message is then written to the system console, log files,
 | logged-in users, or forwarded to other machines as appropriate.

        Are you getting a clue, yet?

-- 
Raymond Wiker                        Mail:  ·············@fast.no
Senior Software Engineer             Web:   http://www.fast.no/
Fast Search & Transfer ASA           Phone: +47 23 01 11 60
P.O. Box 1677 Vika                   Fax:   +47 35 54 87 99
NO-0120 Oslo, NORWAY                 Mob:   +47 48 01 11 60

Try FAST Search: http://alltheweb.com/
From: ·······@Yahoo.Com
Subject: Re: CMUCL (on Unix) question, how to bleep a user's terminal?
Date: 
Message-ID: <ffdf399b.0202152124.242287ca@posting.google.com>
Raymond Wiker <·············@fast.no> wrote in message news:<··············@raw.grenland.fast.no>...
<<The *second* sentence says>>

 | The message is then written to the system console, log files,
 | logged-in users, or forwarded to other machines as appropriate.

I don't want **any** of those things to happen when somebody
connects to my WebServer application, not writing anything
to the system console, not writing anything in the system
log files, not broadcasting to all logged in users, and not
forwarding to some other machine. I want just myself, one
user on the *same* machine, the person who wrote the
WebServer application, nobody else whatsoever on any machine
anywhere, to be alerted, just the same as when I receive
e-mail and biff/comsat is supposed to bleep me and nobody
else.

<<Are you getting a clue, yet?>>

Your verbal abuse of me via this NewsGroup is **not** appreciated.
If you can't say anything nice, then shut the fuck up!
From: Raymond Wiker
Subject: Re: CMUCL (on Unix) question, how to bleep a user's terminal?
Date: 
Message-ID: <86eljl6bxy.fsf@raw.grenland.fast.no>
·······@Yahoo.Com writes:

> Raymond Wiker <·············@fast.no> wrote in message news:<··············@raw.grenland.fast.no>...
> <<The *second* sentence says>>
> 
>  | The message is then written to the system console, log files,
>  | logged-in users, or forwarded to other machines as appropriate.
> 
> I don't want **any** of those things to happen when somebody
> connects to my WebServer application, not writing anything
> to the system console, not writing anything in the system
> log files, not broadcasting to all logged in users, and not
> forwarding to some other machine. I want just myself, one
> user on the *same* machine, the person who wrote the
> WebServer application, nobody else whatsoever on any machine
> anywhere, to be alerted, just the same as when I receive
> e-mail and biff/comsat is supposed to bleep me and nobody
> else.

        Since you *still* don't seem to have looked at the appropriate
man pages, I quote from the manpage from syslog.conf:

     # Root and Eric get alert and higher messages.
     *.alert                                                 root,eric

        So, if you tried something like

     local0.*        rem642b

--- any syslog info tagged with the "local0" facility should be sent
directly to you, if you're logged in.

> <<Are you getting a clue, yet?>>
> 
> Your verbal abuse of me via this NewsGroup is **not** appreciated.
> If you can't say anything nice, then shut the fuck up!

        And if you are unable/unwilling to follow up on advice given,
you may as well just stop asking.

-- 
Raymond Wiker                        Mail:  ·············@fast.no
Senior Software Engineer             Web:   http://www.fast.no/
Fast Search & Transfer ASA           Phone: +47 23 01 11 60
P.O. Box 1677 Vika                   Fax:   +47 35 54 87 99
NO-0120 Oslo, NORWAY                 Mob:   +47 48 01 11 60

Try FAST Search: http://alltheweb.com/
From: ·······@Yahoo.Com
Subject: Re: CMUCL (on Unix) question, how to bleep a user's terminal?
Date: 
Message-ID: <ffdf399b.0202181726.1bd27dd2@posting.google.com>
Raymond Wiker <·············@fast.no> wrote in message news:<··············@raw.grenland.fast.no>...
<<I quote from the manpage from syslog.conf>>

If that's where the answer to my question is located, you
could have told me about that in the first place, instead of
treating me like some kind of idiot for not reading your
mind to the learn that's where to find the answer.

When somebody mentionned syslog, I did just 'man syslog',
and got something that sounded just like the name seemed to
imply, a way to post messages to the system log, mostly to
be read by my ISP's sysadmin, not a private way to send me
an alert as I had requested. So now I've done:
  whereis syslog.conf
  syslog.conf:
I.e. there is no such file anywhere public on our whole
FreeBSD system, so even if I had known where to look there's
no such place to look, but at least if you had told me to
look there from the outset I could have told you right away
there's no such file.

     # Root and Eric get alert and higher messages.
     *.alert                                                 root,eric
        So, if you tried something like
     local0.*        rem642b
  --- any syslog info tagged with the "local0" facility should be sent
  directly to you, if you're logged in.

But if I read that correctly, it would **also** go to root,
which is something I do **not** want to happen!!

All I want is a private way that the users of my CGI/Web
page can alert me when they need my attention, or whereby
software in my CGI server application can decide to alert me
on its own initiative. root has no business knowing when the
users of my WebPage wish to alert me, any more than root
needs to eavesdrop on your Instant Messager inbox.

I think that writing a file sub-classified per process ID
(so that two different users of my CGI server can't step on
each other's attempts to communicate with me) and/or use a
'fifo' pipe-line pseudo-file-thingy.

Having my background job do something like
  (loop (if (directory (format nil "~A~A" g*cgi-perpid-dir "P*-alert-rem*"))
            (...))
        (sleep 60))
seems the simplest way to implement things for now
(optimized so it doesn't have to re-build the argument to
directory repeatedly, and so it saves the non-NIL result
from directory for use within (...) which actually reads the
contents of each such file and alerts me and deletes those
files). Hmm, the following would probably be the way to do it:
  (loop (mapc (function handle-one-alert) (directory ...alert...))
        (sleep 60))
Or if I want to keep the alerts strictly in chronological
order, thereby emulating a fifo, I could pass that latest
batch to a function that sorts the various alert-files by
date written, like this:
  (loop (mapc (function handle-one-alert)
          (sort-files-by-time-written (directory ...alert...)))
        (sleep 60))
From: Tim Bradshaw
Subject: Re: CMUCL (on Unix) question, how to bleep a user's terminal?
Date: 
Message-ID: <ey3heoez1i0.fsf@cley.com>
* rem642b  wrote:

> But if I read that correctly, it would **also** go to root,
> which is something I do **not** want to happen!!

You don't read it correctly.

--tim
From: Dr. Edmund Weitz
Subject: Re: CMUCL (on Unix) question, how to bleep a user's terminal?
Date: 
Message-ID: <m3vgcuj83y.fsf@bird.agharta.de>
·······@Yahoo.Com writes:

> Raymond Wiker <·············@fast.no> wrote in message news:<··············@raw.grenland.fast.no>...
> <<I quote from the manpage from syslog.conf>>
> 
> If that's where the answer to my question is located, you
> could have told me about that in the first place, instead of
> treating me like some kind of idiot for not reading your
> mind to the learn that's where to find the answer.
> 
> When somebody mentionned syslog, I did just 'man syslog',
> and got something that sounded just like the name seemed to
> imply, a way to post messages to the system log, mostly to
> be read by my ISP's sysadmin, not a private way to send me
> an alert as I had requested. So now I've done:
>   whereis syslog.conf
>   syslog.conf:
> I.e. there is no such file anywhere public on our whole
> FreeBSD system, so even if I had known where to look there's
> no such place to look, but at least if you had told me to
> look there from the outset I could have told you right away
> there's no such file.

You should really learn to use your operating system before you accuse
other people of giving you false advise.

'whereis' is for locating _programs_, not random files, on your system
- check

  man whereis

for details. If your FreeBSD system is more or less a default install
you might get away with

  locate syslog.conf

to find the file itself. It should be 'hidden' in /etc. However,
Raymond Wiker advised you to read 'the manpage from syslog.conf' - so
you should have just tried

  man syslog.conf

Presto!

Maybe you should get some 'Unix for newbies' book first.

Edi.

-- 

Dr. Edmund Weitz
Hamburg
Germany

The Common Lisp Cookbook
<http://cl-cookbook.sourceforge.net/>
From: ·······@Yahoo.Com
Subject: Re: CMUCL (on Unix) question, how to bleep a user's terminal?
Date: 
Message-ID: <ffdf399b.0203150925.3436f0b@posting.google.com>
···@agharta.de (Dr. Edmund Weitz) wrote in message news:<··············@bird.agharta.de>...
> Raymond Wiker advised you to read 'the manpage from syslog.conf' - so
> you should have just tried
>   man syslog.conf

I don't know why it didn't before, but it works now.
It says it's the configuration file for the syslogd program,
so I looked there next:

     The syslogd daemon reads and logs messages to the system console, log
     files, other machines and/or users as specified by its configuration
     file.

That still reads like the sysadmin sets up this configuration file
to tell where system emergency alerts will be sent, like to his personal
mailbox and whatever terminal he's logged on etc., and even to his
console and/or mailbox on other machines, so if he's on one machine he
can still be aware of an emergency on another machine. It doesn't sound
like anything a regular user on an ISP with hundreds of users should
be tampering with to make syslog messages go to him personally instead
of to the sysadmin, so that he can usurp the syslog facility to provide
a private means of communicating between several of his own programs
some of which are being used via CGI. Somehow I feel like you Unix
experts are treating me like a novice deserving a KICK ME sign on my back,
trying to trick me into using syslog and getting kicked off my ISP as
a result. Have you pulled this stupid trick on other Unix novices before?
Did you get a kick out of pulling such a joke on them as some stupid
initiation stunt like wolfing down goldfish with vodka??

I'll stick with writing PID-specific files, or maybe FIFO, and avoid
messing with syslogd.

CGI application:
(let* ((pid (getpid)) ;Protects against other process interference
       (gen (gensym)) ;Protects me if I write two messages in sequence
                      ; during single session before daemon sees first.
       (fn1 (format nil "P~5D-~A-unfinished" pid gen)
       (fn2 (format nil "P~5D-~A-finished" pid gen))
  (with-open-file (ochan fn1)
    (format ochan "Stuff directed at maintainer of WebServer application"))
  (rename-file fn1 fn2)) ;Protects against daemon seeing partly-written file.

My daemon:
(loop (mapcar #'handle-cgi-msg (directory "*-finished")) (sleeep 60))

Caveat: Both the with-open-file and the directory would have to specify
the correct /usr/rem/public_html/cgi-bin/PerPID/ directory in front
of the filename or search template (respectively) shown above.

Remark: The PID-parameterized temporary files are such a simple solution,
I don't understand why anybody is suggesting I use syslogd or FIFO instead.