amrahsa wrote:
Hi All,
I want to write a daemon in Linux which would be calling my perl script to read some apache configuration when the System boots up. Here is what i am doing 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

For Solaris the start-up controller is in /etc/init.d


#! /usr/bin/perl

use strict;
use warnings;

opendir TARGETDIR, "/etc/init.d" or die "$! during Directory Read";
    my @allfiles = grep !/^\./, readdir TARGETDIR;
closedir TARGETDIR;

foreach my $file (@allfiles) {
    last if $file =~ /apache|http/i;
}

open (ROFILE, "$file") or die "$! during File Read";

# process file ...

You can decide which CPAN module to mimic that being
implemented as a daemon.

HTH/Bill
--
_Sx_ http://youve-reached-the.endoftheinternet.org/ _________________________________________________________________
perl -MMIME::Base64 -e 'print decode_base64("SnVzdCBvbmUgbW9yZSBQb3N0Zml4IDIuMnggU25hcHNob3QgRmlsdGVyLCBwbGVhc2UK");'


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to