Linux-Development-Sys Digest #293, Volume #8     Wed, 22 Nov 00 05:13:13 EST

Contents:
  Re: Changin process name ([EMAIL PROTECTED])
  Re: What distro does Linus Torvalds use? ([EMAIL PROTECTED])
  Re: Changin process name ("Geoff Winkless")
  Re: Shared Object Libraries (DLLs) (Marc SCHAEFER)
  Re: about ARP in linux 2.2.16 (Rick Ellis)
  Re: Where can I obtain info about the latest kernels? (Paul Kimoto)
  Re: injecting keystrokes into virtual console (Mike McDonald)
  Question about device drivers and errno (Steve Helding)
  software raid monitoring tool ("Norman Clarke")
  Re: software raid monitoring tool ("Norman Clarke")
  Re: Interprocess Communication ... ([EMAIL PROTECTED])
  2.4 Kernel Module Development Help ("Derek Watson")
  Re: injecting keystrokes into virtual console (George MacDonald)
  Question on driver for SMP system ("Vladimir Libershteyn")
  Re: query: Controlling SCSI disks under Linux (Kevin)
  ode (Nilesh Patel)
  Re: Software RAID
  via kt133 chipset and agpgart (Stefan Boresch)
  Re: injecting keystrokes into virtual console ([EMAIL PROTECTED])

----------------------------------------------------------------------------

From: [EMAIL PROTECTED]
Subject: Re: Changin process name
Date: Tue, 21 Nov 2000 16:05:35 GMT

In article <[EMAIL PROTECTED]>,
  Nils Henrik Lorentzen <[EMAIL PROTECTED]> wrote:
>
> This is probably a dumb question, but is
> it possible to change the name that occurs when
> I run 'ps', for a newly forked process ?
> If I create a new process via fork() I would
> like it to show up with an other name than
> the parent process. Is there a simple way to do this ?
>
> Nils Henrik
>

I really tought you just had to change the argv[0] buffer and put the
name you want but thats didnt work . Maybe you can check the
setproctitle() code and manpage .

Julien.



Sent via Deja.com http://www.deja.com/
Before you buy.

------------------------------

From: [EMAIL PROTECTED]
Subject: Re: What distro does Linus Torvalds use?
Date: Tue, 21 Nov 2000 16:11:05 GMT

In article <[EMAIL PROTECTED]>,
  DaZaffiro <[EMAIL PROTECTED]> wrote:
> "Michael V. Ferranti" wrote:
>
> >         TSIA.  He's writing the kernel, so I figure what better
flavor of
> > distro to use than what he's got running...
> >
> > --               Michael V. Ferranti [blades&inreach*com]
> > Warning: The Surgeon General has deemed that excessive displays of
warning
> > labels and public service announcements produce stress and shortens
lives.
>
> Well he isn't using Redhat I guess... "make install" doesn't work for
the
> kernel...
>
> A distro it *does* work for is Slackware and I've heard someone
saying that
> it was the only distro it worked for...
>
> But he's not using any distro I think... What would he need it for?
> You can use a distro as a start, but after that you can
> install/remove/upgrade anything you like...
> A distro then is *nice* if you're lazy or have a slow and expensive
internet
> connection...
> (The conversion from a.out to ELF a few yearsago was an exception,
that was a
> /virtually/ impossible upgrade)
>
> But *if* he is using some distro it will be some development distro (I
> remember Walnut Creek's CDROM had one, don't know if they still have)
But
> then again, it would be too unstable for you to use daily...
>
> --
> Never look up when dragons fly overhead.
>
>

I've read in a french magazine he likes redhat, and many people can see
him with his redhat tshirt ;0

Julien.


Sent via Deja.com http://www.deja.com/
Before you buy.

------------------------------

From: "Geoff Winkless" <[EMAIL PROTECTED]>
Subject: Re: Changin process name
Date: Tue, 21 Nov 2000 16:25:26 -0000


<[EMAIL PROTECTED]> wrote in message news:8ve6g8$lun$[EMAIL PROTECTED]...
: In article <[EMAIL PROTECTED]>,
:   Nils Henrik Lorentzen <[EMAIL PROTECTED]> wrote:
: >
: > This is probably a dumb question, but is
: > it possible to change the name that occurs when
: > I run 'ps', for a newly forked process ?
: > If I create a new process via fork() I would
: > like it to show up with an other name than
: > the parent process. Is there a simple way to do this ?
: >
: > Nils Henrik
: >
:
: I really tought you just had to change the argv[0] buffer and put the
: name you want but thats didnt work .

It does work. Be careful about overwriting environment memory though.

Geoff



------------------------------

From: Marc SCHAEFER <[EMAIL PROTECTED]>
Subject: Re: Shared Object Libraries (DLLs)
Date: 21 Nov 2000 13:02:00 GMT

James Moe <[EMAIL PROTECTED]> wrote:
:     How do I create them? Creating static libraries is really easy;
: finding info on Shared Library construction has been a challenge.

Here is the implementation of a shared library which, if preloaded,
will intercept the open() function stub. It's more that what
you want to do, but it's probably an interesting example anyway.

/* Idea taken from:
 *    http://www.uwsg.indiana.edu/hypermail/linux/kernel/9811.2/0639.html
 * [EMAIL PROTECTED], GPL.
 */

#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <stdarg.h>

#define INTERCEPTED_DEVICE "/dev/ircomm0"

int open(const char *pathname, int flags, ...) {
   va_list ap;
   mode_t mode;
   int result;

   va_start(ap, flags);

   mode = va_arg(ap, mode_t);
   
   if (!strcmp(pathname, INTERCEPTED_DEVICE)) {
      flags = O_WRONLY|O_CREAT|O_TRUNC;
      mode = 0666;
   }

   fprintf(stderr, "libopen.so: relaying open(\"%s\").\n", pathname);
   fflush(stderr);
   result = __open(pathname, flags, mode);

   va_end(ap);
   return result;
}

Now, the Makefile:

all: libopen.so

test: all
        env LD_PRELOAD=`pwd`/libopen.so some_software

libopen.so: open.o
        ld -shared open.o -o libopen.so

open.o: open.c
        gcc -c open.c -o open.o

clean:
        rm -f libopen.so open.o


------------------------------

From: [EMAIL PROTECTED] (Rick Ellis)
Subject: Re: about ARP in linux 2.2.16
Date: 21 Nov 2000 18:23:40 GMT

In article <[EMAIL PROTECTED]>,
dream_seeker  <[EMAIL PROTECTED]> wrote:

>I'm now reading ARP in the kernel 2.2.16. and I can't find just where
>ARP is called,

Try looking in route.c

--
http://www.spinics.net/linux

------------------------------

From: [EMAIL PROTECTED] (Paul Kimoto)
Subject: Re: Where can I obtain info about the latest kernels?
Date: 21 Nov 2000 13:28:43 -0500
Reply-To: [EMAIL PROTECTED]

In article <[EMAIL PROTECTED]>,
Mike Dowling wrote:
> I believe that there is a web URL somewhere that archives mailing lists
> concerning discussion on the latest kernels.  Does anybody have it at
> hand?  (I would rather not join a high volume mailing list.)
>
> 2.4.0-pre11 caused me problems with networking, and so I wanted to see
> what the experts are saying about it.

Hmm, Kernel Traffic (http://kt.linuxcare.com/kernel-traffic/latest.epl)
has not yet reached the 2.4.0-test11 era.

There is a full linux-kernel archive at
http://www.cs.helsinki.fi/linux/linux-kernel/ (as well as at several
USAn sites). 

-- 
Paul Kimoto
This message was originally posted on Usenet in plain text.  Any images, 
hyperlinks, or the like shown here have been added without my consent,
and may be a violation of international copyright law.

------------------------------

Reply-To: [EMAIL PROTECTED]
From: [EMAIL PROTECTED] (Mike McDonald)
Subject: Re: injecting keystrokes into virtual console
Date: Tue, 21 Nov 2000 18:52:26 GMT

In article <[EMAIL PROTECTED]>,
        [EMAIL PROTECTED] writes:

> OK.  But how do I feed it input, and then get the process out of the way
> with that shell/program now getting its input from a real keyboard?

  If you're using bash as your shell (I'm not), you could have your special
getty program gather up the init commands into a temp file and then exec bash
as 'bash -rcfile /tmp/fooy -i'. That'll cause bash to execute the init
commands first and then continue on as an interactive shell. You might be able
to do a similar thing with other shells too.

  As for inserting keystrokes into the input queues, I don't know of any way
other than hacking the kernel.

  Mike McDonald
  [EMAIL PROTECTED]

------------------------------

From: Steve Helding <[EMAIL PROTECTED]>
Subject: Question about device drivers and errno
Date: 21 Nov 2000 19:04:24 GMT
Reply-To: [EMAIL PROTECTED]

Is there some standard regarding the addition of error codes returned by
a custom device driver or do I just pick a base number and start from
there?  I have my own error codes I would like to add but don't want to
use the same numbering space that is used in <asm/errno.h>.


------------------------------

From: "Norman Clarke" <[EMAIL PROTECTED]>
Subject: software raid monitoring tool
Date: Tue, 21 Nov 2000 11:07:21 +0800

Hello all,

I have scoured the internet for some sort of shell or perl script to
monitor a Linux software raid device and have not been able to find
anything useful. Basically all I want is something to email me in the
event that a disk goes down so I'll know right away when I need to replace
a drive or hot spare. For lack of ability to find an existing script I
decided to turn my -ahem- "programming" skills to the task and submit to
you the experts the result in the hope you might help me improve it, and 
that someone else will find it useful.

If anyone knows of another such script or can offer suggestions on
making this one work better  I'd appreciate your recommendations 
very much.

Norm

===========
#!/bin/bash
 
# raidmon - monitors a Linux software raid device and emails administrator
# in case of drive failure
# 11-14-2000 Norman Clarke <[EMAIL PROTECTED]>
 
# the raid device to monitor. Do not prefix it with /dev
RAIDDEV='md0'
# sleep for this many seconds between checks on raid status
BASE_SLEEPTIME=30
# report raid device failures this many seconds; default = 3600 = 60 mins
ERROR_REPORT_TIME=3600
# report raid failure to this person
ADMIN_EMAIL='root@localhost'
# spew status information to STDOUT
BE_VERBOSE=1
# this should be set to /proc/mdstat unless you're doing some testing
MDSTAT='/proc/mdstat'
 
if test -f $MDSTAT; then
while [ 1 ]
do
REPORT_TIME=`date +"%Y-%m-%d %H:%M:%S"`
DEADRAID=`grep -c -E '[h|s]d[a-z][0-9]+\[[0-9]+\]\(F\)' $MDSTAT`;
if [ $DEADRAID != 0 ]; then
for i in `grep $RAIDDEV $MDSTAT`;
do
MATCH=`echo $i | grep -c -E '[h|s]d[a-z][0-9]+\[[0-9]+\]\(F\)'`;
if [ $MATCH  = 1 ]; then
FAILEDDEV=`echo $i | sed -e 's/(F)//' | sed -e 's/\[[0-9]\]//'`
if [ $BE_VERBOSE -eq 1 ]; then
   echo "Drive $FAILEDDEV in raid device $RAIDDEV has failed";
fi
echo "Drive $FAILEDDEV in raid device $RAIDDEV has failed" | mail -s \
   "Report from `hostname` at $REPORT_TIME: raid failure" $ADMIN_EMAIL;
   SLEEPTIME=$ERROR_REPORT_TIME;
fi;
done;
sleep $SLEEPTIME
else
SLEEPTIME=$BASE_SLEEPTIME
if [ $BE_VERBOSE -eq 1 ]; then
   echo -n "$REPORT_TIME\t $RAIDDEV OK";
fi
sleep $SLEEPTIME
fi
done;
else
echo "Can not read $MDSTAT. Do you have RAID support compiled into \
your kernel?";
exit 1
fi

------------------------------

From: "Norman Clarke" <[EMAIL PROTECTED]>
Subject: Re: software raid monitoring tool
Date: Tue, 21 Nov 2000 11:10:47 +0800

Arrgghh... the code got mangled upon submission to the newsgroup. If you
want a clean copy with indentation and lines preserved please email me.

Norm

In article <%JzS5.533$[EMAIL PROTECTED]>, "Norman Clarke"
<[EMAIL PROTECTED]> wrote:

> Hello all,
> 
> I have scoured the internet for some sort of shell or perl script to...

------------------------------

From: [EMAIL PROTECTED]
Subject: Re: Interprocess Communication ...
Date: Tue, 21 Nov 2000 20:14:55 GMT

Hi,
 Thanks for your replies.

 They are not the same as SYSV calls. POSIX calls are different than
SYSV calls. Also SYSV IPC's need some kernel parameter settings,which is
not required on POSIX. RedHat Linux 6.2 is Kernel 2.2 or 2.4 ?

Thanks,
Suresh


Sent via Deja.com http://www.deja.com/
Before you buy.

------------------------------

From: "Derek Watson" <[EMAIL PROTECTED]>
Subject: 2.4 Kernel Module Development Help
Date: Tue, 21 Nov 2000 21:01:28 GMT


    I'm working on writing a kernel module that will hook into netfilter and
mangle TCP packets.  I'm having a problem including the header file that
will provide me with the routines for calculating checksums on the IP and
TCP headers.  Does anybody know the proper way to do this?

I have seen other netfilter modules (in the kernel source tree) using
#include <net/checksum.h>. . . but not only don't I have
/usr/include/net/cehcksum.h, but when I try to compile
with -I/usr/src/linux/include to use the header files from the kernel source
tree, the resulting module crashes my kernel  (even a stub module that
doesn't do anything!!)

    Can someone please lead me down the right path here?  Things were going
great until I had to use these checksum routines. . .


Thanks in advance,
Derek



------------------------------

From: George MacDonald <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: injecting keystrokes into virtual console
Date: Tue, 21 Nov 2000 22:47:27 GMT

George MacDonald wrote:
> 
> [EMAIL PROTECTED] wrote:
> >
> > On Fri, 17 Nov 2000 20:30:14 GMT George MacDonald <[EMAIL PROTECTED]> wrote:
> >
> > | You could drive it from the serial port on the *same* computer which
> > | should allow you to drive automatic keystrokes as well as manual. Of
> > | course this lacks feedback to the serial port agent, so timing will
> > | be an issue.
> >
> > And where would my real keyboard be connected if I have the keyboard
> > port looped back to the serial via an adapter?  As soon as the sessions
> > are set up, then I have to be able to use normal keyboard functions.
> >
> 
> I think they have a T arrangement so you can use either.

I confirmed this, so there is a hardware solution, alas not
what your looking for! I suppose it's advantage is less
software development.

I read up on vcs, and looked at gpm ... Your right about the
situation, a new device is what is called for. I like
your ideas and think there are other situations where it
would be useful(computer based training, remote diagnostics,
help agents, ...).


-- 
We stand on the shoulders of those giants who coded before.
Build a good layer, stand strong, and prepare for the next wave.
Guide those who come after you, give them your shoulder, lend them your code.
Code well and live!   - [EMAIL PROTECTED] (7th Coding Battalion)

------------------------------

From: "Vladimir Libershteyn" <[EMAIL PROTECTED]>
Subject: Question on driver for SMP system
Date: Tue, 21 Nov 2000 18:19:47 -0800

Hello,

I ran into a problem and I hope somebody already know the answer.
I've tested our software on different systems.
Everything works fine on a single processor systems but I do get a lot
of unresolved symbols when I try to start a driver on a SMP machine
There is no compiler errors, and the only difference is a kernel (2.2.14-5.0
vs. 2.2.14-5.0smp)

Here is a list of unresolved calls:
atbxl.o: unresolved symbol remap_page_range
atbxl.o: unresolved symbol kmalloc
atbxl.o: unresolved symbol unregister_chrdev
atbxl.o: unresolved symbol register_chrdev
atbxl.o: unresolved symbol create_proc_entry
atbxl.o: unresolved symbol boot_cpu_data
atbxl.o: unresolved symbol free_irq
atbxl.o: unresolved symbol iounmap
atbxl.o: unresolved symbol __ioremap
atbxl.o: unresolved symbol kfree
atbxl.o: unresolved symbol remove_proc_entry
atbxl.o: unresolved symbol pci_find_slot
atbxl.o: unresolved symbol request_irq
atbxl.o: unresolved symbol __verify_write
atbxl.o: unresolved symbol mem_map
atbxl.o: unresolved symbol proc_root
atbxl.o: unresolved symbol __const_udelay
atbxl.o: unresolved symbol pcibios_find_device

I found in a book that __SMP__ should be defined for SMP machines but it
didn't help.
I also have __KERNEL__ and MODULE defined

Here is a makefile I've been using

CFLAGS = -Wall -O2 -fomit-frame-pointer -c
atbxl: axl300.c
 $(CC) $(CFLAGS) axl300.c -o atbxl.o

Does anybody know what am I doing wrong?
What can I do to make ot work?

Regards,
Vladimir Libershteyn




------------------------------

From: Kevin <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.periphs.scsi
Subject: Re: query: Controlling SCSI disks under Linux
Date: Tue, 21 Nov 2000 21:56:09 -0700

[EMAIL PROTECTED] wrote:

> Environment: RedHat 7.0 (kernel 2.2.16-22)
> ------------------------------------------
> 2. How do I get disk ids via write/read operations
>    to the /dev/sg* devices ?
>    How do I get the mapping between disk ids and /dev/sg* ?

The disk id is coded in the device file's minor number.  I have seen
this on all the Unix systems that I have used, but different systems
code it in slightly different ways.

I am running Caldera, and have devices sg0..sg15, one for each possible
ID (on a wide bus).  The minor numbers are exactly 0..15.  You can use
"ls -l", capture the output, and parse out the minor number.

There are also sga...sgh, which are linked to the corresponding sg0..7
files, presumably for backwards compatibility.  In this case, you would
have to follow the link, and then get the minor number.

Kevin



------------------------------

From: Nilesh Patel <[EMAIL PROTECTED]>
Subject: ode
Date: Wed, 22 Nov 2000 11:51:48 -0500

How to set up build environment under linux ?
Can anybody point to some guide/ refernce help for this.

Thanks
Nilesh


------------------------------

From: [EMAIL PROTECTED] ()
Crossposted-To: comp.os.linux.hardware,alt.linux,comp.os.linux.misc
Subject: Re: Software RAID
Date: 22 Nov 2000 08:41:01 GMT

First let me say I know NOTHING about software RAID in Linux.

That said, I have a server with Software RAID on a SUN running Solaris,
and I would never inflict Software RAID on another machine as long as I
live.  Hardware RAID can hide a lot of things from the user, and be just
about as 'fast' as an individual disk.  Software RAID is going to slow
your disk writes, well REALLY BAD.  

My advice would be spend the bucks for the Hardware, or DONT DO IT.

-- 
                                        Reg.Clemens
                                        [EMAIL PROTECTED]

------------------------------

From: Stefan Boresch <[EMAIL PROTECTED]>
Subject: via kt133 chipset and agpgart
Date: 22 Nov 2000 10:21:47 +0100


I am attempting to get the agpgart module to load on a machine with
the via kt133 chipset and an Athlon Thunderbird processor.  The kernel
is RH's 2.2.16 (with the ext3 patch); unfortunately, I am not having
very much luck.  (The point of the exercise is to use the utah-glx mga
module efficiently; I guess the same would apply if I were to try
XFree 4.x?)

This is the output from /sbin/modprobe agpgart on a RH 6.2 machine

/lib/modules/2.2.16-3.ext3/misc/agpgart.o: init_module: Device or resource busy
Hint: insmod errors can be caused by incorrect module parameters, including invalid IO 
or IRQ parameters
/lib/modules/2.2.16-3.ext3/misc/agpgart.o: insmod 
/lib/modules/2.2.16-3.ext3/misc/agpgart.o failed
/lib/modules/2.2.16-3.ext3/misc/agpgart.o: insmod agpgart failed

and here the corresponding lines from the syslog:

Linux agpgart interface v0.99 (c) Jeff Hartmann
agpgart: Maximum main memory to use for agp memory: 203M
agpgart: Unsupported Via chipset, you might want to try agp_try_unsupported=1.
agpgart: no supported devices found. 

I don't quite understand what the agp_try_unsupported=1 line is
supposed to mean.  I guess the problem is that the chipset isn't
supported.  Does anyone know whether there are improvements in 2.2.17/18
or in the 2.4.0-test series?  I have been rather unsuccessful trying 
to find detailed info on agpgart as far as what is supported etc.

Anyways, maybe someone has had more luck or some ideas -- tia,

Stefan

------------------------------

From: [EMAIL PROTECTED]
Subject: Re: injecting keystrokes into virtual console
Date: Wed, 22 Nov 2000 09:26:04 -0000

On Tue, 21 Nov 2000 18:52:26 GMT Mike McDonald <[EMAIL PROTECTED]> wrote:

|   If you're using bash as your shell (I'm not), you could have your special
| getty program gather up the init commands into a temp file and then exec bash
| as 'bash -rcfile /tmp/fooy -i'. That'll cause bash to execute the init
| commands first and then continue on as an interactive shell. You might be able
| to do a similar thing with other shells too.

That could be really messy with more than one going at the same time.


|   As for inserting keystrokes into the input queues, I don't know of any way
| other than hacking the kernel.

Yeah, looks like it.

-- 
| Phil Howard - KA9WGN | My current websites: linuxhomepage.com, ham.org
| phil  (at)  ipal.net +----------------------------------------------------
| Dallas - Texas - USA | [EMAIL PROTECTED]

------------------------------


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list (and comp.os.linux.development.system) via:

    Internet: [EMAIL PROTECTED]

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Development-System Digest
******************************

Reply via email to