Re: ptrace problem - confounded, dazed and confused at the inconsistencies

2010-10-27 Thread Shachar Shemesh

On 27/10/10 23:03, Amos Shapira wrote:


On 28 October 2010 06:23, Shachar Shemesh  wrote:
   

Same flags to clone in both cases (vi sets the same flags, and both strace
and fakeroot-ng change them to the same different flags).
I'm not aware of any settings that globally affects wait's behavior.
 

SIGCHLD? (not global, but part of the "environment"),

   

The environment IS global.

And you must understand that, essentially any debugger, is merely a loop 
of "wait for SIGCHLD, call ptrace, repeat". If that were the problem, 
nothing would work.


Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com


___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Small debian based server distribution

2010-10-27 Thread Elazar Leibovich
On Wed, Oct 27, 2010 at 11:52 PM, Amos Shapira wrote:

> 2010/10/28 Elazar Leibovich :
> > I'm curious, since I'm having the very same problem on CentOS/RHEL. There
> > are many basic packages which just doesn't exist in the main repository
> > (say, python 2.6) and I'm not sure how to add them in a nice way to the
> > distro.
> > Currently I'm just `make install`ing it from the source, but it has all
> the
> > downsides you mentioned.
>
> rpmforge, epel and rpmfind (or google "package-name rpm") are your friends.
>
> Just configure them as additional yum repositories, rpmforge even
> provides a basic initial rpm to do just that for you.
>

I didn't find any RHEL repository/RPMs on the net that supports as rich
variety of packages, as, say, Fedora. Except of EPEL which is still not that
complete http://fedoraproject.org/wiki/EPEL/FAQ#What_is_EPEL.3F.
Do you suggest to use the Fedora repositories for RHEL? In that case it
might create dependency hell (try to install package from debian stable in
debian testing, it'll attempt to replace half of your system!)

And why isn't that relevant for Ubuntu? It seems a to be also a valid
solution there.


>
> We also build our own rpm's when we can't find them and of course for
> in-house software. Once you get the hang of it and setup a build
> environment it's a no-brainer.
>

Do share those RPMs with the community if you can!

[snipped]

> And again - for servers consider Puppet to control what goes there.
>

Heard about it,  but haven't tried it. I'll give it a look.


>
> --Amos
>
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Small debian based server distribution

2010-10-27 Thread Amos Shapira
2010/10/28 Elazar Leibovich :
> I'm curious, since I'm having the very same problem on CentOS/RHEL. There
> are many basic packages which just doesn't exist in the main repository
> (say, python 2.6) and I'm not sure how to add them in a nice way to the
> distro.
> Currently I'm just `make install`ing it from the source, but it has all the
> downsides you mentioned.

rpmforge, epel and rpmfind (or google "package-name rpm") are your friends.

Just configure them as additional yum repositories, rpmforge even
provides a basic initial rpm to do just that for you.

We also build our own rpm's when we can't find them and of course for
in-house software. Once you get the hang of it and setup a build
environment it's a no-brainer.

If you maintain servers based on packages from extra repositories then
I recommend maintaining your own local mirror of the subset of
packages you need, so there are no nasty surprises if/when they update
a package in an inconvenient time for you (e.g. in the middle of
updating multiple servers which should be identical and with a
verified version)

And again - for servers consider Puppet to control what goes there.

--Amos

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Small debian based server distribution

2010-10-27 Thread Elazar Leibovich
On Wed, Oct 27, 2010 at 10:31 PM, geoffrey mendelson <
geoffreymendel...@gmail.com> wrote:
>
>
> Because UBUNTU is not intended for people who want to customize their
> system beyond adding or subtracting whole packages. If you want a feature
> not compiled in, you can do it, but are no longer able to use their packages
> which means not using their update and dependency system.
>
> If want to add something they don't include you can, but if it depends upon
> a library they do include, there is no way to stop it from being updated and
> your program breaking.
>
>
I'm curious, since I'm having the very same problem on CentOS/RHEL. There
are many basic packages which just doesn't exist in the main repository
(say, python 2.6) and I'm not sure how to add them in a nice way to the
distro.
Currently I'm just `make install`ing it from the source, but it has all the
downsides you mentioned.
I'm not sure what's bad with Ubuntu/good with Fedora which magically solves
this problem.

(and BTW, customizing your OS beyond adding packages, is, sadly, not a great
idea in any distribution in the current Linux state of affairs)


> They also do not test very well, I've had to use older kernels when the
> latest new one would not boot.
>
> I'm all with you for that. What I really like in recent versions of
Windows, is that everything is so highly QA'd it rarely fails.  Ubuntu
managed to break during the fresh installation from the liveCD on Dell
Inspiron 1525 (ie not some bizarre hardware), I had to go through some hoops
to finish the installation.
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Small debian based server distribution

2010-10-27 Thread Tzafrir Cohen
On Wed, Oct 27, 2010 at 09:10:40PM +0200, geoffrey mendelson wrote:

> And to answer another posting I can't seem to find, IMHO anyone who uses 
> UBUNTU for anything except an out of the box desktop is as the old saying 
> goes "cruisin' for a brusin'" (asking to be beaten up).

IIRC the Ubuntu "server" install is still slightly larger than a
"Standard" Debian install. IIRC the latter does not install sshd,
rsync, and a few others (not as part of the "standard" task).

-- 
Tzafrir Cohen | tzaf...@jabber.org | VIM is
http://tzafrir.org.il || a Mutt's
tzaf...@cohens.org.il ||  best
tzaf...@debian.org|| friend

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Small debian based server distribution

2010-10-27 Thread Steve G.
I guess I fall into the generic user category, and have no particular
intention to compile or even install stuff that is not included, but the
things you mention would be a serious problem for the serious user.

Z.
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Small debian based server distribution

2010-10-27 Thread geoffrey mendelson


On Oct 27, 2010, at 11:01 PM, Amos Shapira wrote:



That's my general impression from Ubuntu - I switched to it for my
desktops for convenience, and use CentOS for the servers at work. I
never saw them actually back-porting important patches, for instance,
not even to the alleged Long Term Support (LTS) versions (but maybe I
missed).




Long term support means that if they wake up in the morning and while  
they are reading their newspaper over breakfast see an article about a  
Linux security bug, they will open a bug and backport the fix,  
eventually.


If it is something that only gets published on such obscure  
publications as Ars Technia,  etc. They will ignore it.


Geoff.
--
Geoffrey S. Mendelson,  N3OWJ/4X1GM
To help restaurants, as part of the "stimulus package", everyone must  
order dessert. As part of the socialized health plan, you are  
forbidden to eat it. :-)









___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: ptrace problem - confounded, dazed and confused at the inconsistencies

2010-10-27 Thread Amos Shapira
On 28 October 2010 06:23, Shachar Shemesh  wrote:
> Same flags to clone in both cases (vi sets the same flags, and both strace
> and fakeroot-ng change them to the same different flags).
> I'm not aware of any settings that globally affects wait's behavior.

SIGCHLD? (not global, but part of the "environment"),

--Amos

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Small debian based server distribution

2010-10-27 Thread Amos Shapira
On 28 October 2010 07:31, geoffrey mendelson
 wrote:
>
> On Oct 27, 2010, at 10:14 PM, Steve G. wrote:
>
>> And why or how is Ubuntu server different from any other linux server to
>> make it that way?

[deleted]

> Because UBUNTU is not intended for people who want to customize their system
> beyond adding or subtracting whole packages. If you want a feature not
> compiled in, you can do it, but are no longer able to use their packages
> which means not using their update and dependency system.

[rest deleted]

That's my general impression from Ubuntu - I switched to it for my
desktops for convenience, and use CentOS for the servers at work. I
never saw them actually back-porting important patches, for instance,
not even to the alleged Long Term Support (LTS) versions (but maybe I
missed).

But that said - there were a few eyebrows raised in my workplace when
we talked to a Aster Data (http://www.asterdata.com/) and they said
that their appliance is based on Ubuntu server. From talking to them
they said that they chose it because the Ubuntu kernel contains a new
feature not available in RHEL/CentOS (simply because they haven't
caught up with the latest kernel yet).

We are still evaluating them and I'm looking at options to run their
database on top of CentOS (this extra feature is not completely
essential).

--Amos

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Small debian based server distribution

2010-10-27 Thread geoffrey mendelson


On Oct 27, 2010, at 10:14 PM, Steve G. wrote:

And why or how is Ubuntu server different from any other linux  
server to make it that way?


I use ubuntu on the desktop and am quite satisfied with it. I used  
to use RedHat/Fedora and Suse/OpenSuse, until I ran into some  
unresolvable cyclical package requirements a number of time (when  
you want program A which makes you first get program B, which in  
turn requires Program A - or a similar variation with A, B and C. It  
was possible to bypass that by forcing installs, and by writing all  
the packages on one line, and other such kludges, but every package  
with the problem (the problem were with YAST and RPM) had to be  
researched first. I got disgusted, tried ubuntu and stuck with it,  
so far without similar problems.


I decided to use their server 'product' because I felt comfortable  
with the main distro, and again, have not had any problems to date -  
have not been rooted, owned or anything. Not that it can't happen,  
but I am sure it is the same with any other distro.


If I am missing something, please advise - and suggest a better  
server product with an argument why it is better. I am talking a  
generic server - ssh, ftp, httpd, nothing unique at this point.


Because UBUNTU is not intended for people who want to customize their  
system beyond adding or subtracting whole packages. If you want a  
feature not compiled in, you can do it, but are no longer able to use  
their packages which means not using their update and dependency system.


If want to add something they don't include you can, but if it depends  
upon a library they do include, there is no way to stop it from being  
updated and your program breaking.


They also do not test very well, I've had to use older kernels when  
the latest new one would not boot.


They have an attitude that deadlines are more important than function,  
so one release (was it 9.04) would not boot on an ATOM based system,  
something they knew about long before the release, but forgot to test  
it on the final version and when they did and found it would not work,  
ignored it.


Their answer to many people complaining was basicly it sucks to be you.

They often don't update packages between releases, so the bugs in the  
last release's version of Asterisk for example, stick with you until  
the next release of UBUNTU no matter when they were fixed. Yes, you  
can install your own, but it breaks their whole system.


Another example is Netatalk. Since MacOS 10.5 came out, an option that  
UBUNTU refuses to include is needed for it to work.  Same if you use a  
Mac to maintain your system via a remote X session. It will work if  
you use KDE or FVWM or twm, but not Gnome. Sucks to be you if you want  
to use their fancy graphic tools to maintain your system.


There used to be a work around, but it stopped working about a year  
and a half ago.


A generic server will be fine as long as you can live with their  
restrictions. The moment you step out of the envelope, look out.


Geoff.

--
Geoffrey S. Mendelson,  N3OWJ/4X1GM
To help restaurants, as part of the "stimulus package", everyone must  
order dessert. As part of the socialized health plan, you are  
forbidden to eat it. :-)









___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Small debian based server distribution

2010-10-27 Thread Tzafrir Cohen
On Wed, Oct 27, 2010 at 08:15:43PM +0200, Elazar Leibovich wrote:
> On Wed, Oct 27, 2010 at 6:08 PM, Oron Peled  wrote:
> 
> >
> > Hmmm you actually did a BadThing(tm) -- totally bypassing the package
> > management mechanisms:
> >
> 
> I think his idea was not to have the APT/RPM packages in this system,
> shaving off some few megabytes.

The rpm/dpkg/yum/apt programs don't take much space on their own.
However their database does.

What can you do?

1. Both yum and apt store the data they "cache" on the disk. IIRC
that can safely reside in a ramdisk. It maens longer download times if
you need to update packages.

2. Use a smaller packages repository. Maybe use a partial repo of your
distro's. There are ways to do that.

-- 
Tzafrir Cohen | tzaf...@jabber.org | VIM is
http://tzafrir.org.il || a Mutt's
tzaf...@cohens.org.il ||  best
tzaf...@debian.org|| friend

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Small debian based server distribution

2010-10-27 Thread Steve G.
And why or how is Ubuntu server different from any other linux server to
make it that way?

I use ubuntu on the desktop and am quite satisfied with it. I used to use
RedHat/Fedora and Suse/OpenSuse, until I ran into some unresolvable cyclical
package requirements a number of time (when you want program A which makes
you first get program B, which in turn requires Program A - or a similar
variation with A, B and C. It was possible to bypass that by forcing
installs, and by writing all the packages on one line, and other such
kludges, but every package with the problem (the problem were with YAST and
RPM) had to be researched first. I got disgusted, tried ubuntu and stuck
with it, so far without similar problems.

I decided to use their server 'product' because I felt comfortable with the
main distro, and again, have not had any problems to date - have not been
rooted, owned or anything. Not that it can't happen, but I am sure it is the
same with any other distro.

If I am missing something, please advise - and suggest a better server
product with an argument why it is better. I am talking a generic server -
ssh, ftp, httpd, nothing unique at this point.

Thanks!

Z.

On Wed, Oct 27, 2010 at 1:10 PM, geoffrey mendelson <
geoffreymendel...@gmail.com> wrote:

>
> On Oct 27, 2010, at 8:15 PM, Elazar Leibovich wrote:
>
>  On Wed, Oct 27, 2010 at 6:08 PM, Oron Peled  wrote:
>>
>> Hmmm you actually did a BadThing(tm) -- totally bypassing the package
>> management mechanisms:
>>
>> I think his idea was not to have the APT/RPM packages in this system,
>> shaving off some few megabytes.
>>
>
> One of the tiny linux distros did that by using APT, but not including the
> package information in the distro itself. You had to download them and
> install them, possibly with APT. I think it was DSL, but I may be wrong.
>
> And to answer another posting I can't seem to find, IMHO anyone who uses
> UBUNTU for anything except an out of the box desktop is as the old saying
> goes "cruisin' for a brusin'" (asking to be beaten up).
>
> Geoff.
>
> --
> Geoffrey S. Mendelson,  N3OWJ/4X1GM
> To help restaurants, as part of the "stimulus package", everyone must order
> dessert. As part of the socialized health plan, you are forbidden to eat it.
> :-)
>
>
>
>
>
>
>
>
>
> ___
> Linux-il mailing list
> Linux-il@cs.huji.ac.il
> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
>



-- 
Check out my web site - www.words2u.net
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Small debian based server distribution

2010-10-27 Thread Nadav Har'El
On Wed, Oct 27, 2010, Nadav Har'El wrote about "Re: Small debian based server 
distribution":
> Actually, those things *were* done, because if I remember correctly (this
> was years ago, and I can't find the code now...) I used "rpm --root" to

I just found the code - it was from 2000 ;-)

I see now that my script first searched for the appropriate (i.e., most
recently updated) version of each rpm - because this was before the advent
of yum and yum repositories. Then it built the system with rpm --root $TMPDIR.
It then had an option to exclude various types of files and directories
(e.g., /usr/share/man can be removed), and other cleanups (e.g., strip
binaries - especially shared libraries, shorten termcap file, etc.).
I also remove the RPM database because I didn't need it in the resulting
system.

Again, writing such a script took me a couple of days, but running it -
something which I later did many times - took minutes. The beauty of Unix
scripting.

I wonder if, like the original poster asked, a similar tool for creating
Ubunto (or Fedora, or whatever) based distributions, exists.

-- 
Nadav Har'El|  Wednesday, Oct 27 2010, 20 Heshvan 5771
n...@math.technion.ac.il |-
Phone +972-523-790466, ICQ 13349191 |Help Wanted: Telepath. You know where to
http://nadav.harel.org.il   |apply.

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: ptrace problem - confounded, dazed and confused at the inconsistencies

2010-10-27 Thread Shachar Shemesh

On 27/10/10 20:53, Valery Reznic wrote:

OK, you was warned :)
   

Yes, I was. Still

How can two programs do the same thing on the same system,
and yet get such different results?
 

Let's take 'read' syscall.
read(10, )

   
I am not talking about a single syscall that behaves differently. I'm 
talking about tracing the entire history of the process from the time it 
performed "execve".


If you want, I uploaded to 
http://fakeroot-ng.lingnu.com/files/clone-traces.tgz the two logs. The 
two are from strace, once tracing strace tracing vi. The second time it 
is strace attached to the fakeroot-ng daemon after that is monitoring a 
shell, and then the shell is used to run "vi". This second log continues 
until I kill the daemon to release it from the deadlock.


Both the inner strace and fakeroot-ng were instructed to issue logs of 
what they find, and you can find this log in "write" calls throughout 
the logs. The logs are, of course, not identical, but I failed to find 
any difference that should matter.


Since not all of the logs are interesting, the interesting parts start 
when the processes write that they detected an execve of /usr/bin/vi, 
and ends a couple of lines after the first time the word "clone" appears 
after that point. In the trace-strace log, you can see that after 
releasing the process to perform the clone (PTRACE_SYSCALL), it performs 
wait4 twice, and gets two notifications, one for the parent thread 
(3299) and one for the child one (3300).


In the fakeroot log, you can see the clone(RETURN) log message, 
identifying the child thread 3885 being created, but all of the waits 
performed only report the parent thread, 3884. This goes on until wait 
returns with "nothing more to report", and pselect hangs in futile wait 
for the signal to arrive.


Not in this trace, but had I sent a non-lethal signal, you would see the 
wait repeated, again saying there is nothing to report, and a hang 
again. In essence, the difference in the waits should not have happened, 
as far as I can tell, as the system calls were treated the same.

I suspect there is something like this in your case.
   
You have everything you need in order to prove you suspicion. In fact, 
strace is easilly installable from your nearest repository, as well as 
vi and bash. Many will also carry fakeroot-ng, but if not, feel free to 
pull the latest SVN image and compile it yourself.

May be there is something that strace do and fakeroot-ng don't?
   
I'm sure there is. I just can't figure out what it is. The strace code 
does not appear to have any special handling as opposed to, say, using 
clone to create a new process (which is a case which works flawlessly in 
fakeroot-ng).

Setting some flag(s) to clone? Calling some system call that affect wait 
behaviour?
   
Same flags to clone in both cases (vi sets the same flags, and both 
strace and fakeroot-ng change them to the same different flags).

I'm not aware of any settings that globally affects wait's behavior.

Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com


___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Small debian based server distribution

2010-10-27 Thread geoffrey mendelson


On Oct 27, 2010, at 8:15 PM, Elazar Leibovich wrote:


On Wed, Oct 27, 2010 at 6:08 PM, Oron Peled  wrote:

Hmmm you actually did a BadThing(tm) -- totally bypassing the  
package

management mechanisms:

I think his idea was not to have the APT/RPM packages in this  
system, shaving off some few megabytes.


One of the tiny linux distros did that by using APT, but not including  
the package information in the distro itself. You had to download them  
and install them, possibly with APT. I think it was DSL, but I may be  
wrong.


And to answer another posting I can't seem to find, IMHO anyone who  
uses UBUNTU for anything except an out of the box desktop is as the  
old saying goes "cruisin' for a brusin'" (asking to be beaten up).


Geoff.

--
Geoffrey S. Mendelson,  N3OWJ/4X1GM
To help restaurants, as part of the "stimulus package", everyone must  
order dessert. As part of the socialized health plan, you are  
forbidden to eat it. :-)









___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: ptrace problem - confounded, dazed and confused at the inconsistencies

2010-10-27 Thread Valery Reznic


--- On Wed, 10/27/10, Shachar Shemesh  wrote:

> From: Shachar Shemesh 
> Subject: ptrace problem - confounded, dazed and confused at the 
> inconsistencies
> To: "linux-il" 
> Date: Wednesday, October 27, 2010, 2:07 PM
> Hi all,

Hi, Shachar.

> 
> I know that so much as types "man ptrace" is stepping into
> uncharted territory, that I should abandon hope all ye' who
> enter here, etc.
OK, you was warned :)

> 
> How can two programs do the same thing on the same system,
> and yet get such different results?
Let's take 'read' syscall. 
read(10, )

If one program open file descriptor 10 and another - not, than obviously
read will produce different results.

I suspect there is something like this in your case.
May be there is something that strace do and fakeroot-ng don't?
Setting some flag(s) to clone? Calling some system call that affect wait 
behaviour?

Valery.
> 
> Shachar
> 
> [1] http://fakeroot-ng.lingnu.com
> 
> -- Shachar Shemesh
> Lingnu Open Source Consulting Ltd.
> http://www.lingnu.com
> 
> 
> ___
> Linux-il mailing list
> Linux-il@cs.huji.ac.il
> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
> 


  

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Small debian based server distribution

2010-10-27 Thread Elazar Leibovich
On Wed, Oct 27, 2010 at 6:08 PM, Oron Peled  wrote:

>
> Hmmm you actually did a BadThing(tm) -- totally bypassing the package
> management mechanisms:
>

I think his idea was not to have the APT/RPM packages in this system,
shaving off some few megabytes.
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Small debian based server distribution

2010-10-27 Thread Nadav Har'El
On Wed, Oct 27, 2010, Oron Peled wrote about "Re: Small debian based server 
distribution":
> Hmmm you actually did a BadThing(tm) -- totally bypassing the package
> management mechanisms:
>  * No dependency tracking -- you selected the packages by trial and error.
>...
>  * No pre/post install/uninstall  scripts are run:
>...

Actually, those things *were* done, because if I remember correctly (this
was years ago, and I can't find the code now...) I used "rpm --root" to
open the RPMs, and at the same time do all the normal dependency checking,
post/pre-install scripts, and so on. After the new tree was built,
I deliberately removed all the /etc/rpm/* stuff, because it takes up quite
a bit of space, and not needed in run time (when the system was upgraded,
it was upgrade as a whole, not using individual RPMs).

This sort of Redhat-based distribution was very easy to create - took me
a couple of days to write the code, and a few minutes to recreate the tree
when new Redhat updates came in. This replaced a system that another guy
created by hand by compiling the Linux kernel, busybox, ssh, and so on himself
and fitting all the peaces together, which took him months and was never
updated in a timely fashion when security holes were found.


-- 
Nadav Har'El|  Wednesday, Oct 27 2010, 20 Heshvan 5771
n...@math.technion.ac.il |-
Phone +972-523-790466, ICQ 13349191 |AlGoreithm, n: Repeating a calculation
http://nadav.harel.org.il   |until a prior desired result is produced.

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: ptrace problem - confounded, dazed and confused at the inconsistencies

2010-10-27 Thread shimi
On Wed, Oct 27, 2010 at 2:07 PM, Shachar Shemesh wrote:

>
> For threads, there is a strange set of events taking place. Both for strace
> and for fakeroot-ng, the clone system call gets modified. For both, the new
> thread created has the same debugger as the parent. For strace, the debugger
> runs "wait", receives the child's pid, and handles it accordingly. For
> fakeroot-ng, "wait" never reports the child.
>
> Running strace on the debugger shows that the exact same ptrace commands
> are sent. I will happily send them to anyone who wishes to have a look.
>
> How can two programs do the same thing on the same system, and yet get such
> different results?
>
>
Not that I am an expert in this (I wouldn't even say I am novice ;) just a
simple many-years-strace-user...), I am really guessing here and may be
saying complete nonsense :)

...But perhaprs it's related to the fact that in your implementation they
(the tracer and the tracee) both run on different UIDs (with the tracing
process trying to trace a process that runs by a different user [which btw
is 'more powerful']) and that's sort of a security feature?

-- Shimi
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


ptrace problem - confounded, dazed and confused at the inconsistencies

2010-10-27 Thread Shachar Shemesh

Hi all,

I know that so much as types "man ptrace" is stepping into uncharted 
territory, that I should abandon hope all ye' who enter here, etc.


Background - I am maintainer and author of an open source program called 
"fakeroot-ng"[1]. This program uses the ptrace interface in order to 
fool programs running into thinking they are running as the root user. 
Part of the magic needs to be to be able to continue tracing processes, 
even after they spawn new processes, threads, etc.


There is a small utility that I hope most of you know (and if you don't, 
install and read its manual now. It is on the must know list) called 
"strace". It runs a process through the ptrace interface, dumping to the 
screen or a file all system calls that said process is performing. If 
the "-f" flag is given to strace, it, too, will try to keep child 
processes and threads under its control. Being the unoriginal bloke that 
I am, I shamelessly and without remorse copied strace's way of doing 
this into fakeroot-ng.


In a nutshell, all "forks" and other forms are mapped into a call to the 
"clone" system call. The flag "CLONE_PTRACE" is added to the call. As a 
result, the kernel is certain that the process asked it to attach the 
parent's debugger to the child. For processes, this works beautifully, 
both for fakeroot-ng and for strace.


For threads, there is a strange set of events taking place. Both for 
strace and for fakeroot-ng, the clone system call gets modified. For 
both, the new thread created has the same debugger as the parent. For 
strace, the debugger runs "wait", receives the child's pid, and handles 
it accordingly. For fakeroot-ng, "wait" never reports the child.


Running strace on the debugger shows that the exact same ptrace commands 
are sent. I will happily send them to anyone who wishes to have a look.


How can two programs do the same thing on the same system, and yet get 
such different results?


Shachar

[1] http://fakeroot-ng.lingnu.com

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com


___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Small debian based server distribution

2010-10-27 Thread Nadav Har'El
On Wed, Oct 27, 2010, Elazar Leibovich wrote about "Small debian based server 
distribution":
> The default installation of Debian, without X, is about 600-800 Megabytes.
> I'm looking for a debian compatible distribution (so that I'll be able to
> use debian's security updates, and enjoy the breadth of packages etc) which
> will be small and will contain only the bare minimum for a functional server
> (say, sshd and busybox). I wish it'll be as small as possible (say, ~100Mb).

I once did something like this for Redhat.

Basically, I took all the redhat RPMs and wrote a script which takes a list
of RPMs and opens them up in a directory, which I later copied to the target
machine. Choosing the right set of RPMs took some experimentation, but wasn't
too difficult. I ended up with a Linux system with sshd, busybox, httpd,
and not much more, in much less than 100 MB.

Like you said, the beautiful thing about the whole concept is that whenever
Redhat released updates, I could just run this script again and automatically
build an updated distribution - much easier than needing to create my own
distribution from scratch.

I don't know if anything of this sort exists for Debian. I would be surprised
if it didn't.


-- 
Nadav Har'El|  Wednesday, Oct 27 2010, 19 Heshvan 5771
n...@math.technion.ac.il |-
Phone +972-523-790466, ICQ 13349191 |"Did you sleep well?" "No, I made a
http://nadav.harel.org.il   |couple of mistakes."

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Small debian based server distribution

2010-10-27 Thread Tzafrir Cohen
On Wed, Oct 27, 2010 at 01:20:36PM +0200, Elazar Leibovich wrote:
> On Wed, Oct 27, 2010 at 12:06 PM, Tzafrir Cohen wrote:
> 
> >
> > The Debian packages are sorted by "priorites":
> >
> > http://www.debian.org/doc/debian-policy/ch-archive.html#s-priorities
> > By default, all the "standard" packages are installed.
> >
> 
> Thanks!
> Do you happen to know what's the approximated size of debian important +
> sshd?

Start with:

  debootstrap --include openssh-server stable stable-chroot

-- 
Tzafrir Cohen | tzaf...@jabber.org | VIM is
http://tzafrir.org.il || a Mutt's
tzaf...@cohens.org.il ||  best
tzaf...@debian.org|| friend

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Small debian based server distribution

2010-10-27 Thread Elazar Leibovich
On Wed, Oct 27, 2010 at 12:06 PM, Tzafrir Cohen wrote:

>
> The Debian packages are sorted by "priorites":
>
> http://www.debian.org/doc/debian-policy/ch-archive.html#s-priorities
> By default, all the "standard" packages are installed.
>

Thanks!
Do you happen to know what's the approximated size of debian important +
sshd?
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Small debian based server distribution

2010-10-27 Thread Tzafrir Cohen
On Wed, Oct 27, 2010 at 11:12:20AM +0200, Elazar Leibovich wrote:
> The default installation of Debian, without X, is about 600-800 Megabytes.
> I'm looking for a debian compatible distribution (so that I'll be able to
> use debian's security updates, and enjoy the breadth of packages etc) which
> will be small and will contain only the bare minimum for a functional server
> (say, sshd and busybox). I wish it'll be as small as possible (say, ~100Mb).

The Debian packages are sorted by "priorites":

http://www.debian.org/doc/debian-policy/ch-archive.html#s-priorities
By default, all the "standard" packages are installed.

If you want to override the package selection at install time, the
standard way to do that is using preseeding:

http://www.debian.org/releases/stable/i386/apb.html.en
http://www.debian.org/releases/stable/i386/apbs04.html.en#preseed-pkgsel

That said, replacing coreusitls with busybox will not happen any time
soon in the main Debian release. There are some guys actively trying to
do similar things, and they tend to hang around http://emdebian.org .

For instance, http://www.emdebian.org/grip/

-- 
Tzafrir Cohen | tzaf...@jabber.org | VIM is
http://tzafrir.org.il || a Mutt's
tzaf...@cohens.org.il ||  best
tzaf...@debian.org|| friend

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Small debian based server distribution

2010-10-27 Thread Baruch Siach
Hi Elazar

On Wed, Oct 27, 2010 at 11:12:20AM +0200, Elazar Leibovich wrote:
> The default installation of Debian, without X, is about 600-800 Megabytes.
> I'm looking for a debian compatible distribution (so that I'll be able to
> use debian's security updates, and enjoy the breadth of packages etc) which
> will be small and will contain only the bare minimum for a functional server
> (say, sshd and busybox). I wish it'll be as small as possible (say, ~100Mb).

You may try Emdebian Grip which should be binary compatible with Debian.  See 
http://www.emdebian.org/ and http://www.emdebian.org/grip/.

baruch

-- 
 ~. .~   Tk Open Systems
=}ooO--U--Ooo{=
   - bar...@tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Small debian based server distribution

2010-10-27 Thread Elazar Leibovich
The default installation of Debian, without X, is about 600-800 Megabytes.
I'm looking for a debian compatible distribution (so that I'll be able to
use debian's security updates, and enjoy the breadth of packages etc) which
will be small and will contain only the bare minimum for a functional server
(say, sshd and busybox). I wish it'll be as small as possible (say, ~100Mb).

I don't like DSL style distributions, as most are more geared towards the
desktop, and they have their own package management system.

I'm sure many others needed such a debian flavour, but I didn't find the
right search phrase for Google.

Thanks
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il