A cross-platform service manager
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
672B

  1. package main
  2. import (
  3. "fmt"
  4. "git.rootprojects.org/root/go-serviceman/manager"
  5. "git.rootprojects.org/root/go-serviceman/service"
  6. )
  7. func printLogMessage(conf *service.Service) {
  8. sudo := ""
  9. unit := "--unit"
  10. if conf.System {
  11. if !manager.IsPrivileged() {
  12. sudo = "sudo"
  13. }
  14. } else {
  15. unit = "--user-unit"
  16. }
  17. fmt.Println("If all went well you should be able to see some goodies in the logs:\n")
  18. fmt.Printf("\t%sjournalctl -xe %s %s.service\n", sudo, unit, conf.Name)
  19. if !conf.System {
  20. fmt.Println("\nIf that's not the case, see https://unix.stackexchange.com/a/486566/45554.")
  21. fmt.Println("(you may need to run `systemctl restart systemd-journald`)")
  22. }
  23. }