salt: Enabling services with runit fails

Description of Issue/Question

I am having trouble with the enable feature for runit services on Void Linux. Unfortunately I do not really understand what exactly is happening - in fact I don’t understand how this behaviour is even possible - but it seems services do not start up when being linked by saltstack.

Setup

Using a very simple sls like this:

cron:
  pkg.installed:
    - name: cronie
  service.running:
    - name: crond
    - enable: True
    - require:
      - pkg: cron

On void linux Linux mail.*.* 4.11.11_1 #1 SMP PREEMPT Sat Jul 15 21:48:45 UTC 2017 x86_64 GNU/Linux

Steps to Reproduce Issue

Make sure crond ist disabled:

[root@mail admin]# sv stop crond
ok: down: crond: 1s, normally up
[root@mail admin]# rm /var/service/cron*

run salt-call (in local mode, if that is relevant)

[root@mail admin]# salt-call --log-level debug state.apply
...
[INFO    ] Running state [cronie] at time 13:05:44.349576
[INFO    ] Executing state pkg.installed for [cronie]
[INFO    ] Executing command 'xbps-query -l' in directory '/root'
[DEBUG   ] Could not LazyLoad pkg.normalize_name: 'pkg.normalize_name' is not available.
[DEBUG   ] Could not LazyLoad pkg.hold: 'pkg.hold' is not available.
[INFO    ] Package cronie is already installed
[INFO    ] Completed state [cronie] at time 13:05:44.394560 duration_in_ms=44.983
[INFO    ] Running state [crond] at time 13:05:44.395975
[INFO    ] Executing state service.running for [crond]
[INFO    ] Executing command 'sv start /var/service/crond' in directory '/root'
[ERROR   ] Command 'sv start /var/service/crond' failed with return code: 1
[ERROR   ] output: fail: /var/service/crond: unable to change to service directory: file does not exist
[INFO    ] Executing command 'sv status /var/service/crond' in directory '/root'
[ERROR   ] Command 'sv status /var/service/crond' failed with return code: 1
[ERROR   ] stdout: fail: /var/service/crond: runsv not running
[ERROR   ] retcode: 1
[INFO    ] Executing command 'sv status /var/service/crond' in directory '/root'
[ERROR   ] Command 'sv status /var/service/crond' failed with return code: 1
[ERROR   ] stdout: fail: /var/service/crond: runsv not running
[ERROR   ] retcode: 1
[INFO    ] Executing command 'sv status /var/service/crond' in directory '/root'
[DEBUG   ] stdout: down: /var/service/crond: 0s
[ERROR   ] {'crond': True}
[INFO    ] Completed state [crond] at time 13:05:45.946656 duration_in_ms=1550.677
...
----------
          ID: cron
    Function: pkg.installed
        Name: cronie
      Result: True
     Comment: Package cronie is already installed
     Started: 13:05:44.349577
    Duration: 44.983 ms
     Changes:   
----------
          ID: cron
    Function: service.running
        Name: crond
      Result: False
     Comment: Service crond has been enabled, and is dead
     Started: 13:05:44.395979
    Duration: 1550.677 ms
     Changes:   
              ----------
              crond:
                  True
----------

now to check if crond is running and fix it:

[root@mail admin]# ls -l /var/service/crond
lrwxrwxrwx 1 root root 13 Jul 25 13:05 /var/service/crond -> /etc/sv/crond
[root@mail admin]# sv status crond
down: crond: 166s, normally up
[root@mail admin]# rm /var/service/crond
[root@mail admin]# ln -s /etc/sv/crond /var/service/crond
[root@mail admin]# sv status crond
run: crond: (pid 6990) 1s

Versions Report

running salt-call in local mode.

Salt Version:
           Salt: 2017.7.0
 
Dependency Versions:
           cffi: 1.10.0
       cherrypy: Not Installed
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: 2.0.2
      gitpython: 2.1.5
          ioflo: Not Installed
         Jinja2: 2.9.6
        libgit2: 0.26.0
        libnacl: Not Installed
       M2Crypto: 0.26.0
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: 2.18
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: 0.26.0
         Python: 2.7.13 (default, Jul 16 2017, 01:33:52)
   python-gnupg: Not Installed
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: 2.0.3
        timelib: Not Installed
        Tornado: 4.5.1
            ZMQ: 4.2.2
 
System Versions:
           dist:   
         locale: UTF-8
        machine: x86_64
        release: 4.11.11_1
         system: Linux
        version: Not Installed

my minon config:

[root@mail admin]# cat /etc/salt/minion
master_type: disable
file_client: local
fileserver_backend:
    - git
gitfs_remotes:
    - git@*/infrastructure.git:
      - pubkey: /etc/salt/*.pub
      - privkey: /etc/salt/*
      - root: salt

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 31 (21 by maintainers)

Most upvoted comments

@Vaelatern @sagetherage no I can’t. I unreliably reproduced it, not sure what I did. If I figure out what can reliably reproduce the bug I will let you know.