askb

Untitled

Mar 30th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1.  
  2. $ sudo systemctl start helloworld2@{1..4}.service
  3. Failed to start [email protected]: Unit [email protected] failed to load: No such file or directory.
  4. Failed to start [email protected]: Unit [email protected] failed to load: No such file or directory.
  5. Failed to start [email protected]: Unit [email protected] failed to load: No such file or directory.
  6. Failed to start [email protected]: Unit [email protected] failed to load: No such file or directory.
  7.  
  8. core@core-01 /etc/systemd/system $ systemctl list-unit-files | grep helloworld
  9. helloworld.service enabled
  10. helloworld2.service enabled
  11.  
  12. $ systemctl cat helloworld2.service
  13. # /etc/systemd/system/helloworld2.service
  14. [Unit]
  15. Description=%n Service
  16. After=docker.service
  17. Requires=docker.service
  18.  
  19. [Service]
  20. TimeoutStartSec=0
  21. ExecStartPre=-/usr/bin/docker kill %p-%i
  22. ExecStartPre=-/usr/bin/docker rm %p-%i
  23. ExecStartPre=/usr/bin/docker pull busybox
  24. ExecStart=/usr/bin/docker run --name %p-%i busybox /bin/sh -c "while true; do echo Hello from %p-%i running on %H; sleep 1; done"
  25. ExecStop=-/usr/bin/docker rm -f %p-%i
  26.  
  27. [Install]
  28. WantedBy=multi-user.target
Add Comment
Please, Sign In to add comment