]> git.pld-linux.org Git - projects/pld-builder.new.git/blame - etc/pld-builder.sysconfig
- use exec
[projects/pld-builder.new.git] / etc / pld-builder.sysconfig
CommitLineData
717b3c75 1#!/bin/sh without shebang autoindentation doesn't work (vim-7.0-0.c02.1.3)
b5ffea2c 2# -*- mode: sh -*-
3
67879347
ER
4# comment next line to configure your setup
5: <<'#END'
b5ffea2c 6
67879347
ER
7CHROOTS=/mnt/hda9/adm/builders/pld/{ac/{athlon,i586},actw/{athlon,i586},th/{athlon,i486}}
8FTPDIRS=/mnt/hda9/adm/builders/pld/ftp/ftp/{{ac,actw}/{ready,test}/{SRPMS,athlon,i586},th/{ready,test}/{SRPMS,athlon,i486}}
9
10NICE="nice -n 19"
11
480bc6af 12bin_builder_tmpwatch_cron_jobs () {
67879347 13 local hour=0
c3b94efe 14 for CHROOT in $CHROOTS; do
67879347
ER
15 [ $hour -gt 23 ] && hour=0
16 echo "0 $hour * * * sudo chroot $CHROOT $NICE tmpwatch -m 240 /spool/poldek"
17 hour=$(( $hour + 1 ))
18 done
19}
20
480bc6af 21ftp_update_indexes_cron_jobs () {
67879347 22 local minute=0
c3b94efe 23 for FTPDIR in $FTPDIRS; do
67879347 24 [ $minute -gt 59 ] && minute=0
7c54cf4b 25 echo "$minute * * * * /bin/sh -c \"umask 022; $NICE /usr/bin/poldek --mkidx -s $FTPDIR\""
67879347
ER
26 minute=$(( $minute + 1 ))
27 done
28}
29
480bc6af 30pld_builder_start () {
67879347
ER
31 # mount /proc in chroots
32 local RET
33 echo
34 for CHROOT in $CHROOTS; do
35 show "chroot: %s mount /proc" "$CHROOT"
36 RET=$(chroot $CHROOT mount /proc > /dev/null 2>&1 ; echo $?)
37 [ $RET -eq 0 ] && ok || fail
38 done
39
40 # set up crontab for srpms_builder
41 show "setting up crontab for srpms_builder"
42 crontab -u srpms_builder - <<- EOF && ok || fail
7c54cf4b
ER
43 #### WARNING: This file is autogenerated.
44 #### WARNING: Do not make changes here.
45 #### WARNING: Make them to /etc/sysconfig/pld-builder instead.
67879347 46 SHELL=/bin/sh
5af2a238 47 MAILTO=srpms_builder
67879347 48
480bc6af
ER
49 * * * * * exec $NICE /usr/share/pld-builder/bin/src-builder.sh
50 * * * * * exec $NICE /usr/share/pld-builder/bin/file-sender.sh
67879347
ER
51EOF
52
53 # set up crontab for bin_builder
54 show "setting up crontab for bin_builder"
55 crontab -u bin_builder - <<-EOF && ok || fail
7c54cf4b
ER
56 #### WARNING: This file is autogenerated.
57 #### WARNING: Do not make changes here.
58 #### WARNING: Make them to /etc/sysconfig/pld-builder instead.
67879347 59 SHELL=/bin/sh
5af2a238 60 MAILTO=bin_builder
67879347 61
480bc6af
ER
62 * * * * * exec $NICE /usr/share/pld-builder/bin/request-fetcher.sh
63 * * * * * exec $NICE /usr/share/pld-builder/bin/load-balancer.sh
64 * * * * * exec $NICE /usr/share/pld-builder/bin/file-sender.sh
8a007caa 65
66 $(bin_builder_tmpwatch_cron_jobs)
67879347
ER
67EOF
68
69 # set up crontab for ftpac
70 show "setting up crontab for ftp"
71 crontab -u ftpac - <<-EOF && ok || fail
7c54cf4b
ER
72 #### WARNING: This file is autogenerated.
73 #### WARNING: Do not make changes here.
74 #### WARNING: Make them to /etc/sysconfig/pld-builder instead.
67879347 75 SHELL=/bin/sh
5af2a238 76 MAILTO=ftpac
67879347 77
67879347
ER
78 $(ftp_update_indexes_cron_jobs)
79EOF
80}
81
480bc6af 82pld_builder_stop () {
67879347
ER
83 local RET
84 echo
85 for CHROOT in $CHROOTS; do
86 show "chroot: %s umount /proc" "$CHROOT"
c3b94efe 87 RET=$(chroot $CHROOT umount /proc > /dev/null 2>&1; echo $?)
67879347
ER
88 [ $RET -eq 0 ] && ok || fail
89 done
90
c3b94efe 91 for u in srpms_builder bin_builder ftpac; do
67879347
ER
92 show "removing crontab for %s" "$u"
93 crontab -u $u -r > /dev/null 2>&1 && ok || fail
94 done
95}
96
480bc6af 97pld_builder_status () {
67879347
ER
98 local RET
99 echo
100 for CHROOT in $CHROOTS; do
101 show "chroot: %s is /proc mounted?" "$CHROOT"
480bc6af 102 RET=$(chroot $CHROOT mount -v 2> /dev/null | grep -q 'none.*/proc'; echo $?)
67879347
ER
103 [ $RET -eq 0 ] && ok || fail
104 done
105}
106
107#END
This page took 0.058658 seconds and 4 git commands to generate.