No-activity timeout for csit-perf jobs
[ci-management.git] / vagrant / lib / system_reseal.sh
1 #!/bin/bash
2
3 # vim: sw=2 ts=2 sts=2 et :
4
5 if [ -f /.autorelabel ]; then
6   echo "**********************************************"
7   echo "* SYSTEM REQUIRES RELABELING SKIPPING RESEAL *"
8   echo "*     PLEASE RESTART SYSTEM AND RERUN        *"
9   echo "*           PROVISIONING SCRIPTS             *"
10   echo "**********************************************"
11   exit 1;
12 fi
13
14 rm -rf /etc/Pegasus/*.cnf /etc/Pegasus/*.crt /etc/Pegasus/*.csr \
15        /etc/Pegasus/*.pem /etc/Pegasus/*.srl \
16        /root/anaconda-ks.cfg /root/anaconda-post.log \
17        /root/initial-setup-ks.cfg /root/install.log \
18        /root/install.log.syslog /var/cache/fontconfig/* \
19        /var/cache/gdm/* /var/cache/man/* \
20        /var/lib/AccountService/users/* /var/lib/fprint/* \
21        /var/lib/logrotate.status /var/log/*.log* /var/log/BackupPC/LOG \
22        /var/log/ConsoleKit/* /var/log/anaconda.syslog \
23        /var/log/anaconda/* /var/log/apache2/*_log \
24        /var/log/apache2/*_log-* /var/log/apt/* /var/log/aptitude* \
25        /var/log/audit/* /var/log/btmp* /var/log/ceph/*.log \
26        /var/log/chrony/*.log /var/log/cron* /var/log/cups/*_log \
27        /var/log/debug* /var/log/dmesg* /var/log/exim4/* \
28        /var/log/faillog* /var/log/gdm/* \
29        /var/log/glusterfs/*glusterd.vol.log \
30        /var/log/glusterfs/glusterfs.log /var/log/httpd/*log \
31        /var/log/installer/* /var/log/jetty/jetty-console.log \
32        /var/log/journal/* /var/log/lastlog* \
33        /var/log/libvirt/libvirtd.log /var/log/libvirt/lxc/*.log \
34        /var/log/libvirt/qemu/*.log /var/log/libvirt/uml/*.log \
35        /var/log/lightdm/* /var/log/mail/* /var/log/maillog* \
36        /var/log/messages* /var/log/ntp /var/log/ntpstats/* \
37        /var/log/ppp/connect-errors /var/log/rhsm/* /var/log/sa/* \
38        /var/log/secure* /var/log/setroubleshoot/*.log \
39        /var/log/spooler* /var/log/squid/*.log /var/log/syslog* \
40        /var/log/tallylog* /var/log/tuned/tuned.log /var/log/wtmp* \
41        /var/named/data/named.run
42
43 rm -rf ~/.viminfo /etc/ssh/ssh*key* ~/.ssh/* /root/.ssh/*
44
45 # kill any cloud-init related bits
46 rm -rf /var/lib/cloud/*
47
48 # cleanup /vagrant
49 rm -rf /vagrant
50
51 if [ -f /etc/debian_version ]
52 then
53     echo "********************************************"
54     echo "*   NOW INSTALLING cloud-init PACKAGE      *"
55     echo "********************************************"
56
57     apt-get -y -qq install cloud-init > /dev/null 2>&1
58 fi
59
60 # Force a system sync and sleep to get around any SSD issues
61 echo "Forcing sync and sleep for 10sec"
62 sync
63 sleep 10
64
65 echo "********************************************"
66 echo "*   PLEASE SNAPSHOT IMAGE AT THIS TIME     *"
67 echo "********************************************"