Results 1 to 8 of 8
Dear All,
In the windows development, the configuration of a service applicatoin would be put into the system registery or the individual .ini file. For the .ini file, there are ...
- 06-05-2008 #1Just Joined!
- Join Date
- May 2008
- Posts
- 17
Built-in API for the maintenance of /etc/conf configuration file
Dear All,
In the windows development, the configuration of a service applicatoin would be put into the system registery or the individual .ini file. For the .ini file, there are built-in API to help programmer access the settings in the .ini file.
On the other hand, for lost of linux daemon services, their configuration files are put into the /etc/conf. Is there any built-in API of linux to help programmer to maintain the configuration file easily in the /etc/conf directory.
Thanks very much for you to share your valuable experience.
Best Regards,
Rike_Lin.
- 06-06-2008 #2Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
Unfortunately, most of the stuff regarding the init system and system services is highly dependant on the distro. The standarisation would be something good, but it's difficult because each distro uses a different init system that ranges from system v init to bsd-like, including many modified styles in the middle like the Gentoo one.
Individual apps, like ssh or bash are consistent amongst distros, but to know how their config files are layed out you will need to check the man pages and sample config files on an app by app basis.
- 06-07-2008 #3Just Joined!
- Join Date
- May 2008
- Posts
- 17
Dear Sir,
Thanks very much for your kindly help. I understand the issue of different distributions. If I focus on one distriubtion (any one of them), do you know it supprt such built-in API to facilicate the configuration programming? Thanks!
Best Regards,
Rike_Lin.
- 06-07-2008 #4Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
I don't think so. At least, I never heard of it. At most, there are programs to configure specific subsets. There are programs to configure the init services. Lots of distros can share that if they use a system V init scheme, because it's always the same.
Some distros, like SuSE, Ubuntu or Mandriva have a centralized program to configure everything, but if that's what you wanted you wouldn't be asking here, I guess.
I never bothered to look into this, but I know that the SuSE yast tool is very good, so maybe it's worth to look at it to see how it does the things... Maybe you can borrow some ideas or addapt it to your needs. I know it's not much, but due to the very different nature of the config files for each program it's the best advise I can give right now.
- 06-07-2008 #5Linux Engineer
- Join Date
- Apr 2006
- Location
- Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
- Posts
- 1,117
Hi.
The webmin program, Webmin , attempts to make life easier for system administrators across many distributions. It makes use of built-in knowledge of structures, formats, layouts of many configuration files. The only "API" that I know of in *nix for such files is the text file idea in general ... cheers, drlWelcome - get the most out of the forum by reading forum basics and guidelines: click here.
90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
We look forward to helping you with the challenge of the other 10%.
( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )
- 06-09-2008 #6Just Joined!
- Join Date
- May 2008
- Posts
- 17
Dear i92guboj and drl,
Thanks very much for you to share your idea. I will look forward to study it and then exchange some thoughts with you.
BTW, if there's no built-in API and you know that some utilities/small software packages focus to provide this feature, please share with me. As I known, the XML configuration seems to be a newer format. Is it good for configuraiton file? Thanks.
Best Regards,
Rike_Lin
- 06-09-2008 #7Linux Engineer
- Join Date
- Apr 2006
- Location
- Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
- Posts
- 1,117
HI.
See http://www.linuxforums.org/forum/lin...-linux.html#10 for a brief note about a perl module that can handle MS-like INI files.
I tend to follow D Conway's advice:
Don't use XML as your configuration file format. It may be human-readable, but it's almost never human-comprehensible ...
-- Perl Best Practices, page 446Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
We look forward to helping you with the challenge of the other 10%.
( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )
- 06-09-2008 #8Just Joined!
- Join Date
- May 2008
- Posts
- 17
Dear drl,
Thanks very much for your kindly reply. I would study your suggestion, perl, first.
Best Regards,
Rike_Lin.


Reply With Quote