qubes-core 1.1 KB

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