shepherd.scm 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. ;; This is my start up shepherd program
  2. ;; New option '--fg-daemon'. This is the same as '--daemon', except
  3. ;; it runs in the foreground and does not fork. This is intended for
  4. ;; modern init systems such as systemd, which manage many of the traditional
  5. ;; aspects of daemon behavior themselves. '--bg-daemon' is now an alias
  6. ;; for '--daemon'.
  7. (define emacs (make <service>
  8. #:provides '(emacs)
  9. #:requires '() ;;I should consider using emacs --fg-daemon
  10. #:start (make-system-constructor "emacs --daemon")
  11. #:stop (make-system-constructor "emacsclient --eval \"(kill-emacs)\"")
  12. ))
  13. (define icecat (make <service>
  14. #:provides '(icecat)
  15. #:requires '(networking)
  16. #:start (make-system-constructor "icecat")
  17. ;; how do I stop icecat???
  18. ))
  19. (define sway (make <service>
  20. #:provides '(sway)
  21. #:requires '()
  22. #:start (make-system-constructor "exec sway")
  23. #:stop (make-system-constructor "swaymsg exit") ;; or exec swaymsg exit??
  24. ))
  25. (register-services emacs)
  26. ;;(action 'shepherd 'daemonize)
  27. ;; send shepherd into background
  28. ;; (for-each start (list emacs))
  29. ;; services to start automatically