52-update-rc.d 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #!/bin/sh
  2. set -e
  3. CUSTOM_INITSCRIPTS="
  4. "
  5. PATCHED_INITSCRIPTS="
  6. alsa-utils
  7. gdomap
  8. haveged
  9. hdparm
  10. hwclock.sh
  11. i2p
  12. kexec-load
  13. laptop-mode
  14. memlockd
  15. saned
  16. spice-vdagent
  17. tor
  18. ttdnsd
  19. "
  20. echo "Configuring boot sequence"
  21. # The patches to adjust the runlevels are applied to the chroot
  22. # after the packages have been installed. So we need to remove them first,
  23. # to re-install them with our settings.
  24. insserv -r $PATCHED_INITSCRIPTS
  25. # Re-install overriden initscripts and install our custom ones.
  26. insserv $PATCHED_INITSCRIPTS $CUSTOM_INITSCRIPTS
  27. ### Tweak systemd unit files
  28. # Workaround for https://bugs.debian.org/714957
  29. systemctl enable memlockd.service
  30. # Enable our own systemd unit files
  31. systemctl enable tails-autotest-remote-shell.service
  32. systemctl enable tails-reconfigure-kexec.service
  33. systemctl enable tails-reconfigure-memlockd.service
  34. systemctl enable tails-sdmem-on-media-removal.service
  35. systemctl enable tails-set-wireless-devices-state.service
  36. systemctl enable tails-tor-has-bootstrapped.target
  37. systemctl enable tails-wait-until-tor-has-bootstrapped.service
  38. systemctl enable tails-tor-has-bootstrapped-flag-file.service
  39. systemctl enable tor-controlport-filter.service
  40. # Enable our own systemd user unit files
  41. systemctl --global enable tails-add-GNOME-bookmarks.service
  42. systemctl --global enable tails-configure-keyboard.service
  43. systemctl --global enable tails-create-tor-browser-directories.service
  44. systemctl --global enable tails-security-check.service
  45. systemctl --global enable tails-upgrade-frontend.service
  46. systemctl --global enable tails-virt-notify-user.service
  47. systemctl --global enable tails-wait-until-tor-has-bootstrapped.service
  48. # Use socket activation only, to delay the startup of cupsd.
  49. # In practice, on Jessie this means that cupsd is started during
  50. # the initialization of the GNOME session, which is fine: by then,
  51. # the persistent /etc/cups has been mounted.
  52. # XXX: make sure it's the case on Stretch, adjust if not.
  53. systemctl disable cups.service
  54. systemctl enable cups.socket
  55. # We're starting NetworkManager, Tor and ttdnsd ourselves.
  56. # We disable tor.service (as opposed to tor@default.service) because
  57. # it's an important goal to never start Tor before the user has had
  58. # a chance to choose to do so in an obfuscated way: if some other
  59. # package enables tor@whatever.service someday, disabling tor.service
  60. # will disable it as well, while disabling tor@default.service would not.
  61. systemctl disable tor.service
  62. systemctl disable NetworkManager.service
  63. systemctl disable NetworkManager-wait-online.service
  64. systemctl disable ttdnsd.service
  65. # We don't run these services by default
  66. systemctl disable gdomap.service
  67. systemctl disable hdparm.service
  68. systemctl disable i2p.service
  69. # Don't hide tails-kexec's shutdown messages with an empty splash screen
  70. for suffix in halt kexec poweroff reboot shutdown ; do
  71. systemctl mask "plymouth-${suffix}.service"
  72. done
  73. # systemd-networkd fallbacks to Google's nameservers when no other nameserver
  74. # is provided by the network configuration. In Jessie, this service is disabled
  75. # by default, but it feels safer to make this explicit. Besides, it might be
  76. # that systemd-networkd vs. firewall setup ordering is suboptimal in this respect,
  77. # so let's avoid any risk of DNS leaks here.
  78. systemctl mask systemd-networkd.service
  79. # Do not sync the system clock to the hardware clock on shutdown
  80. systemctl mask hwclock-save.service
  81. # Do not run timesyncd: we have our own time synchronization mechanism
  82. systemctl mask systemd-timesyncd.service
  83. # Unmute and sanitize mixer levels at boot time
  84. # (`systemctl unmask` does not support initscripts on Jessie,
  85. # hence the manual unmasking)
  86. dpkg-divert --add --rename --divert \
  87. /lib/systemd/system/alsa-utils.service.orig \
  88. /lib/systemd/system/alsa-utils.service
  89. # Disable the ALSA state store/restore systemd services (that lack mixer
  90. # levels unmuting/sanitizing), we use the legacy initscript instead
  91. systemctl mask alsa-restore.service
  92. systemctl mask alsa-state.service
  93. systemctl mask alsa-store.service