qubes-core 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/bin/bash
  2. #
  3. # chkconfig: 345 90 90
  4. # description: Executes supplementary Qubes core scripts at VM boot
  5. #
  6. # Source function library.
  7. # shellcheck disable=SC1091
  8. . /etc/rc.d/init.d/functions
  9. # Source Qubes library.
  10. # shellcheck source=init/functions
  11. . /usr/lib/qubes/init/functions
  12. start()
  13. {
  14. have_qubesdb || return
  15. # Start AppVM specific services
  16. for svc in cups ntpd ; do
  17. if qsvc $svc && test -e /etc/init.d/$svc ; then
  18. /sbin/service $svc start
  19. fi
  20. done
  21. echo -n $"Finagling printer icon:"
  22. /usr/lib/qubes/init/control-printer-icon.sh
  23. success
  24. echo
  25. if qsvc meminfo-writer ; then
  26. MEM_CHANGE_THRESHOLD_KB=30000
  27. MEMINFO_DELAY_USEC=100000
  28. echo -n $"Starting Qubes memory information service:"
  29. /usr/lib/qubes/meminfo-writer $MEM_CHANGE_THRESHOLD_KB $MEMINFO_DELAY_USEC /var/run/meminfo-writer.pid
  30. success
  31. echo ""
  32. fi
  33. echo -n $"Executing Qubes misc post scripts:"
  34. # shellcheck disable=SC2015
  35. /usr/lib/qubes/init/misc-post.sh && success || failure
  36. echo
  37. }
  38. stop()
  39. {
  40. have_qubesdb || return
  41. /usr/lib/qubes/init/misc-post-stop.sh
  42. }
  43. case "$1" in
  44. start)
  45. start
  46. ;;
  47. stop)
  48. stop
  49. ;;
  50. *)
  51. echo $"Usage: $0 {start|stop}"
  52. exit 3
  53. ;;
  54. esac
  55. # shellcheck disable=SC2086
  56. exit $RETVAL