[services-cvs] CVS services/proc
CVS User miham
root at tempel.bibl.u-szeged.hu
2004. Nov. 13., Szo, 23:58:38 CET
Update of /var/lib/cvs/services/proc
In directory tempel:/tmp/cvs-serv5221/services/proc
Modified Files:
boinc.sh
Log Message:
Nah, meg apro fixek (igy talan mar jo is lesz :)
--- /var/lib/cvs/services/proc/boinc.sh 2004/11/13 20:41:55 1.10
+++ /var/lib/cvs/services/proc/boinc.sh 2004/11/13 22:58:38 1.11
@@ -4,7 +4,7 @@
#
# Author: Miham Kerekes <miham at bibl.u-szeged.hu>
#
-# Version: @(#)boincinit 0.4-1 04-Nov-2004 miham at bibl.u-szeged.hu
+# Version: @(#)boincinit 0.5-0 13-Nov-2004 miham at bibl.u-szeged.hu
#
set -e
@@ -33,27 +33,24 @@
ifup_serpub() {
decho 1 -ne "Bringing up interface to SERPUB VLAN.."
- grep "eth0.0300" /etc/network/interfaces >>/dev/null 2>>/dev/null
- if [ $? -eq 0 ]; then
- ifconfig | grep "eth0.0300" >>/dev/null 2>>/dev/null
- if [ $? -eq 0 ]; then
- decho 2 -ne 'Interface already up!\n'
- return
- else
- decho 2 -ne 'Bringing up interface..'
- ifup eth0.0300
- decho 2 -ne '. Ok!\n'
- fi
- else
+ if (grep "eth0.0300" /etc/network/interfaces >>/dev/null 2>>/dev/null); then
decho 2 -ne "Configuring interface.."
hostnum=$(hostname | cut -c5-)
+ decho 2 -ne '.'
serpubip=$(expr 140 + ${hostnum})
+ decho 2 -ne '.'
echo "auto eth0.0300" >> /etc/network/interfaces
+ decho 2 -ne '.'
echo "iface eth0.0300 inet static" >> /etc/network/interfaces
+ decho 2 -ne '.'
echo -ne "\taddress 160.114.159.${serpubip}\n" >> /etc/network/interfaces
+ decho 2 -ne '.'
echo -ne "\tnetmask 255.255.255.128\n" >> /etc/network/interfaces
+ decho 2 -ne '.'
echo -ne "\tnetwork 160.114.159.128\n" >> /etc/network/interfaces
+ decho 2 -ne '.'
echo -ne "\tbroadcast 160.114.159.255\n" >> /etc/network/interfaces
+ decho 2 -ne '.'
echo -ne "\tgateway 160.114.159.129\n" >> /etc/network/interfaces
decho 2 -ne '. Ok!\n'
@@ -61,6 +58,17 @@
ifup eth0.0300
decho 2 -ne '. Ok!\n'
decho 1 -ne '. Ok!\n'
+ else
+ if [ $? -eq 0 ]; then
+ decho 2 -ne '.'
+ if (ifconfig | grep "eth0.0300" >>/dev/null 2>>/dev/null); then
+ decho 2 -ne 'Bringing up interface..'
+ ifup eth0.0300
+ decho 2 -ne '. Ok!\n'
+ else
+ decho 2 -ne 'Interface already up!\n'
+ return
+ fi
fi
}
@@ -69,18 +77,18 @@
#
d_cleanstart() {
decho 1 -ne "\nInstalling packages essential to start service.."
- apt-get -q -f install ia32-libs debootstrap lvm2 vlan
+ apt-get -q -f install ia32-libs debootstrap lvm2 vlan >>/dev/null 2>>/dev/null
decho 1 -ne '. Ok!\n';
decho 1 -ne "Creating & setting up logical volume for BOINC.."
- lvcreate -L 5G -n boinc main
+ lvcreate -L 5G -n boinc main >>/dev/null 2>>/dev/null
decho 0 -ne '.';
- mkfs.ext2 -L boinc /dev/mapper/main-boinc
+ mkfs.ext2 -L boinc /dev/mapper/main-boinc >>/dev/null 2>>/dev/null
decho 1 -ne '.';
- tune2fs -i 0 -c 0 -m 1 -M /boinc /dev/mapper/main-boinc
+ tune2fs -i 0 -c 0 -m 1 -M /boinc /dev/mapper/main-boinc >>/dev/null 2>>/dev/null
decho 0 -ne '.';
mkdir /boinc
decho 1 -ne '.';
- mount /dev/mapper/main-boinc /boinc -t ext2
+ mount /dev/mapper/main-boinc /boinc -t ext2 >>/dev/null 2>>/dev/null
decho 1 -ne '. Ok!\n';
decho 1 -ne "Installing base system (i386) for BOINC.."
debootstrap --arch i386 sid /boinc http://ftp.fsn.hu/debian/ 2>>/dev/null >>/dev/null
@@ -98,12 +106,12 @@
## We HAVE TO bring up eth0 to VLAN ID 300..
ifup_serpub
decho 1 -ne "Mounting necessary partitions (dev, proc).."
- mount --bind /dev -t devfs /boinc/dev
+ mount --bind /dev -t devfs /boinc/dev >>/dev/null 2>>/dev/null
decho 0 -ne '.';
- mount --bind /proc -t proc /boinc/proc
+ mount --bind /proc -t proc /boinc/proc >>/dev/null 2>>/dev/null
decho 1 -ne '. Ok!\n';
decho 1 "Starting to BOINC.."
- chroot /boinc sh -c "cd /boinc; ./${BOINCFILE} 2>>/boinc/error.log >>/boinc/output.log" &
+ chroot /boinc sh -c "cd /boinc; ./${BOINCFILE} 2>>/boinc/stderr.log >>/boinc/stdout.log &"
echo -ne "Ok"
}
További információk a(z) Services-cvs levelezőlistáról