[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: /etc/motd replacement?
On Mon, 30 Nov 1998, Shachar Tal wrote:
> Please read my mail again and think if this is what I wanted. I need some
> way of making EACH user see the motd items that HE didn't read yet.
> That means personalized motd, calculated from last login information.
> Also, I also need to devise a way to REMOVE motd items once they expire
> (e.g. scheduled communication problems, scheduled power outs, etc.)
So you want motd items to be of two types: seen and unseen, and you want
them to be expire-able. I still say that setting up some web pages will do
that.
You can use a simple cgi front page for all, and have a list of documents
that gets augmented with the username (from the cgi env) after these are
served, on the same line (how manyusers do you have ? Technion - wide ?
ouch). The front of the cgi would be a PHP or perl script that serves a
list with links to documents that the user has not seen yet.
The login script of the user calls this URL. Remains to be seen what to do
if the calling user has seen everythin. Maybe the script can give a
deliberate error and the lynx call suppress the error on the command line.
A daemon running in parallel with this can expire items in the list by
making a copy of the list and then moving it in the place of the old one.
The cgi script may need to spinlock while this (the move) is happening, if
it gets called then, so you need to make a simple lock. Also the cgi
should lock the other way while running.
I've never seen a prog that does all this, but it is easy enough.
Peter