View Single Post
  #3  
Old 12th July 2013, 21:31
bpmee bpmee is offline
Member
 
Join Date: Aug 2006
Posts: 86
Thanks: 3
Thanked 5 Times in 5 Posts
Thumbs up

Sorry I just happened upon your post facing a similar problem.

My /etc/group file had been emptied. The only file with *most* of the correct group info was /etc/group- (the "-" on purpose).

I did the following:
Code:
]# cp /etc/group- /etc/group
Then I manually ran ISPConfig 2's writeconf.php script, using ISPConfig 2's own php:

Code:
]# /root/ispconfig/php/php /root/ispconfig/scripts/writeconf.php
If the writeconf.php script produces an error even after copying the group- file to group, you might have to rebuild some elements manually.

I had this problem happen before and started running a backup script for /etc/group, /etc/shadow, etc files to avoid disruption. It can be run via Cron daily, hourly, or whenever

Warning: This script force copies the respective files to a [filename]-bak-[current date] copy. If you run it daily, your /etc folder will fill up with many days worth of backup copies. If disk space is low, you should probably add some code that erases backup copies older than x days....

Code:
#!/bin/sh

#
# Backup Passwd and Shadow Files
#

cp -f /etc/passwd /etc/passwd-bak-$(date +%Y%m%d%H%M%S);
cp -f /etc/shadow /etc/shadow-bak-$(date +%Y%m%d%H%M%S);
cp -f /etc/group /etc/group-bak-$(date +%Y%m%d%H%M%S);
cp -f /etc/gshadow /etc/gshadow-bak-$(date +%Y%m%d%H%M%S);

echo Finished;

exit;
Reply With Quote