netreport was Re: Interface status detection

1999-12-22 Thread Muli B.Y.

Matan Ziv-Av wrote:
 
 In Mandrake (I don't know if on RH as well), there
 is a /var/run/netreport directory where you can write the pid of your
 program, and it will be sent a SIGIO whenever a network event (device
 up/down) occurs.

Too cool!
Now let's see if it actually works as advertised...

 I'm sure Debian, and all other have similiar mechanisms, if not actually
 the same ones.

Could people please verify this? Redhat 6.0 has it, Mandrake obviously
has it, what about other distros?

On my Redhat 6.0 there's a /sbin/netreport utility too. It writes the
pid of the process calling it to /var/net/netreport.

Is this "netreport" a Redhat specific extension? (Mandrake is derived
from Redhat, AFAIK). The man page is marked "RedHat"...


-- 
Muli B.Y.
email: [EMAIL PROTECTED]

linux/reboot.h: #define LINUX_REBOOT_MAGIC1 0xfee1dead

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Re: Interface status detection

1999-12-21 Thread Muli B.Y.

Thanks for the suggestions, Nimrod, I have implemented the
online/offline thing this way. Shame on me for not having read the FAQ
(where this stuff is mentioned) for quite some time. 

Nevertheless, it was a good excersize and my original question stands:
Windows has RasConnectionNotification(). What does linux have except
constant polling?

Alex Shnitman wrote:
 
 On Mon, Dec 20, 1999 at 11:47:14PM +0200, Nimrod Mesika wrote:
 
 
  nimrodm:~$ cat /etc/ppp/ip-up.local
  #!/bin/sh
  echo 'status online' /home/nimrodm/.licq/licq_fifo
  nimrodm:~$
 
  nimrodm:~$ cat /etc/ppp/ip-down.local
  #!/bin/sh
  echo 'status offline' /home/nimrodm/.licq/licq_fifo
  nimrodm:~$
 
  That's how it's done for Licq ($HOME/.licq/licq_fifo is a named pipe).
 
 Neat! I didn't know that. Just goes to show how you need to RTFM
 before you set out to write code. :-)
 
 --
 Alex Shnitman| http://www.debian.org
 [EMAIL PROTECTED], [EMAIL PROTECTED]   +---
 http://alexsh.hectic.netUIN 188956PGP key on web page
E1 F2 7B 6C A0 31 80 28  63 B8 02 BA 65 C7 8B BA
-- 
Muli B.Y.
email: [EMAIL PROTECTED]

linux/reboot.h: #define LINUX_REBOOT_MAGIC1 0xfee1dead

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Re: Interface status detection

1999-12-21 Thread Muli B.Y.

At the risk of being slightly off topic, I will:
You can find Todd Anderson's Monitoring Dial-Up Network Connections on
the Nov. 1999 Windows Developer's Journal.
http://www.wdj.com/archive/1011/feature.html

(Note- Yes, I read Windows Developer's Journal. You can't compare it to
Dr. Dobb's Journal, which is my favorite magazine, but neither is it
nearly as bad as Microsoft Systems Journal)

Oleg Goldshmidt wrote:
 
 "Muli B.Y." [EMAIL PROTECTED] writes:
 
  Windows has RasConnectionNotification(). What does linux have except
  constant polling?
 
 Sorry for my ignorance, but can you explain to this unixoid how
 RasConnectionNotification() is implemented?
 
 --
 Oleg Goldshmidt | BLOOMBERG L.P. (BFM) | [EMAIL PROTECTED]
 "... We work by wit, and not by witchcraft;
  And wit depends on dilatory time." - W. Shakespeare.

-- 
Muli B.Y.
email: [EMAIL PROTECTED]

linux/reboot.h: #define LINUX_REBOOT_MAGIC1 0xfee1dead

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Interface status detection

1999-12-20 Thread Muli B.Y.

I have written a small utility, ifup, which will tell you if any network
interface is up or down (connected or disconnected). 

Now,  what I really need is a way to get a notification when an
interface changes its status. Is there any way to do this under linux? 

(Of course I can sleep() and continually check the interface's status,
but I dislike this approach- can you hear you cpu roasting? :))

Thanks to Alex Shnitman, Aviram Jenik and James Olin Oden for their
help! 
-- 
Muli B.Y.
email: [EMAIL PROTECTED]

linux/reboot.h: #define LINUX_REBOOT_MAGIC1 0xfee1dead

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Re: Interface status detection

1999-12-20 Thread Muli B.Y.

Oleg Goldshmidt wrote:
 
 "Muli B.Y." [EMAIL PROTECTED] writes:
 
  I have written a small utility, ifup, which will tell you if any network
  interface is up or down (connected or disconnected).
 
 Can you explain what it does? I mean, is it a wrapper around ifconfig(8)
 or netstat(8) or something of the kind? Why is it preferable?

It is not a wrapper, it does not depend upon ifconfig. It does use the
same techniques ifconfig (or netstat) use. I wrote if for inclusion with
the licq (http://www.licq.org) icq clone, in order for licq to
automatically detect when you go online/ offline, and go online/ offline
accordingly.

 
  Now,  what I really need is a way to get a notification when an
  interface changes its status. Is there any way to do this under
  linux?
 
 I suppose there is more than one way to do it under Linux.

I certainly hope so. I can think of a rather elegant way to do this
under windows, and it would pain me to no end if linux proved less
elegant... ;)

 
  (Of course I can sleep() and continually check the interface's
  status,
 
 Yes, you can. You can also use cron.

The minimal time resolution I'm talking about here is less than a
second, and the optimal is instantaneous. That is why cron is not an
option, and sleep() I don't like.

 
  but I dislike this approach- can you hear you cpu roasting? :))
 
 No.

int main()
{
while (1)
{
sleep(1)
do_some_quick_stuff();
}
return 0;
}

Run this and talk to me in a couple of hours/ days/ months. 

Note: while the sleep() solution would work, and cpus don't roast that
quickly, it is not ELEGANT. There must be a better solution!
 
 --
 Oleg Goldshmidt | BLOOMBERG L.P. (BFM) | [EMAIL PROTECTED]
 "... We work by wit, and not by witchcraft;
  And wit depends on dilatory time." - W. Shakespeare.

-- 
Muli B.Y.
email: [EMAIL PROTECTED]

linux/reboot.h: #define LINUX_REBOOT_MAGIC1 0xfee1dead

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Help with Linux Networking

1999-12-14 Thread Muli B.Y.

Hi Everyone, 

I'm writing a small utility which will discover when I connect/
disconnect from the net, by watching the net interface (ppp0, eth0,
etc). Right now I have the source to aprogram called gpppkill which does
this- however, the sources are inn spanish (not just the (sparse)
comments... the variable and function names, too).

Any pointers to man-pages or web-pages or any other pages at all will be
appreciated.

(So far, I'm working from the above mentioned spanish code and
/usr/include/net/*)

-- 
Muli B.Y.
email: [EMAIL PROTECTED]

Where there's no hope, let there be Source.

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



JOB: Excellent Linux Instructor Needed in the Haifa Area.

1999-11-13 Thread Muli B.Y.

Hi Everyone

Mediatek College is looking for an excellent Linux/Unix instructor, in
the Haifa
area.

please contact: Yariv Inbar  mailto:[EMAIL PROTECTED]
-- 
Muli B.Y.
email: [EMAIL PROTECTED]

Where there's no hope, let there be Source.

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



JOB: Excellent Linux Instructor Needed in the Haifa Area.

1999-11-13 Thread Muli B.Y.

Hi Everyone

Mediatek College is looking for an excellent Linux/Unix instructor, in
the Haifa
area.

please contact: Yariv Inbar  [EMAIL PROTECTED]
-- 
Muli B.Y.
email: [EMAIL PROTECTED]

Where there's no hope, let there be Source.

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



partition mayhem

1999-09-12 Thread Muli B.Y.

Hello, all.

When I first installed linux, I cleared up 1 of 4 gigs on my disk. I
made a swap partition, a /root partition, and a (700+ megabytes) /usr
partition. Well, my /usr grew and now more than 90 percent of the space
is occupied. So, I cleared up another 1 gig. Problem is, I don't know
how to grow the /usr partition. Any suggestions?

Note: my solution for the time being was to mount the new 1 gig
partition as /home, but obviously this is not a good solution- it will
be a long time until I'll need this much space on /home, and /usr is
bursting at the seams.

Thank you!
-- 
Muli B.Y.
email: [EMAIL PROTECTED]

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Shell Programming Tutorial?

1999-07-26 Thread Muli B.Y.

Hello,

Can anyone recommend a good online shell programming tutorial, other
than `man bash`?
-- 
Muli B.Y.
email: [EMAIL PROTECTED]

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]