Guest User

Untitled

a guest
Jan 26th, 2018
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.55 KB | None | 0 0
  1. [Unit]
  2. Description=pipeline remove tickets worker instances as a service, instance %i
  3. Requires=pipeline-remove.service
  4. Before=pipeline-remove.service
  5. BindsTo=pipeline-remove.service
  6.  
  7. [Service]
  8. PermissionsStartOnly=true
  9. Type=idle
  10. User=root
  11. ExecStart=/path/to/venv/bin/python /pipeline/python/daemons/remove_tickets.py
  12. Restart=always
  13. TimeoutStartSec=10
  14. RestartSec=10
  15.  
  16. [Install]
  17. WantedBy=pipeline-remove.service
  18.  
  19. [Unit]
  20. Description=manages pipeline remove tickets worker instances as a service, instance
  21.  
  22. [Service]
  23. Type=oneshot
  24. ExecStart=/usr/bin/sh /usr/bin/pipeline-remove-start.sh
  25. RemainAfterExit=yes
  26.  
  27. [Install]
  28. WantedBy=multi-user.target
  29.  
  30. #!/bin/bash
  31. systemctl start pipeline-remove@{1..2}
  32.  
  33. PIPELINE_VIRTUALENV=/path/to/venv
  34.  
  35. [Unit]
  36. Description=pipeline remove tickets worker instances as a service, instance %i
  37. Requires=pipeline-remove.service
  38. Before=pipeline-remove.service
  39. BindsTo=pipeline-remove.service
  40.  
  41. [Service]
  42. PermissionsStartOnly=true
  43. Type=idle
  44. User=root
  45. EnvironmentFile=/etc/profile.d/pipeline_envvars.sh
  46. ExecStart=/${PIPELINE_VIRTUALENV}/bin/python /pipeline/python/daemons/remove_tickets.py
  47. Restart=always
  48. TimeoutStartSec=10
  49. RestartSec=10
  50.  
  51. [Install]
  52. WantedBy=pipeline-remove.service
  53.  
  54. sudo systemctl daemon-reload
  55. sudo systemctl restart pipeline-remove@{1..1}
  56. sudo systemctl status pipeline-remove@{1..1}
  57.  
  58. ● pipeline-remove@1.service - pipeline remove tickets worker instances as a service, instance 1
  59. Loaded: loaded (/etc/systemd/system/pipeline-remove@.service; disabled; vendor preset: disabled)
  60. Active: activating (auto-restart) (Result: exit-code) since Fri 2018-01-26 15:04:50 UTC; 6s ago
  61. Process: 11716 ExecStart=/${PIPELINE_VIRTUALENV}/bin/python /pipeline/python/daemons/remove_tickets.py (code=exited, status=203/EXEC)
  62. Main PID: 11716 (code=exited, status=203/EXEC)
  63.  
  64. Jan 26 15:04:50 dev systemd[1]: pipeline-remove@1.service: main process exited, code=exited, status=203/EXEC
  65. Jan 26 15:04:50 dev systemd[1]: Unit pipeline-remove@1.service entered failed state.
  66. Jan 26 15:04:50 dev systemd[1]: pipeline-remove@1.service failed.
  67.  
  68. Jan 26 15:07:13 dev systemd: Starting pipeline remove tickets worker instances as a service, instance 1...
  69. Jan 26 15:07:13 dev systemd: Failed at step EXEC spawning /${PIPELINE_VIRTUALENV}/bin/python: No such file or directory
  70. Jan 26 15:07:13 dev systemd: pipeline-remove@1.service: main process exited, code=exited, status=203/EXEC
  71. Jan 26 15:07:13 dev systemd: Unit pipeline-remove@1.service entered failed state.
  72. Jan 26 15:07:13 dev systemd: pipeline-remove@1.service failed.
  73. Jan 26 15:07:23 dev systemd: pipeline-remove@1.service holdoff time over, scheduling restart.
  74. Jan 26 15:07:23 dev systemd: Started pipeline remove tickets worker instances as a service, instance 1.
  75.  
  76. Failed to start pipeline-remove@1.service: Unit is not loaded properly:
  77. Invalid argument.
  78. See system logs and 'systemctl status pipeline-remove@1.service' for
  79. details.
  80.  
  81. vagrant@dev:~$ sudo systemctl status pipeline-remove@{1..1}
  82. ● pipeline-remove@1.service - pipeline remove tickets worker instances as a service, instance 1
  83. Loaded: error (Reason: Invalid argument)
  84. Active: inactive (dead)
  85.  
  86. Jan 26 15:11:39 dev systemd[1]: pipeline-remove@1.service failed.
  87. Jan 26 15:11:42 dev systemd[1]: Stopped pipeline remove tickets worker instances as a service, instance 1.
  88. Jan 26 15:11:42 dev systemd[1]: [/etc/systemd/system/pipeline-remove@.service:12] Executable path is not absolute, ignoring: ${PIPELINE_VIRTUALENV}/bin/python /pipel...e_tickets.py
  89. Jan 26 15:11:42 dev systemd[1]: pipeline-remove@1.service lacks both ExecStart= and ExecStop= setting. Refusing.
Add Comment
Please, Sign In to add comment