Search A-Z index Help
University of Cambridge Home Physics Dept Home Mike Roses' Home Page TCM Group Home

Basic Server Setup Info for SuSe 10.0

/dev/sda1 - swap
/dev/sda2 - /
/dev/sda3 - /scratch

If using RAID1 (software):
/dev/md0 - /dev/sdb1 & /dev/sdc1
continuous streamed write to /dev/md0 achieved approximately 47MB/sec

turn off SuSe config permissions:
because it likes to reset permissions all over the place.
mv /sbin/conf.d/SuSEconfig.permissions /sbin/conf.d/SuSEconfig.permissions.disabled
echo '#!/bin/sh
/bin/logger "SuSe Config Permission running, again"' 
> /sbin/conf.d/SuSEconfig.permissions
chmod +x /sbin/conf.d/SuSEconfig.permissions

Ethernet
network cards are assigned a fixed number based upon the mac address of the card: eth0, eth1, etc. Swap
a system disk from one PC to another and your eth0 is still there (no startup attempted though as
device does not exist), but you get eth2 and eth3 (for system with 2 network cards).
net card config gets put into:
ll /etc/udev/rules.d/30-net_persistent_names.rules
created by this rule:
31-net_create_names.rules

FORCE_PERSISTENT_NAMES=no
in
/etc/sysconfig/network/config

to be really neat you can delete the files in /etc/udev/rules.d/30-net_persistent_names.rules


Stop auto-mounting of media
rpm -e submount

in /etc/fstab for USB:
/dev/sdd1       /usb    auto    noauto,owner,user 0 0
/dev/sdd        /usb    auto    noauto,owner,user 0 0
/dev/sde1       /usb2   auto    noauto,owner,user 0 0
/dev/sde        /usb2   auto    noauto,owner,user 0 0
for CDR and floppy:
/dev/cdrom           /cdrom               auto       noauto,owner,user,ro,exec 0 0
/dev/fd0             /floppy              auto       noauto,owner,user         0 0

sometimes, somewhere I have yet to find SuSe10.0 will reset the group of /var/log/messages
to root, when I've set it to managers. Annoying, so a not very tidy fix is:
/etc/init.d/permissions
"
### BEGIN INIT INFO
# Provides:          permissions
# Required-Start:    $syslog $remote_fs cron
# Should-Start: permissions
# Required-Stop:     $syslog $remote_fs cron
# Should-Stop: permissions
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: Permissions fixes
# Description:       
### END INIT INFO
case "$1" in
    start)
        echo -n "Starting permissions "
        chgrp -R managers /var/log
        chmod -R g+r /var/log/*
	;;
    stop)
        echo -n "Shutting down FOO "
        ## Stop daemon with killproc(8) and if this fails
        ## killproc sets the return value according to LSB.


        # Remember status and be verbose
        rc_status -v
        ;;
esac
exit 0
"
chkconfig permissions on


RAID error detection
We like to know when a RAID array reports errors so a bit of cron, Perl and shell is:


> crontab -l
45 8-18 * * 1-6 /PATH/check_raid.sh

cdrecord - works as normal user if one justs make it setuid root

install the kernel source
install development tools (compilers, libraries, etc.)

install exim (using own config + init files):
rpm -e --nodeps sendmail
scp -rp /usr/local/exim server:/usr/local/exim
scp -p /etc/init.d/exim server:/etc/init.d/exim
# delete postfix from /etc/passwd and /etc/group
echo 'exim:x:51:51:Exim MTA:/:/bin/sh' >> /etc/passwd
echo 'exim:!:51:' >> /etc/group
chown exim:exim /usr/local/exim/bin/exim
chmod 6755 /usr/local/exim/bin/exim
ln -s /usr/local/exim/bin/exim /usr/sbin/sendmail
ln -s /usr/local/exim/bin/exim /usr/lib/sendmail
if [ -d /var/spool/exim ]; then
    echo "Exim spool directory already exists"
else
    mkdir /var/spool/exim
    mkdir /var/spool/exim/db
    mkdir /var/spool/exim/input
    mkdir /var/spool/exim/msglog
    chown -R 51:51 /var/spool/exim
    chmod 1777 /var/spool/exim/*
fi
ln -s /var/spool /usr/spool
rm -rf /var/spool/mail
ln -s /misc/mail_spool /var/spool/mail
ln -s /var/spool/exim/exim.pid-q1h /var/run/exim.pid
# Run non-root
touch /var/log/exim_mainlog
chown exim:200 /var/log/exim_mainlog*
chmod 640 /var/log/exim_mainlog*
touch /var/log/exim_paniclog
chown exim:200 /var/log/exim_paniclog*
chmod 640 /var/log/exim_paniclog*
# other log file permissions
touch /var/log/secure
chmod 600 /var/log/secure
chmod 600 /var/log/mail*
chown root /var/log/messages*
chgrp 200 /var/log/messages*
chkconfig exim on


# HOSTS file (again your own concoction)
scp /etc/hosts server:/etc/hosts

# portmap off
chkconfig nfsboot off
chkconfig portmap off
/etc/init.d/portmap stop

# Hostname
vim /etc/init.d/boot.localnet
Change:
"
        test -n "$XHOSTNAME" && {
            echo -n Setting up hostname \'${XHOSTNAME%%.*}\'
            hostname ${XHOSTNAME%%.*}
            rc_status -v -r
        }
"
to:
"
        test -n "$XHOSTNAME" && {
            echo -n Setting up hostname \'${XHOSTNAME}\'
            hostname ${XHOSTNAME}
            rc_status -v -r
        }
"
so that we get a proper full hostname returned by the "hostname" command, rather
than the short hostname (hostname -s)


echo "set bs=2" >> /etc/vimrc
For backspace to work with vim

ACLs and emacs - ACLs are lost because emacs uses a move to create a backup file and not copy
set:
(setq backup-by-copying t)
in:
~/.emacs
or:
/usr/share/emacs/site-lisp/site-start.el (SuSe 10.0)
and emacs will make backup files using copy rather than move, hence preserving ACLs.

Disk quotas. Problem here as quotaon was not being run during boot.
/etc/init.d/boot.quota was not running as no soft link in /etc/init.d/boot.d, so:
cd /etc/init.d/boot.d/
ln -s ../boot.quota ./S12boot.quota
ln -s ../boot.quota ./K10boot.quota

boot.quota requires boot.swap boot.clock boot.localfs hence S12 was
chosen on this server.

To install dump you need the dump rpm - only in the SuSe 10.0 Pro
distribution (not standarwd SuSe 10.0?), and you will also need rmt
which is in the star rpm (camonly nfs export from uxusp):
dump-0.4b40-3.i586.rpm
star-1.5a60-5.i586.rpm