Re: [fpc-pascal] Detecting what is the linux distro

2010-10-12 Thread Graeme Geldenhuys
On 11 October 2010 20:51, ik ido...@gmail.com wrote:

 It's sad to see that there is no specific way to get this information on all
 distro's but at least I can get it on the most used distros out there.

A general problem under Linux (and it's hundreds of distros). That is
why I think it is so important to support freedesktop.org and LSB
Foundation (Linux Standards Base). They are trying really hard to
resolve these problems, *plus* make it easier for software developers
to integrate there applications. Luckily the most popular distros
(covering probably 90% of linux usage) do try and follow those
standards.


-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net:8080/fpgui/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Detecting what is the linux distro

2010-10-12 Thread Henry Vermaak
On 11 October 2010 19:51, ik ido...@gmail.com wrote:
 Thanks all for the answers.

 It's sad to see that there is no specific way to get this information on all
 distro's but at least I can get it on the most used distros out there.

Just curious, why would you like to detect this?

Henry
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Detecting what is the linux distro

2010-10-12 Thread Graeme Geldenhuys
On 12 October 2010 09:30, Henry Vermaak  wrote:

 Just curious, why would you like to detect this?

I don't know about the original poster, but I for one use such
information for our custom security components - generating trial
unlock keys for our commercial software.


-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net:8080/fpgui/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Detecting what is the linux distro

2010-10-12 Thread ik
On Tue, Oct 12, 2010 at 09:30, Henry Vermaak henry.verm...@gmail.comwrote:

 On 11 October 2010 19:51, ik ido...@gmail.com wrote:
  Thanks all for the answers.
 
  It's sad to see that there is no specific way to get this information on
 all
  distro's but at least I can get it on the most used distros out there.

 Just curious, why would you like to detect this?


You want to know how to install files for daemons, append information in
other existed packages etc... But instead of creating 1000% packages types
for each distro, you can for example know  that Gentoo and ArchLinux uses
/etc/rc.d/ for init deamons.
You know that Debian, CentOS, RedHat and few others uses /etc/init.d/ etc...


BTW I had a program that created in my ArchLinux /etc/init.d/ and placed it
there, while i was the wrong location.



 Henry
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal





Ido

LINESIP websites:
http://www.linesip.com
http://www.linesip.co.il
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: Disk Full

2010-10-12 Thread Sven Barth

Am 12.10.2010 09:51, schrieb Sven Barth:
[4 times the same mail]

Sorry for the spam, but Thunderbird reported an error which wasn't one. 
*blush*


Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Disk Full

2010-10-12 Thread Sven Barth

Am 11.10.2010 00:16, schrieb Bernd Kreuss:

from rtl/win/syswin.inc:


DLL_THREAD_ATTACH :
  begin
inclocked(Thread_count);

WinEnterCriticalSection(AttachingThread);
if Win32GetCurrentThreadId  MainThreadIdWin32 then
begin
  { Allocate Threadvars  }
  SysAllocateThreadVars;

  { NS : no idea what is correct to pass here - pass dummy value 
for now }
  { passing a dummy is ok, the correct value is read from the coff 
header of SysInstance (FK) }
  InitThread($100); { Assume everything is idempotent there, as 
the thread could have been created with BeginThread... }
end;

if assigned(Dll_Thread_Attach_Hook) then
  Dll_Thread_Attach_Hook(DllParam);
Dll_entry:=true; { return value is ignored }
WinLeaveCriticalSection(AttachingThread);
 end;


will this also work when some object in my own dll is starting a thread
with TThread that is already properly initialized or will it then try to
initialize it twice?


Although you've said that you've found the problem: yes, that is a 
concern that occured to me as well after I reported the problem of the 
AttachingThread critical section. I'll need to look into it what 
problems there really could arise and how it might be fixed.


Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Disk Full

2010-10-12 Thread Sven Barth

Am 11.10.2010 00:16, schrieb Bernd Kreuss:

from rtl/win/syswin.inc:


DLL_THREAD_ATTACH :
  begin
inclocked(Thread_count);

WinEnterCriticalSection(AttachingThread);
if Win32GetCurrentThreadId  MainThreadIdWin32 then
begin
  { Allocate Threadvars  }
  SysAllocateThreadVars;

  { NS : no idea what is correct to pass here - pass dummy value 
for now }
  { passing a dummy is ok, the correct value is read from the coff 
header of SysInstance (FK) }
  InitThread($100); { Assume everything is idempotent there, as 
the thread could have been created with BeginThread... }
end;

if assigned(Dll_Thread_Attach_Hook) then
  Dll_Thread_Attach_Hook(DllParam);
Dll_entry:=true; { return value is ignored }
WinLeaveCriticalSection(AttachingThread);
 end;


will this also work when some object in my own dll is starting a thread
with TThread that is already properly initialized or will it then try to
initialize it twice?


Although you've said that you've found the problem: yes, that is a 
concern that occured to me as well after I reported the problem of the 
AttachingThread critical section. I'll need to look into it what 
problems there really could arise and how it might be fixed.


Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Detecting what is the linux distro

2010-10-12 Thread David W Noon
On Tue, 12 Oct 2010 09:54:35 +0200, ik wrote about Re: [fpc-pascal]
Detecting what is the linux distro:

 On Tue, Oct 12, 2010 at 09:30, Henry Vermaak
 henry.verm...@gmail.comwrote:
[snip]
  Just curious, why would you like to detect this?
 
 
 You want to know how to install files for daemons, append information
 in other existed packages etc... But instead of creating 1000%
 packages types for each distro, you can for example know  that Gentoo
 and ArchLinux uses /etc/rc.d/ for init deamons.
 You know that Debian, CentOS, RedHat and few others uses /etc/init.d/
 etc...

Both of those directories are used by virtually all UNIX
implementations. /etc/init.d/ contains the init scripts for system
daemons, whereas /etc/rc.d/ contains the configuration files that are
interpolated into the init scripts to establish environment variables
for the daemons.  These directories do not have an either/or
relationship.

This is a consequence of using an init process based on the System V
model.

Why don't you just use a package manager, such as apt/dpkg, Portage,
RPM, etc., instead?  Most distros can handle more than one of these.
For example, I run Gentoo, and it will handle .deb and .rpm packages,
as well as its native Portage ebuilds.
-- 
Regards,

Dave  [RLU #314465]
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
david.w.n...@ntlworld.com (David W Noon)
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


signature.asc
Description: PGP signature
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Detecting what is the linux distro

2010-10-12 Thread Sven Barth

Am 12.10.2010 14:01, schrieb David W Noon:

On Tue, 12 Oct 2010 09:54:35 +0200, ik wrote about Re: [fpc-pascal]
Detecting what is the linux distro:


On Tue, Oct 12, 2010 at 09:30, Henry Vermaak
henry.verm...@gmail.comwrote:

[snip]

Just curious, why would you like to detect this?



You want to know how to install files for daemons, append information
in other existed packages etc... But instead of creating 1000%
packages types for each distro, you can for example know  that Gentoo
and ArchLinux uses /etc/rc.d/ for init deamons.
You know that Debian, CentOS, RedHat and few others uses /etc/init.d/
etc...


Both of those directories are used by virtually all UNIX
implementations. /etc/init.d/ contains the init scripts for system
daemons, whereas /etc/rc.d/ contains the configuration files that are
interpolated into the init scripts to establish environment variables
for the daemons.  These directories do not have an either/or
relationship.

This is a consequence of using an init process based on the System V
model.



ArchLinux does not use a System V init system, but a simpler BSD one. 
And thus it does not use /etc/init.d, but only /etc/rc.d.



Why don't you just use a package manager, such as apt/dpkg, Portage,
RPM, etc., instead?  Most distros can handle more than one of these.
For example, I run Gentoo, and it will handle .deb and .rpm packages,
as well as its native Portage ebuilds.


ArchLinux handles only its own ArchLinux Package Manager format 
(basically a .tar.gz with some script files) - as far as I'm aware of.


Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Detecting what is the linux distro

2010-10-12 Thread David W Noon
On Tue, 12 Oct 2010 16:29:42 +0200, Sven Barth wrote about Re:
[fpc-pascal] Detecting what is the linux distro:

 Am 12.10.2010 14:01, schrieb David W Noon:
[snip]
  This is a consequence of using an init process based on the System V
  model.
 
 ArchLinux does not use a System V init system, but a simpler BSD one. 
 And thus it does not use /etc/init.d, but only /etc/rc.d.

So does the BSD init use run levels?  One of the major distinctions
between /etc/init.d/ and /etc/rc.d is that the latter is segregated by
run levels, so that each daemon can have a different environment for
different run levels.  All of the actual init scripts in my /etc/rc.d/
ultimately resolve to symlinks into /etc/init.d/, which is typical for
any System V style system.

Indeed, this makes installing a script directly into /etc/rc.d/ a
strict no-no under Gentoo, as all insertions into a run level have to
be performed by the sysadmin by hand; other Linuxes are more
permissive, though.  Consequently, I would never want any program to
install anything into that directory, except by the rc-update program
run by hand.
-- 
Regards,

Dave  [RLU #314465]
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
david.w.n...@ntlworld.com (David W Noon)
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


signature.asc
Description: PGP signature
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Detecting what is the linux distro

2010-10-12 Thread ik
It's not just that. Lets say you have a UI for IPTables. In Redhat based, it
will be located under /etc/sysconfig/iptables . On debian based, it should
be under /etc/networking/post-config or something like that (don't have a
debian based machine here), and so on...

Please note that I do not talk about exited scripts such as Arno's scripts
or shorewall, just plain IPTables client, and it's different on each distro.

If you require to read settings of the system (that located at /etc/), no
one guarantee you that all distro's will store then at the same place.

That's the reason why so many software/driver vendors are so reluctant to
release Linux support.
For example Foomatic drivers for CUPS, the drivers of the printers in Mac
OS-X are the same as with Linux, but many vendors ignore Linux just because
this mess.

So it's not just lets create a package and get over with it, It's not that
simple.

Ido

LINESIP websites:
http://www.linesip.com
http://www.linesip.co.il




On Tue, Oct 12, 2010 at 14:01, David W Noon david.w.n...@ntlworld.comwrote:

 On Tue, 12 Oct 2010 09:54:35 +0200, ik wrote about Re: [fpc-pascal]
 Detecting what is the linux distro:

  On Tue, Oct 12, 2010 at 09:30, Henry Vermaak
  henry.verm...@gmail.comwrote:
 [snip]
   Just curious, why would you like to detect this?
  
 
  You want to know how to install files for daemons, append information
  in other existed packages etc... But instead of creating 1000%
  packages types for each distro, you can for example know  that Gentoo
  and ArchLinux uses /etc/rc.d/ for init deamons.
  You know that Debian, CentOS, RedHat and few others uses /etc/init.d/
  etc...

 Both of those directories are used by virtually all UNIX
 implementations. /etc/init.d/ contains the init scripts for system
 daemons, whereas /etc/rc.d/ contains the configuration files that are
 interpolated into the init scripts to establish environment variables
 for the daemons.  These directories do not have an either/or
 relationship.

 This is a consequence of using an init process based on the System V
 model.

 Why don't you just use a package manager, such as apt/dpkg, Portage,
 RPM, etc., instead?  Most distros can handle more than one of these.
 For example, I run Gentoo, and it will handle .deb and .rpm packages,
 as well as its native Portage ebuilds.
 --
 Regards,

 Dave  [RLU #314465]
 *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
 david.w.n...@ntlworld.com (David W Noon)
 *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Detecting what is the linux distro

2010-10-12 Thread Henry Vermaak
On 12 October 2010 17:06, ik ido...@gmail.com wrote:
 It's not just that. Lets say you have a UI for IPTables. In Redhat based, it
 will be located under /etc/sysconfig/iptables . On debian based, it should
 be under /etc/networking/post-config or something like that (don't have a
 debian based machine here), and so on...

 Please note that I do not talk about exited scripts such as Arno's scripts
 or shorewall, just plain IPTables client, and it's different on each distro.

 If you require to read settings of the system (that located at /etc/), no
 one guarantee you that all distro's will store then at the same place.

You can't rely on these things.  Distros will even change things from
version to version.  That is why you put things in configuration files
and let the maintainers/packagers supply the correct settings in the
config files for their distro.  This is how hundreds of apps do
things.

 That's the reason why so many software/driver vendors are so reluctant to
 release Linux support.

Nonsense.  Most vendors are lazy, some are scared of licensing, etc.
Most importantly they think they can get away with not supporting
linux because of the small market share.  For now.

Henry
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Detecting what is the linux distro

2010-10-12 Thread Marco van de Voort
In our previous episode, David W Noon said:
  ArchLinux does not use a System V init system, but a simpler BSD one. 
  And thus it does not use /etc/init.d, but only /etc/rc.d.
 
 So does the BSD init use run levels? 

Yes.

 One of the major distinctions
 between /etc/init.d/ and /etc/rc.d is that the latter is segregated by
 run levels, so that each daemon can have a different environment for
 different run levels.

..  but the mark of the sysV layout is the script per daemon per runtime
level. Sometimes it is simplified by making symlinks though.

While classic (pre SysV) Unix (including BSD) has just one or two scripts
that handle everything.

Modern BSD (like current FreeBSD) currently afaik do have a script per
daemon btw, just not the added dimension of runlevels.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal