Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 2nd October 2005, 13:56
linuxfast linuxfast is offline
Member
 
Join Date: Sep 2005
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems with groups/grpconv

Last night I decided to migrate all my users/sites to my ISPConfig server.
All appeared to be going well....

After adding maybe 10 sites and over 100 email accounts, I noticed a strange problem. Files that were usually owned by root root where now showing root 1
I looked at the /etc/group file and to my horror all my groups had disappeared and the only lines left in there where the last 5 groups added by ISPConfig.
I am uncertain why this happened but I am guessing it may be because my usernames had hyphens in them (-). Can anyone confirm that this may be true or is true ?

On further investigation, I found that each time I added/changed users in ISPConfig, a grpconv command was executed which ran at 100% cpu and 100% mem, and eventually was killed with an Out Of Memory message in the messages file.

After googling for a while, I found that grpconv can go into an endless loop until killed with an OOM.
I do not know whether the original corruption of /etc/group and /etc/gshadow was a result of the grpconv hanging or whether the grpconv hanging was a result of the corruption.
After manually fixing the group and gshadow files, I ran grpck which found some duplicate entries and some other small problems.
grpconv now executes fast and without problems.

One thing I do notice however, is that groups created by ISPConfig, for instance:

web1:x:10001:admispconfig,adminuser

When web1 has been deleted, this group remains and is not deleted. Is this normal or have I got another problem here ? If it IS normal, would it not be better for the group to be deleted also, once the web has been removed from the recycle bin ?

This brings me onto another issue..... after playing around with ISPConfig, and removing it and reinstalling it etc, ISPConfig seems to have no regard for already assigned UIDs. It seems to always start with 10001 regardless of whether this is already in use or not. .This causes immediate problems with /etc/passwd and /etc/group (and may have been the initial cause of my problems).
ISPConfig needs to check that UIDs are not in use before it decides to use them itself !!
My advice to anyone would be to make a backup of /etc/passwd /etc/shadow /etc/group and /etc/gshadow before installing ISPConfig just in case there are problems later, in fact after this experience I will be making backups of these 4 files on every server that I have.

Any comments Falko/Till ? My server seems to be running spot on now so I am happy again, but it's been a hell of a 24hrs

Edit:
If I add a new group manually for something, for instance:

groupadd testgroup

this group is assinged the next ID, which will be 1 higher than the last ispconfig site.
If you then add a new site in ISPConfig, it doesn't check for the next id, it just knows the last one it created itself so uses the same one that testgroup took.

Last edited by linuxfast; 2nd October 2005 at 14:06.
Reply With Quote
Sponsored Links
  #2  
Old 2nd October 2005, 14:56
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,749 Times in 2,579 Posts
Default

Quote:
I looked at the /etc/group file and to my horror all my groups had disappeared and the only lines left in there where the last 5 groups added by ISPConfig.
I am uncertain why this happened but I am guessing it may be because my usernames had hyphens in them (-). Can anyone confirm that this may be true or is true ?
Never heard of anything like that.

Quote:
When web1 has been deleted, this group remains and is not deleted. Is this normal or have I got another problem here ? If it IS normal, would it not be better for the group to be deleted also, once the web has been removed from the recycle bin ?
It should be deleted after you've deleted the web site also from the recycle bin.

Quote:
This brings me onto another issue..... after playing around with ISPConfig, and removing it and reinstalling it etc, ISPConfig seems to have no regard for already assigned UIDs. It seems to always start with 10001 regardless of whether this is already in use or not. .This causes immediate problems with /etc/passwd and /etc/group (and may have been the initial cause of my problems).
Therefore you can set the starting user id and group id under Management -> Server -> Settings -> Other. You have to go sure yourself that these ids do not interfere with others you use on the system.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 2nd October 2005, 15:07
linuxfast linuxfast is offline
Member
 
Join Date: Sep 2005
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply


Quote:
Quote:
When web1 has been deleted, this group remains and is not deleted. Is this normal or have I got another problem here ? If it IS normal, would it not be better for the group to be deleted also, once the web has been removed from the recycle bin ?


It should be deleted after you've deleted the web site also from the recycle bin.
OK. Can you tell me where in the ISPConfig code this group deletion takes place so that I may find out why it is not working on my system ?


Quote:
Quote:
This brings me onto another issue..... after playing around with ISPConfig, and removing it and reinstalling it etc, ISPConfig seems to have no regard for already assigned UIDs. It seems to always start with 10001 regardless of whether this is already in use or not. .This causes immediate problems with /etc/passwd and /etc/group (and may have been the initial cause of my problems).



Therefore you can set the starting user id and group id under Management -> Server -> Settings -> Other. You have to go sure yourself that these ids do not interfere with others you use on the system.
Setting the starting user id and group id is all good and well, but if i do a manual groupadd for whatever reason, it will ALWAYS use the last used id + 1 and therefore the next group ISPConfig adds will be the same.
So basically, if this is not changed/fixed, the command groupadd can never be used by anyone or any application without specifying an id
Would it not make more sense for ISPConfig to check first ?
Reply With Quote
  #4  
Old 2nd October 2005, 15:15
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,749 Times in 2,579 Posts
Default

Quote:
OK. Can you tell me where in the ISPConfig code this group deletion takes place so that I may find out why it is not working on my system ?
It's the function web_delete() in /root/ispconfig/scripts/lib/config.lib.php. But you can check the logfile first: /home/admispconfig/ispconfig/ispconfig.log.

Quote:
Setting the starting user id and group id is all good and well, but if i do a manual groupadd for whatever reason, it will ALWAYS use the last used id + 1 and therefore the next group ISPConfig adds will be the same.
So basically, if this is not changed/fixed, the command groupadd can never be used by anyone or any application without specifying an id
Would it not make more sense for ISPConfig to check first ?
See man groupadd. With groupadd -g gid group You can set the group id.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 2nd October 2005, 15:49
linuxfast linuxfast is offline
Member
 
Join Date: Sep 2005
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
It's the function web_delete() in /root/ispconfig/scripts/lib/config.lib.php. But you can check the logfile first: /home/admispconfig/ispconfig/ispconfig.log.
Ok the logfile looks fine, but it doesn't show creating/deleting users/groups.

im finding hard to understand the web_delete() function too, I can see where it backs up the website then removes it, and then backs up mysql and then deletes that, but I can't find exactly where it removes the group.
Can you help me further please ?
Reply With Quote
  #6  
Old 2nd October 2005, 15:57
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,749 Times in 2,579 Posts
Default

Quote:
Originally Posted by linuxfast
Ok the logfile looks fine, but it doesn't show creating/deleting users/groups.

im finding hard to understand the web_delete() function too, I can see where it backs up the website then removes it, and then backs up mysql and then deletes that, but I can't find exactly where it removes the group.
Can you help me further please ?
I'm sorry, it's not web_delete(), it's in the function user_delete().
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 2nd October 2005, 16:06
linuxfast linuxfast is offline
Member
 
Join Date: Sep 2005
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hehe OK

Well I am looking at this:

Code:
 $mod->system->delgroup("web".$web_doc_id);
    //$mod->log->caselog("groupdel web$web_doc_id &> /dev/null", $this->FILE, __LINE__);
what is the commented out line ? If I uncomment, will this log the action in the log file ?

Ughhh my head is hurting now, is there any quick way that I can log all actions by the function wf() in ispconfig_file_lib.php using your logging class ?

This may help me find why groups are not being deleted

Last edited by linuxfast; 2nd October 2005 at 16:17.
Reply With Quote
  #8  
Old 2nd October 2005, 20:45
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,749 Times in 2,579 Posts
Default

Quote:
Originally Posted by linuxfast
Hehe OK

Well I am looking at this:

Code:
 $mod->system->delgroup("web".$web_doc_id);
    //$mod->log->caselog("groupdel web$web_doc_id &> /dev/null", $this->FILE, __LINE__);
what is the commented out line ? If I uncomment, will this log the action in the log file ?

Ughhh my head is hurting now, is there any quick way that I can log all actions by the function wf() in ispconfig_file_lib.php using your logging class ?

This may help me find why groups are not being deleted
You could use
PHP Code:
$mod->log->caselog("groupdel web$web_doc_id &> /dev/null"$this->FILE__LINE__); 
and comment out the other line.
That should log the action into the log file.
There's no quick way for logging every action. You'd have to add the code for logging to every single action manually...
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #9  
Old 2nd October 2005, 23:31
linuxfast linuxfast is offline
Member
 
Join Date: Sep 2005
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK Cool
Thanks Falko, will give it a try
Reply With Quote
  #10  
Old 22nd December 2005, 22:27
Pramod Venugopal Pramod Venugopal is offline
Junior Member
 
Join Date: Dec 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

I have experienced the group deletion as well. All except the groups of the 3 last users I edited were deleted.

Thankfully I keep backups of /etc/group, /etc/gshadow etc so restoration was not a big problem. But this issue is scary.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems getting through the installation klausagnoletti Installation/Configuration 4 26th September 2005 13:23
proftpd problems Ovidiu Installation/Configuration 5 21st September 2005 11:47
Problems installing ISPConfig Debian Sarge hschel Server Operation 4 22nd August 2005 20:46
Little problems setting up the ISPConfig Luciano Installation/Configuration 1 15th August 2005 21:17
apt problems bluntman HOWTO-Related Questions 1 29th July 2005 12:17


All times are GMT +2. The time now is 15:28.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.