add missing package anacron
[debian6500.git] / trc6500-master-file / postinst
1 #!/bin/bash
2
3 # since equivs can't handle symlinks, here we are doing them by hand. As of writing this script (2015-05-29), there are 11 symlinks to take care of.
4
5 # I don't know why things were that way before, but I'm told to set them that way again.
6 echo 'Moving things around..'
7 [ -h /home ] || mv /home /var/media/backup
8 mkdir -p /var/media/backup/dump/{core,dump_delay_line,dump_track_base,log,prod,rec,trace}
9 ln -sf /var/media/backup/dump /
10 ln -sf /var/media/backup/home /
11 ln -sf /var/media/backup/rec /
12 ln -sf /var/media/prod /var/media/backup/
13 ln -sf /etc/hosts.30MHzMDF /etc/hosts.30MHz
14 ln -sf /etc/hosts.8MHzMHF /etc/hosts.8MHz
15 ln -sf /usr/lib/syslinux/menu.c32 /opt/tftp/menu.c32
16 ln -sf /initrd.img /opt/tftp/initrd.img
17 ln -sf /vmlinuz /opt/tftp/vmlinuz
18 ln -sf /usr/lib/syslinux/pxelinux.0 /opt/tftp/pxelinux.0
19 ln -sf /usr/lib/syslinux/memdisk /opt/tftp/memdisk
20 echo 'Things moved.'
21
22 # now enable all the scripts and such..
23 echo 'Enabling on-startup scripts..'
24 update-rc.d waitswitches defaults
25 update-rc.d waitswitches enable
26 update-rc.d etherwake defaults
27 update-rc.d etherwake enable
28 update-rc.d ipmiwake defaults
29 update-rc.d ipmiwake enable
30 update-rc.d wakeonlan defaults
31 update-rc.d wakeonlan enable
32 update-rc.d waitslaves defaults
33 update-rc.d shutdownallblades defaults
34 update-rc.d checkudevrules enable
35 update-rc.d checkudevrules defaults
36 echo 'Scripts enabled.'
37
38 # and these other things too
39 echo 'Finalizing configuration..'
40 chown webconfig /etc/webconfig/alias.d/50-trc6500-master-file.csv /etc/dhcp/dhcpd.conf*
41 cp /etc/dhcp/dhcpd.conf.blank /etc/dhcp/dhcpd.conf
42 chsh -s /usr/bin/pdmenu trc6500
43
44 # from that sync_master.sh script.. Apparently there from Git shenanigans.
45 chmod go-rwx /root/.ssh/id_rsa
46 chmod go-rwx /opt/cluster/slave/root/.ssh
47 chmod go-rwx /opt/cluster/slave/root/.ssh/id_rsa
48 chmod a+rwx /opt/tftp
49
50 echo "">/var/log/atftpd.log
51 chown nobody /var/log/atftpd.log
52
53 # solve an issue with old trc6500-webconfig
54 touch /var/cache/webconfig/snmp.tree
55 chown webconfig: /var/cache/webconfig/snmp.tree
56
57 update-initramfs -u
58
59 cd /opt/cluster
60 # now this file is locked away during install and replaced by a dummy. So we put a duplicate of this in a script executed on first boot after the install.
61 # this is still here because it is planned we install/update this on established systems
62 [ -f /sbin/start-stop-daemon.REAL ] || make all
63 echo 'Finalized.'
64
65