Question

I need to run service, here's code snippet for that:

/etc/init.d/collect-node:
  file.managed:
    - source: salt://scripts/collect_node.sh.j2
    - template: jinja
    - mode: 755

  service.running:
    - name: collect-node
    - enable: True
    - restart: True
    - watch:
      - file.managed: /etc/collect/node-config.json
      - file.managed: /etc/init.d/collect-node
    - require:
      - service.running: xvfb
      - user.present: collect

The node is managing by vagrant. So when I'm vagrant up node it's calling state.highstate but service is not running, but when I'm explicitly calling salt-call state.highstate in the console, the service starts to run.

What might be problem here? How I can diagnose the problem? Thanks

Was it helpful?

Solution

The problem was in dependencies, if other package, script or something is not ready yet then it silently won't run service.

That's why when all stuff are installed the state.highstate runs the service.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top