On Apr 24, 2004, at 2:46 AM, amrahsa wrote: [..]
1) When the system boots up I found in which run level System boots up and go to corresponding directory e.g. /etc/rc.d/rc3.d[..]
2) I look for Sxxapache or Sxxhttp file to see if apache startup file is there
Now my problem is one apache startup The configuration file Sxxapache or Sxxhttp has used some configuration file based on some shell script to invoke the configuration file as parameter and i need to know that file in my daemon to read that file e.g. httpd.conf file
If you have any idea please help me to resolve this problem.
Let me see if I get your core problem here,
you want to parse out the httpd.conf but you want to find it 'dynamically' based upon what is in the /etc/rc.d/rc3.d section?
you do understand that you could find the 'init script' for apache in
/etc/rc.d/apache
on SuSe distributions, while on Red Hat you would need to be looking for
/etc/rc.d/init.d/httpd
eg:
disky: 62:] ls -li ./init.d/httpd ./rc3.d/S99httpd
1055235 -rwxr-xr-x 1 root root 2245 Dec 10 02:05 ./init.d/httpd
97370 lrwxrwxrwx 1 root root 22 Aug 7 2002 ./rc3.d/S99httpd -> /etc/rc.d/init.d/httpd
disky: 63:]
so clearly first off you can figure out which version of linux you are playing with by how they did their lay out - and there is little real 'useful' information that is in those init scripts to begin with. The line you would of course be interested in is
[ -r /etc/sysconfig/apache ] && . /etc/sysconfig/apache
the other line where it is 'including' anything is merely the shell library of rc_init functions that is common to all of the rc scripts.
So what you really want to be resolving is whether you will find the httpd.conf in say
/etc/httpd/conf/httpd.conf
or not - since reasonable folks do not generally stuff shell variables into /etc/sysconfig/apache
At which point there is the other odd question that comes to mind, why? What is it you are really trying to work out ? Why not talk to the httpd directly?
ciao drieux
---
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>