Linux-Development-Sys Digest #129, Volume #7 Tue, 31 Aug 99 08:13:44 EDT
Contents:
Re: Writing my own Filesystem? Possible? (Etienne Lorrain)
Linux on RS/6000 (Magnus Larsson)
Re: Normal User X shutdown (Peter Samuelson)
Re: (Root) ROM filesystem on Card ISA (Peter Samuelson)
Re: ext2 and changing "reserved space" (is there a tunefs for ext2?) (Peter
Samuelson)
Re: The optimization debate (was: why not C++?) (Peter Ross)
Re: Linux on RS/6000 (Peter Samuelson)
Re: kernel-2.3.15 on PC (Peter Samuelson)
Win95 is a bloody pain in th ass(after I installed linux)!! ("Santosh H.")
Re: Normal User X shutdown (David T. Blake)
Re: MySQL, chroot and shared libs (Nigel Metheringham)
Re: Normal User X shutdown (Peter T. Breuer)
Re: Question: Child Process I/O (Vassilis Virvilis)
----------------------------------------------------------------------------
From: Etienne Lorrain <[EMAIL PROTECTED]>
Crossposted-To: linux.sources.kernel
Subject: Re: Writing my own Filesystem? Possible?
Date: Tue, 31 Aug 1999 10:17:12 +0100
gary huntress wrote:
> ...
> My plan is to extend
> the ext2fs filesystem to include some sort of encryption, possibly
> needing some sort of hardware key like http://www.ibutton.com in order
> to function...I thought that might be interesting. Yes, I know it
> would be painfully slow :)
Take care, these kind of 1 wire communication chips are really
timing dependant... either you write a Linux driver by disabling
interruptions everywhere (and that will not work because of memory
cache) or you use the serial interface, i.e. 115200 baud, it will
be more than painfully slow !
Etienne.
------------------------------
From: [EMAIL PROTECTED] (Magnus Larsson)
Crossposted-To: comp.os.linux.powerpc,comp.unix.aix
Subject: Linux on RS/6000
Date: Mon, 30 Aug 1999 18:29:28 GMT
I wanna start an organized Linux development on the RS/6000. Anyone
interested?
//Magnus
------------------------------
From: [EMAIL PROTECTED] (Peter Samuelson)
Subject: Re: Normal User X shutdown
Date: 31 Aug 1999 03:55:57 -0500
Reply-To: Peter Samuelson <[EMAIL PROTECTED]>
[Kaz Kylheku <[EMAIL PROTECTED]>]
> > What happened to sudo? I haven't seen it in recent Redhat
> > distro's.
[David T. Blake <[EMAIL PROTECTED]>]
> How free do you think sudo is ???
Are you implying that something in standard Debian is not free enough
for Red Hat? That would be odd, considering the converse case of KDE.
In any case, according to Debian's /usr/doc/sudo/copyright it is GPL.
--
Peter Samuelson
<sampo.creighton.edu!psamuels>
------------------------------
From: [EMAIL PROTECTED] (Peter Samuelson)
Subject: Re: (Root) ROM filesystem on Card ISA
Date: 31 Aug 1999 03:13:00 -0500
Reply-To: Peter Samuelson <[EMAIL PROTECTED]>
[Manut <[EMAIL PROTECTED]>]
> I want create ROM filesystem on ISA Card. Who is Gide me? thankx.
The filesystem is the easy part -- use an existing filesystem like
minix or romfs. What you need is a block device driver for whatever
ROM is on the card.
--
Peter Samuelson
<sampo.creighton.edu!psamuels>
------------------------------
From: [EMAIL PROTECTED] (Peter Samuelson)
Subject: Re: ext2 and changing "reserved space" (is there a tunefs for ext2?)
Date: 31 Aug 1999 02:17:23 -0500
Reply-To: Peter Samuelson <[EMAIL PROTECTED]>
[Matija Grabnar <[EMAIL PROTECTED]>]
> On small partitions, 10% reservation makes sense. However on a 5GB
> partition the reserved space is too large.
Before running off to tune2fs the root-only space down to 0%, realize
that the default 5% was designed not only for system-administration-in-
tight-spots purposes but as part of the strategy for resisting
fragmentation. This from Ted T'so, major ext2 hacker.
--
Peter Samuelson
<sampo.creighton.edu!psamuels>
------------------------------
From: Peter Ross <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: The optimization debate (was: why not C++?)
Date: 31 Aug 1999 19:20:20 +1000
[EMAIL PROTECTED] (Christopher Browne) writes:
>On 27 Aug 1999 12:03:05 +0100, Paul Flinders
><[EMAIL PROTECTED]> wrote:
>>[EMAIL PROTECTED] (Paul D. Smith) writes:
>>> On a micro level, I believe the best way is to write the code the most
>>> straightforward way possible first, _then_ when it all works, come back
>>> and see where you can tweak it to be faster. Remember, slower, working
>>> code is always better than faster, broken code.
>>
>>That's true unless the very slowness _is_ the breakage.
>>
>>Also with more multimedia stuff fast but not completely accurate can be
>>preferable to slow but complete (i.e would you prefer speech recognition
>>which ran in real time but which occasionally got it wrong to speech
>>recognition which took 5 minutes to recognise 10 seconds speech but always
>>got it right).
>Slower, working code that reads in a straightforward manner, which
>thereby makes it easy to make code transformations, is easier to
>optimize than slightly faster code where bits have been tuned, and
>thereby are virtually non-modifiable.
Or even more concisely
"It is easier to optimize correct code, then correct optimized code"
- Yves Deville
Which is why I prefer functional/logical languages because the compiler
can do the optimizations for you.
Pete.
--
+----------------------------------------------------------------------+
| Peter Ross M Sci/Eng Melbourne Uni (change - to . for email) |
| email: [EMAIL PROTECTED] WWW: http://www.cs.mu.oz.au/~petdr |
+----------------------------------------------------------------------+
------------------------------
From: [EMAIL PROTECTED] (Peter Samuelson)
Crossposted-To: comp.os.linux.powerpc,comp.unix.aix
Subject: Re: Linux on RS/6000
Date: 31 Aug 1999 04:03:47 -0500
Reply-To: Peter Samuelson <[EMAIL PROTECTED]>
[Magnus Larsson <[EMAIL PROTECTED]>]
> I wanna start an organized Linux development on the RS/6000. Anyone
> interested?
If you mean the PReP and CHRP ones, IBM is officially sponsoring
development on at least their newer models (F50, 43P-150) through the
Linux PowerPC guy, Cort Dougan <[EMAIL PROTECTED]>. Cort claims it
works although I haven't managed to boot a 43P yet. For older hardware
(i.e. all those Micro Channel beasts) there was a project going at one
time, but if I'm not mistaken it was just one guy and I haven't heard
about any progress lately. Don't know what the state of POWER3 (as in
43P-260) support is but I understand Cort's working on that too.
--
Peter Samuelson
<sampo.creighton.edu!psamuels>
------------------------------
From: [EMAIL PROTECTED] (Peter Samuelson)
Subject: Re: kernel-2.3.15 on PC
Date: 31 Aug 1999 03:08:11 -0500
Reply-To: Peter Samuelson <[EMAIL PROTECTED]>
[<[EMAIL PROTECTED]>]
> Does anyone know if there might be a fix for these undefined symbol
> errors yet? BTW where are the kernel mailing list archives located?
Do not, repeat, DO NOT run development (2.3.x) kernels without keeping
track of the development process. Including very-frequently-asked
questions like yours. The archives are at:
http://kernelnotes.org/lnxlists/linux-kernel/
> How can I fix these two errors? It looks like the affs error should
> be relatively simple, if I can find the replacement function for
> update_vm_cache.
Nope, it's not. The "undefined reference" is not a bug, but deliberate
breakage. Linus and mingo and co. recently (in 2.3.7) redesigned the
Linux page cache, which significantly affected the whole VFS, so that
*every* filesystem has to be updated to work with the new scheme.
Meanwhile they made sure that fs's that haven't been updated yet will
fail to link when they try to use update_vm_cache(). The theory goes
that failing to link is better than failing to work properly. The
necessary filesystem updates are reportedly non-trivial.
AFFS hasn't been updated yet. HPFS, dunno. Even the widely-used
fat/msdos/umsdos/vfat weren't updated until 2.3.14 or so.
--
Peter Samuelson
<sampo.creighton.edu!psamuels>
------------------------------
From: "Santosh H." <[EMAIL PROTECTED]>
Subject: Win95 is a bloody pain in th ass(after I installed linux)!!
Date: Tue, 31 Aug 1999 14:44:32 +0530
Hi all,
Sorry for the bad language but Win95 is one bloody stinking bit of
software.
Well my problem is this.I have a comp at home which runs win95(+
Linux) .To install linux I deleted all extended DOS partitions using
fdisk(I'm using vfat mind) and created the new ext2 partition using cfdisk
when I installed linux.Then when asked I installed LILO (to the
superblock of my linux partition) and then to test
what'd become of my win95 at the boot prompt I told it to boot my first
win95 partiton.Fine Win95 boots but when I try to open My Computer it just
hangs the system.Ditto with all the software I have when I try to chande
drives from the open dialog.
Could someone please tell me what I must do to fix the problem cos my
Mums's yelling at me :-( cos she can't open some spreadsheet she's made
with MS Excel(For those wisecracks advising me to move to StarOffice ,my
mom hates Linux just as much as I hat win95(both pre & post linux days)).
Pls reply ASAP (I'm desperate)
to [EMAIL PROTECTED]
A million thanks to my benefactors
Santosh
******************************************************************
Santosh .H :
Activities Linux Linux and only Linux :-)
Thought for a lifetime:
Only Wimps use MS windows
Toughs use Linux:-)
******************************************************************
------------------------------
From: [EMAIL PROTECTED] (David T. Blake)
Subject: Re: Normal User X shutdown
Date: 31 Aug 1999 05:51:42 GMT
Reply-To: [EMAIL PROTECTED]
Kaz Kylheku <[EMAIL PROTECTED]> wrote:
> On 30 Aug 1999 23:53:41 -0400, Keith Wright <[EMAIL PROTECTED]> wrote:
> >If Normal is logged in remotely, I can't imagine why you would want
> >to allow this, but I suppose you could give em access to a set-uid
> >root script that does it.
>
> What happened to sudo? I haven't seen it in recent Redhat distro's.
How free do you think sudo is ???
Grab a copy and compile it if you like. I find it
works just fine. But don't expect to see it in
RedHat anytime soon.
--
Dave Blake
[EMAIL PROTECTED]
------------------------------
From: [EMAIL PROTECTED] (Nigel Metheringham)
Crossposted-To:
comp.os.linux.development.apps,comp.os.linux.networking,comp.os.linux.security
Subject: Re: MySQL, chroot and shared libs
Date: 31 Aug 1999 09:41:13 GMT
On Mon, 30 Aug 1999 20:16:20 -0700, Sean O'Dell <[EMAIL PROTECTED]> wrote:
>Well, your suggestion actually lead me to the actual problem I think. I
>tried using the domain name for the mysql server and got pretty much the
>same results. However, when I tried the plain old IP address, it worked
>just fine. So, it's got something to do with my DNS lookup activities
>somewhere. Gonna track that down...thanks for the info!
You appear to be making your chroot environment more and more complex,
which makes it harder and harder to fully secure.
Why not:-
1. Static link your program. That definitely rids you of
needing a pile of internal library images. It means
you have to recompile for even minor updates in the
supporting libraries, but thats a similar degree of
work to upgrading the libraries within your chroot
jail.
2. Don't attempt to use a named pipe connection - too
much like hard work and a potential for desecuring
your server
3. Make the program do its DB connections to 127.0.0.1
[ie loopback] - no serious performance hits since it
doesn't hit the real network, and that IP is always
your local machine. No DNS libraries needed at all
[although they are probably linked in by step (1).]
nor additional DNS config - ie /etc/resolv.conf &
/etc/nsswitch.conf
Nigel.
--
[ Nigel Metheringham -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- [EMAIL PROTECTED] ]
[ Playing with technology razor blades - close to the bleeding edge ]
------------------------------
From: [EMAIL PROTECTED] (Peter T. Breuer)
Subject: Re: Normal User X shutdown
Date: 31 Aug 1999 10:35:33 GMT
Reply-To: [EMAIL PROTECTED]
Kaz Kylheku ([EMAIL PROTECTED]) wrote:
: On 30 Aug 1999 23:53:41 -0400, Keith Wright <[EMAIL PROTECTED]> wrote:
: >If Normal is logged in remotely, I can't imagine why you would want
: >to allow this, but I suppose you could give em access to a set-uid
: >root script that does it.
: What happened to sudo? I haven't seen it in recent Redhat distro's.
As far as I recall, it has never been in redhat distros before. It has turned
up in 6.0 though. Maybe redhat will stop foisting root on their admins
now.
--
Peter
------------------------------
From: Vassilis Virvilis <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Question: Child Process I/O
Date: Tue, 31 Aug 1999 13:48:48 +0300
Peter Samuelson wrote:
>
> [Herng-Jeng Jou <[EMAIL PROTECTED]>]
> > In the parent process, how do I determine when the child process has
> > done its number crunching and is waiting for further input? Should I
> > use /proc?
>
> Don't bother trying. Just send it input as fast as you can, and let
> the kernel block you when it's tired of buffering you.
>
> > How do I determine whether there is still something in the output
> > buffer?
>
> Not easy. I still don't understand why you need to do this.
>
> > In a sense, I need an I/O facility similar to a debugger so the
> > parent process can talk to the child program.
>
> The only way I can think of to do this without source code would be to
> insert hacked stdio functions into the binary via LD_PRELOAD. This is
> of course assuming that your binary's stdio is dynamically linked.
>
I think he is trying to drive a command line utility (a program with a command
line, e.g. like gnuplot) from a master program. The same functionality is
achieved by the pair of octave/gnuplot though gnuplot allows non interactive
execution (gnuplot file.gnp) and since I haven't seen the code I don't know how
they are doing the trick.
Here is a sample of code that does the trick and works under UNIX (Linux,
Solaris, SunOs) and win32 which is of course a debatable feature. If you don't
want the WIN32 compatibility the code becomes much cleaner (suprise, suprise).
In case somebody wonders the code snippet is taken from billnet, the Fast & Free
Neural Network Simulator which is a free project of mine.
Good luck anyway.
#if _HAVE_PIPE
#if WIN32
#include <windows.h>
#include <process.h>
#include <io.h>
#include <fcntl.h>
#define pipe(x) _pipe(x,PIPE_BUFFER,_O_BINARY)
#define SHELL "command.com"
#define SHELL_RUN_OPTION "/C"
#else
#include <unistd.h>
#include <fcntl.h>
#define SHELL "/bin/sh"
#define SHELL_RUN_OPTION "-c"
#endif
#endif
static Billnet_Status RunInBackGround(Billnet_String command)
{
Billnet_String args[]={SHELL,SHELL_RUN_OPTION,NULL,NULL};
#if WIN32
FILE *fp;
int resp;
strcpy(BillnetScratch,"c:\\tmp\\run2ipc.bat");
fp=fopen(BillnetScratch,"w"); /* Open the tmp file */
if (!fp)
{
WARNING("Cannot Open file %s: Make sure you have access to the f^@#$%%g path.\
n",BillnetScratch);
goto exit_1;
}
fprintf(fp,"@echo off\n%s\n",command);
fclose(fp);
/* TODO: Fixme: One billnet instance doing IPC may run per machine */
args[2]=BillnetScratch;
DBG(DEBUG_FLOW_CONTROL,"Ready to spawn %s %s %s\n",args[0],args[1],args[2]);
resp=_spawnvp(_P_NOWAIT,args[0],args);
DBG(DEBUG_FLOW_CONTROL,"_SPAWN returns %d\n",resp);
return BILLNET_STATUS_GOOD;
exit_1:
return BILLNET_STATUS_LIBC_ERROR;
#else
args[2]=command;
if (!fork()) /* Child */
execvp(args[0],args);
#endif
return BILLNET_STATUS_GOOD;
}
static int dup_noinherit(int fd)
{
int newfd=-1;
#if WIN32
HANDLE newhnd;
DuplicateHandle(GetCurrentProcess(),(HANDLE) _get_osfhandle(fd),
GetCurrentProcess(),(PHANDLE) &newhnd,
0L,FALSE,DUPLICATE_SAME_ACCESS);
newfd=_open_osfhandle((long) newhnd,0);
#else
newfd=dup(fd);
fcntl(newfd,F_SETFD,1);
#endif
return newfd;
}
/* ------------------------------------------------------------ */
/* Billnet_IPC_Open */
/* ------------------------------------------------------------ */
/*
opens a double pipe (stream?) with a program.
Billnet_IPC_Open will open a bidirectional pipe allowing billnet
applications to use filters and preprocessors in a very powerfull
way. Note that the functionality is rather limited in Billnet needs,
since this is not a a real stream implementation. You have to fclose
the fw pointer as soon as you would like to fread from fr. Thus the whole
implementation is biased towards filtering and not real IPC.
An other drawback of the current implementation is that is UNIX specific. If
you want to port this stuff to windows somebody has to rewrite this function
for Windows support.
returns:
In case of failure NULL is returned in both *fw, *fr. In case of success
*fw holds a FILE pointer this is connected to the stdin of the "command"
program, and *fr that is connected to the stdout of the "command".
BUGS:
>From 18/3/1998 Billnet_IPC_Open will use native pipes under win32.
Unfortunately the command line processor under win95 (widely known as
command.com) is unfixably brain damaged. It won't parse command lines passed
with /C option correctly (try: command /c "dir /w") thus forcing us to use
temporary batch files. Since I do not want to support a broken platform more
than necesssary I use only **one** temporary file avoiding the hussle to
find unique names every time an IPC session is requested. The net effect of
this comprisation is that you can have only one IPC session per time.
However since billnet currently uses only one IPC session per time that
yields to the following rule of thumb "Do not run more than one billnet at a
time in a WIN32 system".
*/
Billnet_Status Billnet_IPC_Open(
Billnet_String command, /* command to do IPC */
FILE **fw, /* pipe to stdin of command */
FILE **fr /* pipe to stdout of command */
)
{
#if _HAVE_PIPE
int fdwto,fdrfr;
int fdr[2],fdw[2];
int stdin_orig,stdout_orig;
int stdin_fileno, stdout_fileno;
pipe(fdr);
pipe(fdw);
/* save original stdio handles */
stdin_fileno=fileno(stdin);
stdout_fileno=fileno(stdout);
stdin_orig=dup_noinherit(stdin_fileno);
stdout_orig=dup_noinherit(stdout_fileno);
/* assign stdin, stdout of the child to the pipe handles */
dup2(fdr[0],stdin_fileno);
dup2(fdw[1],stdout_fileno);
fdwto=dup_noinherit(fdr[1]);
fdrfr=dup_noinherit(fdw[0]);
/* now close some since we have duped them */
close(fdr[0]);
close(fdr[1]);
close(fdw[0]);
close(fdw[1]);
/* Exec the f... process */
RunInBackGround(command);
/* Restore the original stdio handlers */
dup2(stdin_orig,stdin_fileno);
dup2(stdout_orig,stdout_fileno);
/* close temp orig stdio's */
close(stdin_orig);
close(stdout_orig);
*fw=fdopen(fdwto,"w");
*fr=fdopen(fdrfr,"r");
return BILLNET_STATUS_GOOD;
#else
ERROR(
"IPC pipes are not supported to systems without native pipes (e.g. UNIX)\n");
return BILLNET_STATUS_UNSUPPORTED;
#endif
}
.Bill
------------------------------
** 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
******************************