2017-11-30 1 views
1

나는 지역 내 요리 책을 테스트 고정 표시기우분투 16.04 이미지를 사용하고 있습니다. kitchen converge을 수행하는 동안 다음 오류가 발생합니다. systemctl이 제대로 작동하지 않는다고 생각했습니다. 누군가가이 문제를 해결하기 위해 나를 도울 수 있습니까 또는 같은 것을 달성하는 다른 방법은 없습니까?systemctl 오류가 '버스에 연결하지 못했습니다 : 없음 같은 파일 또는 디렉터리'

[2017-11-30T15:22:30+00:00] INFO: Running queued delayed notifications before re-raising exception 

Running handlers: 
    [2017-11-30T15:22:30+00:00] ERROR: Running exception handlers 
    Running handlers complete 
    [2017-11-30T15:22:30+00:00] ERROR: Exception handlers complete 
    Chef Client failed. 9 resources updated in 06 seconds 
    [2017-11-30T15:22:30+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out 
    [2017-11-30T15:22:30+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report 
    [2017-11-30T15:22:30+00:00] ERROR: envoy_auth_apps_setup[default-service] (envoy_auth_apps::_default line 1) had an error: Chef::Exceptions::MultipleFailures: Multiple failures occurred: 
    * Mixlib::ShellOut::ShellCommandFailed occurred in chef run: execute[systemctl daemon-reload] (/tmp/kitchen/cache/cookbooks/envoy_auth_apps/resources/setup.rb line 133) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1' 
    ---- Begin output of systemctl daemon-reload ---- 
    STDOUT: 
    STDERR: Failed to connect to bus: No such file or directory 
    ---- End output of systemctl daemon-reload ---- 
    Ran systemctl daemon-reload returned 1 
    * Mixlib::ShellOut::ShellCommandFailed occurred in delayed notification: service[envoy] (/tmp/kitchen/cache/cookbooks/envoy_auth_apps/resources/setup.rb line 194) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1' 
    ---- Begin output of /bin/systemctl --system restart envoy ---- 
    STDOUT: 
    STDERR: Failed to connect to bus: No such file or directory 
    ---- End output of /bin/systemctl --system restart envoy ---- 
    Ran /bin/systemctl --system restart envoy returned 1 

    [2017-11-30T15:22:30+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1) 
>>>>>> ------Exception------- 
>>>>>> Class: Kitchen::ActionFailed 
>>>>>> Message: 1 actions failed. 
>>>>>>  Converge failed on instance <default-ubuntu>. Please see .kitchen/logs/default-ubuntu.log for more details 
>>>>>> ---------------------- 
>>>>>> Please see .kitchen/logs/kitchen.log for more details 
>>>>>> Also try running `kitchen diagnose --all` for configuration 

이 컨테이너에 systemd 서비스를 지원하지 않습니다 내 .kitchen.yml

--- 

driver: 
    name: docker 
    binary: /usr/local/bin/docker 
    use_sudo: false 
    network: 
    - ["public_network", "bridge: 'en0: Wi-Fi (AirPort)'"] 

provisioner: 
    name: chef_zero 
    require_chef_omnibus: "12.21.14" 
    environments_path: test/integration/environments 
    nodes_path: test/integration/nodes 
    data_bags_path: test/integration/data_bags 
    client_rb: 
    environment: development 

verifier: 
    name: inspec 

platforms: 
    - name: ubuntu 
    driver_config: 
     image: ubuntu:xenial 
     platform: ubuntu 
#  provision_command: 
#  - apt-get -y install dbus 

suites: 
    - name: default 
    run_list: 
# - recipe[base_app] 
     - recipe[envoy_auth_apps::_default] 
    verifier: 
     inspec_tests: 
     - test/integration/default 
attributes: 
    nameserver: 
    domain_name: 'kitchen.xyz.io' 
    envoy_auth_apps: 
    consul_client_enabled: false 
+0

systemctl은 systemd를 실행하고있는 경우에만 작동하며 docker 컨테이너에서 systemd를 사용하는 것이 특히 좋은 생각은 아닙니다. Docker Way는 컨테이너가 실행될 단일 서비스를 직접 호출하는 것이지만 init 시스템을 각 컨테이너에 설치하십시오. –

답변

2

일반적으로 고정 표시기,하지만 당신은 몇 가지 추가 호스트 구성과 특별한 ubuntu systemd 이미지를 사용할 수 있습니다. 이 이미지 은 프로덕션 환경에서을 실행하지 않는 것이 좋습니다. 당신이 systemd (추가 필요 마운트 및 플래그)로 컨테이너를 실행 할 수 있습니다, 그리고

docker run --rm --privileged -v /:/host solita/ubuntu-systemd setup

:

첫째, 당신은 당신의 호스트가이 이미지를 실행할 수 있도록 설정할 필요가

docker run -d --name systemd --security-opt seccomp=unconfined \ 
--tmpfs /run --tmpfs /run/lock -v /sys/fs/cgroup:/sys/fs/cgroup:ro \ 
-t solita/ubuntu-systemd 
+0

테스트 키친은 프로덕션 시스템이 아닌 통합 테스트 스위트입니다. – coderanger

+0

"우분투 시스템"이미지로 시도했지만 작동하지 않습니다. 위에 표시된 것과 동일한 오류가 발생합니다. 이 이미지는 ** systemd ** 용이지만 제 경우에는 ** systemctl **입니다. 문제인가? –

+0

** systemd **는 init 시스템 및 시스템 관리자입니다. ** systemctl **은 systemd 서비스를 관리하는 명령 줄 도구입니다. 목표를 달성하는 데 도움이되는 몇 가지 에디션을 추가했습니다. –

2

kitchen-docker은 실제로 systemd와 작동하도록 설정되지 않았습니다. 대신 kitchen-dokken을 사용하는 것이 좋습니다. 이렇게하면 쉽게 설정할 수 있습니다.

0

예, 동일한 것을 달성하는 또 다른 방법이 있습니다! 당신은 표준 시스템의 systemctl을 https://github.com/gdraheim/docker-systemctl-replacement으로 대체 할 수 있습니다 ... 놀랍도록 많은 수의 환경에서 작동하지만, 지금까지는 부엌으로 테스트하지 않았습니다. 시도해보고 싶다면 의견을 보내주십시오.

관련 문제