--
MikeGore - 23 Mar 2010
SWAG.CS (was swag-new.cs)
Operation System
Machine hardware config
RAID
- Hardware Raid: LSI Logic / Symbios Logic LSI MegaSAS 9260 (rev 04)
LOM Remote Control
Note: LOM port is disabled via ONA when not in use
- Provides: remote VIDEO KVM and power management of swag.cs
- Access: http://lom-swag.cs.uwaterloo.ca/index.html
- cscf-adm from the university network (2020 version)
- ONA SWAG - dc-cs2 port H4
- Web access: Notes: MUST use Windows IE Browser for access - does NOT work under Linux
- IPMI Reference
BACKUP
Postgresql 8.3 to 8.4 upgrade
Backup 8.3 data
- ) /etc/init.d/postgresql-8.3 stop
- ) cd /var/lib/posgresql
- ) rsync -a /var/lib/posgresql/8.3 /var/lib/posgresql/8.3.orig
- ) rsync -a /usr/share/postgresql/8.3 /usr/share/postgresql/8.3.orig
Install *postgrsql-8.4
- ) apt-get install postgresql-8.4
Deleted 8.4 databases resulting from install process
- ) pg_dropcluster 8.4 main
- ) /etc/init.d/postgresql-8.4 stop
Fix pg_upgradecluster to add --disable-triggers
See http://us.generation-nt.com/answer/bug-579768-pg-upgradecluster-disable-triggers-help-197808691.html
- ) vi `which pg_upgradecluster`
- ) Near line 421 look for # start pg_restore and copy over everything
- Update it look lik ethis:
# start pg_restore and copy over everything
# Updated by Mike Gore, 6Dec 2010 added --disable-triggers
# http://us.generation-nt.com/answer/bug-579768-pg-upgradecluster-disable-triggers-help-197808691.html
my @restore_argv = ($pg_restore, '-h', $newsocket, '-p',
$newinfo{'port'},'--disable-triggers', '--data-only', '-d', $db);
Upgrade Databases to 8.4
- ) /etc/init.d/postgresql-8.3 start
- ) pg_upgradecluster 8.3 main
Delete old 8.3 databases
- ) pg_dropcluster 8.3 main
- ) /etc/init.d/postgresql-8.3 stop*
- ) apt-get remove postgresql-8.3
EMAIL
- Email setup: UbuntuEmail
- dpkg-reconfigure postfix
- Type: Internet Site
- System Mail Name: swag.cs.uwaterloo.ca
- Root and postmaster mail recipient:
- Other destinations to accept mail for: swag.cs.uwaterloo.cs, swag.cs, swag, localhost
- Force synchronous updates on mail queue? : * No*
- Local Networks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 129.97.0.0/16 0.0.0.0
- Use procmail for local delivery?: Yes
- Mailbox size limit (bytes): 0
- Local address extension character: +
- Internet protocols to use: ipv4
Email Aliases
- See /etc/aliases mailing lists and groups go here
Apache
- Install: apt-get install apache2
- Enable userdir: a2enmod userdir
- Restart Apache: /etc/init.d/apache2 restart
Accounts
Creation
- adduser username (See also useradd)
Group modifications
- usermod -a -G admin admin_user
Special Groups
- admin
- buahaus
- clip
- doppler
- minervan
- race
- swag
- web
Account migration from SWAG to SWAG-NEW.CS
- I Created script to extract the swag users and groups we care about and build a new script to restore them in the target machine
#!/bin/bash
#
TMP=/tmp/$$.tmp
SCRIPT=/tmp/$$.script
trap 'cleanup' 0 1 2 3 15
cleanup() {
rm -f "$TMP" "$SCRIPT"
}
count_comma()
{
awk ' BEGIN { count=0; quote=0}
{ for (i=1;i<=length($0);i++)
{
if(substr($0,i,1)=="\"") { quote=!quote; continue};
if(substr($0,i,1)=="," && quote==0) {count++;}
}
}
END {print count} ' $1
}
echo \#=========================================================== >>"$SCRIPT"
echo \# USERS >>"$SCRIPT"
OUR_USERS=`egrep "^[A-Za-z0-9-]+:" /etc/passwd | cut -d: -f1 | sort -u`
# TMP file for groups
for NAME in $OUR_USERS
do
# echo NAME=$NAME
# Get every line that has NAME in it - cut the group name
PUID=`egrep "^$NAME:" /etc/passwd | cut -d: -f3`
PGID=`egrep "^$NAME:" /etc/passwd | cut -d: -f4`
PHOME=`grep "^$NAME:" /etc/passwd | cut -d: -f6`
if [ -n $PUID -a $PUID -gt 500 -a $PUID -lt 2000 ];
then
SPASS=`grep "^$NAME:" /etc/shadow | cut -d: -f2`
echo useradd -m -d $PHOME -u $PUID -p \'"$SPASS"\' "$NAME" >>"$SCRIPT"
fi
done
echo \#=========================================================== >>"$SCRIPT"
echo \# GROUPS >>"$SCRIPT"
OUR_GROUPS=`egrep "^[A-Za-z0-9-]+:" /etc/group | cut -d: -f1 | sort -u`
#echo "$OUR_GROUPS"
#Build script to create all users
for NAME in $OUR_GROUPS
do
PGID=`egrep "^$NAME:" /etc/group | cut -d: -f3`
# Count # of group members
PGIDS=`egrep "^$NAME:" /etc/group | cut -d: -f4- | count_comma`
# echo PGIDS=$PGIDS
# echo PGID=$PGID
if [ -n $PGID -a $PGID -gt 500 -a $PGID -lt 2000 ];
then
if [ -n $PGIDS -a $PGIDS -gt 1 ];
then
egrep "^$NAME:" /etc/group >>"$SCRIPT"
fi
fi
done
cat $SCRIPT
cleanup