Guest User

Untitled

a guest
Feb 17th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. ## Here is the script I will enabled in a SystemD Unit for testing purposes
  2. [centos@localhost ~]$ cat ~/test.sh
  3. #!/bin/sh
  4. echo "hello"
  5.  
  6. ## Here is the documentation file I will reference in the SystemD Unit
  7. [centos@localhost ~]$ cat ~/test.txt
  8.  
  9. this is a piece of test documentation
  10.  
  11. ## Here is the System D Unit file
  12. [centos@localhost ~]$ cat /etc/systemd/system/test1.service
  13.  
  14. [Unit]
  15. Description=Test
  16. Documentation=file://localhost/home/centos/test.txt
  17.  
  18. [Service]
  19. ExecStart=/home/centos/test.sh
  20.  
  21. [Install]
  22. WantedBy=multi-user.target
  23.  
  24. [centos@localhost ~]$ sudo systemctl daemon-reload
  25. [centos@localhost ~]$ sudo systemctl restart test1.service
  26. [centos@localhost ~]$ sudo systemctl status test1.service
  27. ● test1.service - Test
  28. Loaded: loaded (/etc/systemd/system/test1.service; enabled; vendor preset: disabled)
  29. Active: inactive (dead) since Sun 2019-02-17 18:37:13 GMT; 6s ago
  30. Docs: file://localhost/home/centos/test.txt
  31. Process: 16036 ExecStart=/home/centos/test.sh (code=exited, status=0/SUCCESS)
  32. Main PID: 16036 (code=exited, status=0/SUCCESS)
  33.  
  34. Feb 17 18:37:13 localhost.localdomain systemd[1]: Started Test.
  35. Feb 17 18:37:13 localhost.localdomain test.sh[16036]: hello
  36.  
  37. ## Here is the problem:
  38. [centos@localhost ~]$ systemctl help test1.service
  39. Can't show: file://localhost/home/centos/test.txt
  40.  
  41. file://localhost/home/centos/test.txt
  42. file:///home/centos/test.txt
  43. file:/home/centos/test.txt
Add Comment
Please, Sign In to add comment