Current time: 04-27-2024, 09:31 AM Hello There, Guest! (LoginRegister)


Post Reply 
[SOLVED has patch(sorta)] ispcp-dmn-mngr using 3.8g virt (swap)
Author Message
supaplex Offline
Junior Member
*

Posts: 22
Joined: Jan 2009
Reputation: 0
Post: #3
[SOLVED+patch(sorta)] ispcp-dmn-mngr using 3.8g virt (swap)
I think we've solved this issue.
I apologize for no unified diff, but I didn't back up all the scripts :)

joe:/var/www/ispcp/engine# wc /etc/apache2/sites-available/ispcp.conf
16783 51294 745193 /etc/apache2/sites-available/ispcp.conf
joe:/var/www/ispcp/engine# wc last-working-apache2.ispcp.conf
19052031 51294 19780406 last-working-apache2.ispcp.conf

See how we're using the same number of words? Scary...

All in all, if someone runs into this on rc5, or has similar amount of newlines in the config, perhaps they should delete all those extra newlines. :) I'm going to tweak the code to let the normal ones back in, in preparation for upgrade.

Geeks and desperate sysadmins, keep reading. :)

ispcp_common_methods.pl get_file was using

@fdata= <F>;

The ispcp.conf file has a few megabytes worth of newlines only at the tail end.

Now it's using

push_el(\@main::el, 'get_file()', "DEBUG: Opening '$fname' now.");
my $res = open(F, '<', $fname);

if (!defined($res)) {
push_el(\@main::el, 'get_file()', "ERROR: Can't open '$fname' for reading: $!");
return 1;
}

my @fdata;

if ($fname =~ m/ispcp.conf/) {
while (<F>) {
if (length($_) le 1) {
next;
}
# print length($_)." ";
push (@fdata,$_);
}
} else {
@fdata= <F>;
}

push_el(\@main::el, 'get_file()', "DEBUG: Closing '$fname' now.");
close(F);


After that clean up, domains were able to add. However, they were not able to delete. The stdout error message said get_tag() | ERROR: '# httpd [example.com] dmn group entry BEGIN.
' ne '# httpd [example.com] dmn group entry END.

', '# httpd [example.com] dmn group entry BEGIN.
' or '# httpd [example.com] dmn group entry END.

At the first 10 glances, ne means not equal to me. This is the new code I wrote for get_tag. (commented push_el line is the old one)

if ($bt_pos < 0 || $et_pos < 0) {

# code uses 'ne' as if it were perl ... that's just crewel to my graymatter. ouch!
# push_el(\@main::el, 'get_tag()', "ERROR: '$bt' ne '$et', '$bt' or '$et' missing in src !");

push_el(\@main::el, 'get_tag()', "ERROR: No BEGIN marker in ".length($src)." lines of config block: $bt")
if ($bt_pos < 0);
push_el(\@main::el, 'get_tag()', "ERROR: No END marker in ".length($src)." lines of config block: $et")
if ($et_pos < 0);

return (-5, '');

}

When the obvious wasn't comparing, I rolled back in the code (perldoc -f caller is my friend). Eventually I found we were called by dmn_del_httpd_cfg_data.

dmn_del_httpd_cfg_data makes a call to del_tag which needed a newline deleted here for domains to compare.

"$dg_e_val\n", # <<< bad newline! can't delete domains this way. grr

Okay, I don't suggest anyone but the developers tackle the issue on the above line. Naturally, from the first post, we see that gigabytes and gigabytes of ram is a bad thing to waste. :) Had I known what the underlying issue was before I fixed it, this little detail would be of no matter.
01-25-2009 09:36 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
[SOLVED+patch(sorta)] ispcp-dmn-mngr using 3.8g virt (swap) - supaplex - 01-25-2009 09:36 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)