File config.sh of Package OBS-WorkerOnly-pxe-xen (Revision c9f1f1f1aaf1cd02c85bc0e35545096b)
Currently displaying revision c9f1f1f1aaf1cd02c85bc0e35545096b, show latest
1
2
#======================================
3
# Functions...
4
#--------------------------------------
5
test -f /.kconfig && . /.kconfig
6
test -f /.profile && . /.profile
7
8
#======================================
9
# Greeting...
10
#--------------------------------------
11
echo "Configure image: [$kiwi_iname]..."
12
#======================================
13
# Activate services
14
#--------------------------------------
15
ifup lo
16
suseActivateDefaultServices
17
suseInsertService boot.device-mapper
18
suseInsertService slpd
19
suseInsertService ntp
20
# OBS worker
21
suseInsertService obsworker
22
suseInsertService obsstoragesetup
23
24
#======================================
25
# SuSEconfig
26
#--------------------------------------
27
suseConfig
28
29
# no gfx boot menu, no error message please
30
sed -i /^gfxmenu/d /boot/grub/menu.lst
31
32
# setup initrd for XEN workers
33
sed -i -e 's/^DOMU_INITRD_MODULES="/DOMU_INITRD_MODULES="loop dm-mod dm-snapshot binfmt_misc fuse kqemu squashfs ext2 ext3 ext4 reiserfs btrfs vfat nf_conntrack_ipv6 /' /etc/sysconfig/kernel
34
sed -i -e 's/^NO_KMS_IN_INITRD=.*/NO_KMS_IN_INITRD="yes"/' /etc/sysconfig/kernel
35
36
# For save booting, there is some race between blogd and console setup in 11.4 atm
37
sed -i -e 's/^RUN_PARALLEL=.*/RUN_PARALLEL="no"/' /etc/sysconfig/boot
38
39
# configure network
40
cat >> /etc/sysconfig/network/config <<EOF
41
42
NETCONFIG_MODULES_ORDER="dns-resolver dns-bind ntp-runtime"
43
NETCONFIG_DNS_POLICY="auto"
44
NETCONFIG_DNS_FORWARDER="resolver"
45
NETCONFIG_NIS_SETDOMAINNAME="yes"
46
NETCONFIG_NTP_POLICY="auto"
47
EOF
48
49
cat >> /etc/sysconfig/network/scripts/logserver-up.sh <<EOF
50
51
SCRIPTNAME=$0
52
53
function get_logserver {
54
DHCPINFOFILE=`grep -H ^LOGSERVER /var/lib/dhcpcd/*.info |awk -F: '{print $1}'`
55
if [ -f "${DHCPINFOFILE}" ] ; then
56
. ${DHCPINFOFILE}
57
export LOGSERVER
58
echo ${LOGSERVER}
59
else
60
echo "localhost"
61
fi
62
}
63
64
function add_logserver {
65
LOGHOST=`get_logserver`
66
case ${LOGHOST} in
67
localhost)
68
69
;;
70
*)
71
if [ -f /etc/syslog-ng/syslog-ng.conf ] ; then
72
if [ -z "`grep ${LOGHOST} /etc/syslog-ng/syslog-ng.conf`" ] ; then
73
echo "
74
destination loghost {
75
udp(\"${LOGHOST}\" port (514));
76
};
77
log { source(src); destination(loghost); };
78
" >> /etc/syslog-ng/syslog-ng.conf
79
if [ -x /etc/init.d/syslog ] ; then
80
/etc/init.d/syslog restart
81
fi
82
fi
83
fi
84
;;
85
esac
86
}
87
88
89
case $SCRIPTNAME in
90
*if-up.d*)
91
add_logserver
92
;;
93
*if-down.d*)
94
95
;;
96
esac
97
EOF
98
chmod +x /etc/sysconfig/network/scripts/logserver-up.sh
99
ln -s /etc/sysconfig/network/scripts/logserver-up.sh /etc/sysconfig/network/if-up.d/logserver
100
101
# runlevel 3 as default
102
sed -i 's/^id:5:initdefault:/id:3:initdefault:/' /etc/inittab
103
104
# enable autosetup
105
sed -i 's,OBS_API_AUTOSETUP=.*,OBS_API_AUTOSETUP="yes",' /etc/sysconfig/obs-server
106
sed -i 's,OBS_STORAGE_AUTOSETUP=.*,OBS_STORAGE_AUTOSETUP="yes",' /etc/sysconfig/obs-*
107
sed -i 's,OBS_SETUP_WORKER_PARTITIONS=.*,OBS_SETUP_WORKER_PARTITIONS="use_obs_vg",' /etc/sysconfig/obs-*
108
109
# hardwired ntp server config, in case dhcp distribution of ntp config is not working
110
echo "" >> /etc/ntp.conf
111
echo "server ptbtime1.ptb.de" >> /etc/ntp.conf
112
echo "server ptbtime2.ptb.de" >> /etc/ntp.conf
113
echo "server ptbtime3.ptb.de" >> /etc/ntp.conf
114
echo "multicastclient" >> /etc/ntp.conf
115
116
# allow root login via serial console for debugging
117
echo "" >> /etc/securetty
118
echo "# for debugging purposes" >> /etc/securetty
119
echo ttyS0 >> /etc/securetty
120
echo ttyS1 >> /etc/securetty
121
echo "" >> /etc/inittab
122
echo "S0:12345:respawn:/sbin/agetty -L 19200 ttyS0 vt102" >> /etc/inittab
123
echo "S1:12345:respawn:/sbin/agetty -L 57600 ttyS1 vt102" >> /etc/inittab
124
125
# bug ?
126
chown root.root /var/lib/empty
127
128
#======================================
129
# Configure OBS to use /obs by default
130
#--------------------------------------
131
#sed -i 's,/srv/obs,/obs,g' /usr/lib/obs/server/BSConfig.pm
132
#sed -i 's,.*our $serviceserve.*,our $serviceserver = "http://$hostname:5152";,' /usr/lib/obs/server/BSConfig.pm
133
#sed -i 's,^our $repodownload.*,our $repodownload = "http://$hostname:82/";,' /usr/lib/obs/server/BSConfig.pm
134
sed -i 's,^OBS_RUN_DIR=.*,OBS_RUN_DIR="/obs/run",' /etc/sysconfig/obs-server
135
sed -i 's,^OBS_LOG_DIR=.*,OBS_LOG_DIR="/obs/log",' /etc/sysconfig/obs-server
136
#sed -i 's,^datadir.=.*,datadir = /obs/MySQL,' /etc/my.cnf
137
#sed -i '/^\[mysqld_multi\]/adatadir = /obs/MySQL' /etc/my.cnf # config of openSUSE 11.4 does not come with a default dir for its default mode
138
# signing setup
139
#sed -i 's,.*our $gpg_standard_key.*,our $gpg_standard_key = "/obs/obs-default-gpg.asc";,' /usr/lib/obs/server/BSConfig.pm
140
#sed -i 's,.*our $keyfile.*,our $keyfile = "/obs/obs-default-gpg.asc";,' /usr/lib/obs/server/BSConfig.pm
141
#sed -i 's,.*our $sign = .*,our $sign = "/usr/bin/sign";,' /usr/lib/obs/server/BSConfig.pm
142
#sed -i 's,.*our $forceprojectkeys.*,our $forceprojectkeys = 1;,' /usr/lib/obs/server/BSConfig.pm
143
#chmod 4755 /usr/bin/sign
144
# configure monitoring
145
sed -i s@"127.0.0.1$"@"127.0.0.1 85.236.33.9 83.141.20.191"@g /etc/xinetd.d/nrpe
146
echo 'command[check_updates]=/usr/lib/nagios/plugins/check_zypper' > /etc/nagios/nrpe.d/updates.cfg
147
#echo 'allow ^83\.141\.20\.189$' >> /etc/munin/munin-node.conf
148
#echo 'allow ^85\.236\.33\.9$' >> /etc/munin/munin-node.conf
149
echo 'cidr_allow 85.236.33.9/32' >> /etc/munin/munin-node.conf
150
echo 'cidr_allow 83.141.20.0/24' >> /etc/munin/munin-node.conf
151
/usr/sbin/munin-node-configure --shell | sh
152
chkconfig xinetd on
153
chkconfig munin-node on
154
155
# allow unsupported modules on sles
156
sed -i -r 's@^allow_unsupported_modules 0@allow_unsupported_modules 1@' /etc/modprobe.d/unsupported-modules
157
158
#======================================
159
# Add Default Repositories
160
#--------------------------------------
161
#zypper ar http://download.opensuse.org/update/11.4/ openSUSE:11.4:Update
162
#zypper ar http://download.opensuse.org/repositories/openSUSE:11.4/standard openSUSE:11.4
163
#zypper ar http://download.opensuse.org/repositories/openSUSE:Tools/SLE_11_SP2 openSUSE:Tools
164
zypper --gpg-auto-import-keys ar -f http://download.obs.j0ke.net/J0KE.NET:/Tools/SLE_11_SP2/ J0KE.NET:Tools
165
zypper --gpg-auto-import-keys ar -f http://download.obs.j0ke.net/home:/netmax:/tools/SLE_11_SP2/ home:netmax:tools
166
zypper --gpg-auto-import-keys ar -f http://download.obs.j0ke.net/server:/monitoring/SLE_11_SP2/ server:monitoring
167
#======================================
168
# Umount kernel filesystems
169
#--------------------------------------
170
baseCleanMount
171
172
exit 0
173