Linux-Misc Digest #530, Volume #27 Wed, 4 Apr 01 16:13:01 EDT
Contents:
Netscape Addressbook problem fix (jason.nospam@[EMAIL PROTECTED])
Re: What are servers/services ? (Cray Drygu)
using linux to connect 2 networks ("me")
Mandrake 7.2 Menus are gigantic (mike)
Re: scripting (Philip)
Re: linux on which platform ("Siddharth Vajirkar")
Linux: fork()'ing in a Secondary Thread - Process Control In-General ("Nick Knight")
Re: what 'language' to learn (Lynne Lawrence)
Re: difference between ext2fs and reiserfs (Joshua Baker-LePain)
----------------------------------------------------------------------------
From: jason.nospam@[EMAIL PROTECTED]
Crossposted-To: linux.redhat.misc
Subject: Netscape Addressbook problem fix
Date: 4 Apr 2001 19:12:02 GMT
Having problems with your Netscape 4.7x addressbook under Red Hat Linux 6.x?
I ran searches for answers to the problem and couldn't find anything. So, I
found a solution and wrote some BASH scripts to detect and take care of it.
I've posted my solution at
http://www.uniqsys.com/~jbechtel/nspabfix.html
and then I went to post the URL... Only then did I realize that the solution
had already been determined! Well, it isn't all for nothing. No one else
offered a solution in a BASH script or a patch to /usr/bin/netscape to prevent
the problem from returning. So, I offer you my *extended* solution to the
Netscape addressbook problem...
Sorry for a duplication of earlier posts, but obviously they were hard to
find, so some extra coverage won't hurt. Hats off to those who found the
solution before I did... it wasn't easy.
Jason Bechtel
----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email [EMAIL PROTECTED]
------------------------------
Subject: Re: What are servers/services ?
From: [EMAIL PROTECTED] (Cray Drygu)
Date: Wed, 04 Apr 2001 19:21:20 GMT
[EMAIL PROTECTED] (Arctic Storm) wrote in
<DjJy6.7548$[EMAIL PROTECTED]>:
>I'm not talking about someting like a file server or a printer server;
>they obviously allow clients computers to access files on hard drives on
>the host computer, or allow printing. A host computer providing a
>service to a client computer referrs to a network of computers.
Correct, but there's two parts to "server": software, and hardware.
The computer I'm on right now isn't considered a server. But if I set up
Apache on it, connected it to the internet, and started running a website
off it, now it's a server.
Likewise, if I take one of the servers in the server room, wipe the drive,
install Win98, and start using it like my desktop, it's still server
hardware, but it wouldn't be called a server anymore.
"Server" can describe hardware or software, or the overall state of a
machine. The only way to tell which one someone means is to examine the
context.
>However, if you go to the Hurd section of GNU website, it says that Hurd
>is a collection of servers that run on the Mach microkernel. Servers?!
That, I have no idea.
>When you talk about the "X server", what is being served?
A connection for X programs to talk to. See, X runs just fine over a
network, because there's two parts to it. The "server" is the part you
actually see. The "client" runs on the host computer. The host computer
runs the programs, the programs go over the network to display their
windows on the server.
Most people don't bother with running the server on one machine and the
client on another. In that case, X still works the exact same way, but the
server and client software are running on the same hardware.
X is a bad example because the X client and server are the opposite of what
most people expect them to be, so it gets confusing.
>If you have a
>single, isolated computer running Linux & XFree86, how can you have a
>server? The concept of a host system providing a service to a client
>system cannot apply here; no network.
Basically, a server is something that listens for connections, and a client
is something that connects to a server. It needn't be a network. Terminal
servers listen for connections from text terminals on serial ports, etc.
In this case, though, there (technically) *is* a network. It just doesn't
go beyond the local machine.
If I were to run Apache on a machine with no network connection, I could
still browse the web pages it serves. I'd just have to do it on the same
computer that the pages are being served from.
That computer as a whole, however, wouldn't be considered a server, because
there's nothing else for it to serve its content to.
>How does a server/service pertain to a Daemon?
A daemon is a program that's constantly running in the background. Most
servers are daemons. Not all daemons are servers.
Apache is usually run as a daemon, so is sendmail. Telnet usually isn't --
it's normally run by the inetd daemon every time someone tries to connect
to it.
However, things like "cron" are also daemons. It's not a server, nothing
connects to it, but it's always running in the background.
A "service" is typically just another name for a server daemon.
--
cray [at] org
silverlight [dot]
------------------------------
From: "me" <[EMAIL PROTECTED]>
Subject: using linux to connect 2 networks
Date: Wed, 4 Apr 2001 14:20:43 -0500
I am trying to connect to different ethernet networks together. Both of the
networks have a dhcp server and an internet connection.
Is there anyway to set up a linux box to act as the connection between the
two networks so that the dhcp servers don't fight to hand out leases to all
the pc's? Also is it possible using some configuration for all the pc's to
be visible in Windows "Network Neighborhood in their seperate domains?
Only the client pc's are running windows, all the servers are running Linux.
Chris
------------------------------
From: mike <[EMAIL PROTECTED]>
Subject: Mandrake 7.2 Menus are gigantic
Date: Wed, 04 Apr 2001 15:22:38 -0400
Hi,
I had Mandrake 7.2 running and recently I added a
Jaton TNT2 M64 AGP video card. The first time I
ran Mandrake after the install I installed the new X
SVGA server for the card that is part of Mandrake 7.2.
I ran X and was testing / viewing the desktop and
various functions.
The last thing that I did was to double click on the time icon
in the lower right corner and set the clock. I went back to it
and somehow all the desktop menus got gigantic. I don't
know exactly what happened.
Is it some instability in the new video card / current video
server or did I just accidentally click on something that selected
gigantic menus?
How to restore it?
Thanks
Mike
------------------------------
From: Philip <[EMAIL PROTECTED]>
Subject: Re: scripting
Date: Wed, 04 Apr 2001 19:35:44 GMT
Thanks for the info. This worked well. Except when I decided to hide the
info from the user. I tried doing a telnet session, then su user and cp a
file. I found that if I exited too early the file cp or mv wouldn't
complete and if I waited for it to complete it would print the users
password to the screen. I'm probably going to have to spend some time
trying to figure out processes. It would be ideal if I could get this to
work with scp and the user would never actually know what was going on.
John Thompson wrote:
> Philip wrote:
>
> > There is a program that I run which is when start then asks 3
> > questions. I answer these three questions the same each time. Isn't
> > the a way in which I can write a script which will answer these
> > questions for me.
> > mode?: "term"
> > choose option : "3"
> > email "[EMAIL PROTECTED]"
> >
> > what language is best suited for this. I was wondering if a shell
> > script would work.
>
> Check out "man expect."
>
> Enjoy...
>
> --
>
> -John ([EMAIL PROTECTED])
------------------------------
From: "Siddharth Vajirkar" <[EMAIL PROTECTED]>
Subject: Re: linux on which platform
Date: Tue, 3 Apr 2001 16:06:57 -0700
in relation to your "faster/better" concept, keep in mind your ultimate goal
for using linux.
If you want to do high speed graphics with a lot of 3D rendering it may not
make sense running linux on a sparc if you don't have the proper video
drivers! Specially with video drivers... it can be pain to find a proper
driver if you have some exotic card/monitor.
You might want to specify what you plan to use the linux box for, you might
get better recommendations from people.
Just my 2 cents.
- Sid
"Tom De Boeser" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Hi,
>
> I'm wondering if anyone knows if linux (any kernel version) on x86 is
> faster/better than linux on a spark (or any other architecture). Also,
any
> opinions on the BSD's on different architectures. Benchmarks are nice,
but
> real-life experience would be better.
>
>
>
> Thanks,
>
>
>
> Tom
>
> ------------------------------------------------------------
> Get your FREE web-based e-mail and newsgroup access at:
> http://MailAndNews.com
>
> Create a new mailbox, or access your existing IMAP4 or
> POP3 mailbox from anywhere with just a web browser.
> ------------------------------------------------------------
>
------------------------------
From: "Nick Knight" <[EMAIL PROTECTED]>
Crossposted-To:
comp.os.linux.development.apps,comp.programming.threads,comp.unix.programmer
Subject: Linux: fork()'ing in a Secondary Thread - Process Control In-General
Date: Tue, 03 Apr 2001 12:08:15 -0400
Hi,
This will probably be a long story, but I'll try to summarize it up front.
I tried to get something that works fine on a host of other platforms
(Win32, Solaris, HP, etc) to work under Linux. Basically, I need to be
able to exec*() a bunch of processes and wait on them to return, using
another thread. Optionally kill them, check to make sure they're still
running, etc.
OS is Redhat Linux, uname -a produces:
Linux extest3.secant.com 2.2.14-5.0smp #1 SMP \
Tue Mar 7 21:01:40 EST 2000 i686 unknown
The problem in Linux, from what I've read, is that the calling thread is
the "parent" and only IT can wait on or kill its children (and acquire
status info). An example outline of a "fork server" was found in a
newsgroup, and someone here tried this, but it never worked quite right.
I created this test program to see if the "fork server" idea had any hope.
Unless someone can point out the flaw in my thinking (or code :), I can't
see this working reliably. What I list here is a massively simplified
version of what I started with (which didn't work either :).
Again, the main idea is to be able to check for, wait on or kill processes
a program has started ... to MONITOR these processes in a background
thread.
I guess it might be possible to write a completely encapsulated server
program that did noting but handle spawned processes and data about them.
I think similar issues might occur, tho. And then, why would I have to
write such a beast? Isn't this an OS function (again, what I need to do
was possible on all other OS's supported ... just not Linux).
To illustrate the basic problem, let me splice in a simple test program:
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <pthread.h>
extern char **environ;
static pthread_t processThreadId= 0;
// NOTE: Taken right off the man page for system() ...
// use this so we can monitor what's happening.
// printf's added.
int my_system (const char *command)
{
int pid, status;
if (command == 0)
return 1;
printf("forking ...\n");
pid = fork();
if (pid == -1)
return -1;
if (pid == 0) {
char *argv[4];
argv[0] = "sh";
argv[1] = "-c";
argv[2] = (char *)command;
argv[3] = 0;
printf("chaining ...\n");
execve("/bin/sh", argv, environ);
printf("Chaining failed!\n");
exit(127);
}
do {
printf("Waiting on PID: %d\n",pid);
if (waitpid(pid, &status, 0) == -1)
{
printf("erc: %d\n",errno);
if (errno != EINTR)
return -1;
} else
{
printf("status: %d\n",status);
return status;
}
} while(1);
}
void *ProcessThread(void *arg)
{
printf("pt:pt\n");
my_system("ps -u nknight");
printf("pt:px\n");
return 0;
}
int main()
{
printf("\nBefore new thread:\n\n");
my_system("ps -u nknight");
pthread_create(&processThreadId, 0, ProcessThread, 0);
printf("\nAfter thread start:\n\n");
fflush(stdout);
printf("getting char:\n");
getchar();
return 0;
}
====================================
Ok, briefly (ha! I'm not so good at "briefly"!), the first "my_system"
call works fine and produces a `ps` list to the screen. The same call,
when made from a secondary thread, fails to do anything understandable.
To add more detail, here are some narrated logs of the operation of this
program:
/home/nknight/ISL-3.6/baseset/gcc>./proctest
ready
Before new thread:
forking ...
Waiting on PID: 31817
chaining ...
PID TTY TIME CMD
17265 ? 00:00:02 smbd
26060 ? 00:00:00 xterm
26062 pts/0 00:00:00 bash
26314 ? 00:00:00 xterm
26316 pts/1 00:00:00 bash
31816 pts/0 00:00:00 proctest
31817 pts/0 00:00:00 ps
status: 0
pt:pt
forking ...
After thread start:
getting char:
Waiting on PID: 31820
ok ... at this point, my main thread (inside main()) is waiting for me to
press any keyboard char. The secondary thread has forked. The parent
process is now waiting for the forked process to terminate by calling
waitpid().
But now, here's the interesting part. The above state will remain
"forever" without any user-action being taken. The call I am intending to
result in a quick "ps" never actually finished. Look at a 'ps' invoked
from another window. Notice that pids 31820 is still listed a
"proctest". ??????
/home/nknight>ps -u nknight
PID TTY TIME CMD
17265 ? 00:00:02 smbd
26060 ? 00:00:00 xterm
26062 pts/0 00:00:00 bash
26314 ? 00:00:00 xterm
26316 pts/1 00:00:00 bash
31816 pts/0 00:00:00 proctest
31818 pts/0 00:00:00 proctest
31819 pts/0 00:00:00 proctest
31820 pts/0 00:00:00 proctest
31821 pts/1 00:00:00 ps
Again, everything seems to be waiting, and will remain waiting until I do
something. *If* I press a keyboard char, proctest will terminate, but
guess what? pid 31820 would remain in the process list until killed.
Without pressing a key and after killing pid 31820 manually,
the proctest screen looks like this:
/home/nknight/ISL-3.6/baseset/gcc>./proctest
ready
Before new thread:
forking ...
Waiting on PID: 31817
chaining ...
PID TTY TIME CMD
17265 ? 00:00:02 smbd
26060 ? 00:00:00 xterm
26062 pts/0 00:00:00 bash
26314 ? 00:00:00 xterm
26316 pts/1 00:00:00 bash
31816 pts/0 00:00:00 proctest
31817 pts/0 00:00:00 ps
status: 0
pt:pt
forking ...
After thread start:
getting char:
Waiting on PID: 31820
status: 15
pt:px
Now, this is good. It shows that my waitpid() on my spawned child *did*
come back as designed. I just don't know why this process failed to start
properly, or end by itself. The "pt:px" says we've returned from the
wait inside the secondary thread.
and a ps in another window shows:
/home/nknight>ps -u nknight
PID TTY TIME CMD
26060 ? 00:00:00 xterm
26062 pts/0 00:00:00 bash
26314 ? 00:00:00 xterm
26316 pts/1 00:00:00 bash
31816 pts/0 00:00:00 proctest
31818 pts/0 00:00:00 proctest
31836 pts/1 00:00:00 ps
Note the TWO proctest's still running. These do disappear after pressing
a key and having proctest terminate "normally".
Summary. Since I make the same exact call, one from the main thread,
another from a secondary thread, and since the main thread works and the
secondary thread's call doesn't, something's wrong with forking/exec'ing
from a second thread. Right? :)
Can anyone shed light in this issue? Thanks in advance for your help.
Nick
--
===========================================================
Nick Knight <[EMAIL PROTECTED]> http://nick.secant.com
Senior Software Engineer
Secant Technologies, Inc. http://www.secant.com
===========================================================
------------------------------
From: Lynne Lawrence <[EMAIL PROTECTED]>
Subject: Re: what 'language' to learn
Date: Wed, 04 Apr 2001 16:03:28 -0400
andi wrote:
> I'm new to linux and want to make the best use of it (for admin rather
> than development)
For admin purposes, perl and/or one of the shells might be your best bet,
IMO, of course.
>
>
> I'm on a limited budget and don't have huge ammounts of time.
>
> I'd be interested in learning one of the scripting/coding languages
> (eg C or Perl or somesuch) - but I'd be interested in people's
> opinions of what to learn.
>
> any ideas gratefully recieved.....
>
> thanks
> andi
>
> ____________________________________
>
> "A Single Open Mind,
> can open any door"
>
> Sonia Rutstein
------------------------------
From: Joshua Baker-LePain <[EMAIL PROTECTED]>
Subject: Re: difference between ext2fs and reiserfs
Date: 4 Apr 2001 20:07:29 GMT
Rod Smith <[EMAIL PROTECTED]> wrote:
> struct ext2_super_block {
> __u32 s_inodes_count; /* Inodes count */
> __u32 s_blocks_count; /* Blocks count */
> This gives a maximum of 4,294,967,296 blocks, each of which can be up to
> 4KB in size (IIRC), hence a 16TB filesystem size limit. Again, this
> limit is encoded in the filesystem's on-disk data structures.
> My understanding is that ReiserFS has precisely the same limits as
> ext2fs for these two critical values. XFS and JFS both use 64-bit file
> size and total blocks pointers, although they use them in somewhat
> different ways, so exact limits are different. My understanding is that
> XFS's limits are 8,192PB (8,388,608TB) file size and 16,384PB partition
> size, with JFS at 4PB file size and 32PB partition size. (With those
> limits, presumably JFS isn't using the full 64 bits, or has some other
> factor limiting file and filesystem sizes.) My figures on XFS and JFS
> are based on sketchier data than my ext2fs or even ReiserFS figures. (I
> just checked the reiserfs_fs.h header and found a 32-bit file size
> value [presumably in bytes, although the comment didn't make this
> explicit] and a 32-bit "offset" value [presumably in blocks] for the
> start of the file. If the latter is the only ReiserFS partition size
> limit, that'd make its maximum partition size just over 16TB.)
As a (slight) aside, partition size on Linux (regardless of FS) is
currently limited to 2TB due to block device limits. See
<http://linux-xfs.sgi.com/projects/xfs/indexed/msg04008.html>.
--
Joshua Baker-LePain
Department of Biomedical Engineering
Duke University
------------------------------
** 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 by posting to comp.os.linux.misc.
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-Misc Digest
******************************