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

Re: [Sheflug] Running programs on file creation



That's exactly what I did do - It's just that I wrote it on top of the older
system so it still used that way to connect to the net. What it does is to
create a file in said directory whenever it was told to connect, and delete
the relevent file when disconnection was asked for. Works wonders :)
I don't want to use this to connect/disconnect too though, because the way
I'm doing it means that if I get disconnected for any reason then it'll
automagically try to reconnect - and as I'm on NTL, and thus have the two
hour disconnections it makes life much easier this way...

Thanks for the help anyhow :)
--
Graham

An' Ye harm none,
do as Ye will.

----- Original Message -----
From: Eric E Moore <nospam [at] sheffield.ac.uk>
To: <shef-lug [at] list.sheflug.org.uk>
Sent: Tuesday, August 28, 2001 6:41 PM
Subject: Re: [Sheflug] Running programs on file creation


> >>>>> "Graham" == Graham Cox <ACA00GAC [at] sheffield.ac.uk> writes:
>
> Graham> I've looked at it, and it isn't quite what I want. The problem
> Graham> is that we've only got one phone line, and my modem is quite
> Graham> stubborn about such things as detecting dial tones(It dials if
> Graham> someone's using the phone :( ). Also, because of some of the
> Graham> programs that are run on the network(e.g. MSN Messenger) it's
> Graham> going to be trying to connect to the net the whole time(If
> Graham> I've read things correctly that is :) -- Graham
>
> Ah.  Well, the canonical solution then would be to run a daemon that
> programs register themselves (either by opening a net connection to
> it, or writing to a fifo or sending it a signal or some other IPC
> method) and keeps count of the number of programs with requests for
> the net, and brings it up/down as needed.  Creating files in a
> directory isn't the best sort of mechanism under Unix for
> inter-process signalling...
>
> A simple (untested, I haven't even tried to compile it :) program
> that does this using a fifo is attached.  Once it's running just do an
> "echo -n u >> /var/connect/netd" to do the equivalent of adding a
> file, and echo -n d to release the network.
>
>   -Eric
>

___________________________________________________________________

Sheffield Linux User's Group - http://www.sheflug.co.uk . 
To unsubscribe from this list send mail to 
shef-lug-request@list.sheflug.org.uk with the word
"unsubscribe" in the body of the message. 

  GNU the choice of a complete generation.