in reply to Re^4: [SOLVED] Configuring Apache VirtualHosts using mod_perl 2
in thread [SOLVED] Configuring Apache VirtualHosts using mod_perl 2

All I can tell from this is that the config is indeed executed twice (as mentioned in the OP) but the actual messages don't mean much to me.

Fudge() is only meaningful immediately after a system call, therefore

my @fudge; while ( my $user = getpwent() ) { $users{$user} = 1; } push @fudge, Fudge(); while ( my $group = getgrent() ) { $groups{$group} = 1; } push @fudge, Fudge(); open (my $fh, '>>', '/var/log/httpd/fudge.log') or die Fudge("fudge.lo +g"); print $fh Fudge() or die Fudge("print fudge.log"); close $fh or die Fudge("close fudge.log"; undef @fudge; sub Fudge { use Errno(); join qq/\n/, "Error @_", map { " $_" } int( $! ) . q/ / . $!, int( $^E ) . q/ / . $^E, grep( { $!{$_} } keys %! ), q/ /; }

Replies are listed 'Best First'.
Re^6: [SOLVED] Configuring Apache VirtualHosts using mod_perl 2
by FloydATC (Deacon) on Dec 04, 2014 at 07:17 UTC

    Hmm. That didn't actually dump the array @fudge so I made one or two changes:

    # For the mongers my @fudge; while ( my $user = getpwent() ) { $users{$user} = 1; } push @fudge, Fudge()."\n"; while ( my $group = getgrent() ) { $groups{$group} = 1; } push @fudge, Fudge(),"\n"; open (my $fh, '>>', '/var/log/httpd/fudge.log') or die Fudge("fudge.lo +g"); print $fh Fudge() or die Fudge("print fudge.log"); foreach my $line (@fudge) { print $fh $line; } close $fh or die Fudge("close fudge.log"); undef @fudge; sub Fudge { use Errno(); join qq/\n/, "Error @_", map { " $_" } int( $! ) . q/ / . $!, int( $^E ) . q/ / . $^E, grep( { $!{$_} } keys %! ), q/ /; }

    Cleared the log and restarted httpd, this is what I got:

    $ cat /var/log/httpd/fudge.log Error 25 Inappropriate ioctl for device 25 Inappropriate ioctl for device ENOTTY Error 2 No such file or directory 2 No such file or directory ENOENT Error 2 No such file or directory 2 No such file or directory ENOENT Error 25 Inappropriate ioctl for device 25 Inappropriate ioctl for device ENOTTY Error 2 No such file or directory 2 No such file or directory ENOENT Error 2 No such file or directory 2 No such file or directory ENOENT
    -- FloydATC

    Time flies when you don't know what you're doing

      Well then :) thats interesting

      Makes me think of chroot and child processes without STDIN/STDOUT/STDERR and with different $PATH or other vars ...

      ENOTTY getpwent -> getlogin man page on HP-UX

      So not exactly on point but same ballpark ... apache is creating some kind of limited child processes ... i've seen this on win32 ...

      Next step I might take would be strace :)

      Or just kick the report up the chain (mod_perl, apache, ossupport..??)

      Maybe consult some crontab ... faqs..

      Neat :)

        I don't know much about the technicalities of it, but CentOS 7 uses systemd which is running Apache inside a 'slice', this is unlike previous versions of CentOS which used the SysV init style where things more or less run in the root environment. As far as I understand, the idea is to offer each daemon a "clean" running environment where daemons won't interfere with eachother.

        $ systemctl status httpd httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled) Active: active (running) since Thu 2014-12-04 08:13:07 CET; 2h 9min + ago Process: 16316 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, st +atus=0/SUCCESS) Main PID: 16321 (/usr/sbin/httpd) Status: "Total requests: 3; Current requests/sec: 0; Current traffi +c: 0 B/sec" CGroup: /system.slice/httpd.service +-16321 /usr/sbin/httpd -DFOREGROUND +-16326 /usr/sbin/httpd -DFOREGROUND +-16327 /usr/sbin/httpd -DFOREGROUND +-16328 /usr/sbin/httpd -DFOREGROUND +-16329 /usr/sbin/httpd -DFOREGROUND +-16330 /usr/sbin/httpd -DFOREGROUND +-16405 /usr/sbin/httpd -DFOREGROUND
        -- FloydATC

        Time flies when you don't know what you're doing