GithubHelp home page GithubHelp logo

Comments (14)

majormoses avatar majormoses commented on August 16, 2024

Interesting as it should be using systemd on Ubuntu 16.04 and sensu 1.4.2 and I know this worked previously at my last company as that is what they used. I don't recall doing anything special to make this happen.

from sensu-chef.

majormoses avatar majormoses commented on August 16, 2024

Can you try replicating this with older versions of chef?

from sensu-chef.

majormoses avatar majormoses commented on August 16, 2024

I also see you are using dokken can you please include a gist of what your config looks like? I recall needing to specify pid_one_command: /bin/systemd in your .kitchen.yml

from sensu-chef.

majormoses avatar majormoses commented on August 16, 2024

I conferred with a colleague of mine at the last place and we did have to do some magic to make systemd work with sensu in a container. Here is the platform section he gave me:

platforms:
 - name: ubuntu-1604
   named_run_list: debian
   driver:
     image: ubuntu:16.04
     pid_one_command: /bin/systemd
     volumes:
       - /sys/fs/cgroup:/sys/fs/cgroup:ro # required by systemd
     intermediate_instructions: # make systemd work as process 1
       # install addtional packages that can't be installed by cookbook
       - ENV container docker
       - RUN rm -rf /var/lib/apt/lists/*
       - RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done)
       - RUN rm -f /lib/systemd/system/multi-user.target.wants/*
       - RUN rm -f /etc/systemd/system/*.wants/*
       - RUN rm -f /lib/systemd/system/local-fs.target.wants/*
       - RUN rm -f /lib/systemd/system/sockets.target.wants/*udev*
       - RUN rm -f /lib/systemd/system/sockets.target.wants/*initctl*
       - RUN rm -f /lib/systemd/system/basic.target.wants/*
       - RUN rm -f /lib/systemd/system/anaconda.target.wants/*
       - RUN apt-get -y update
       - RUN apt-get install -y apt-transport-https build-essential zlib1g-dev python-pip sudo net-tools
       - RUN pip install PyYAML && pip install awscli

from sensu-chef.

jarnohenneman avatar jarnohenneman commented on August 16, 2024

Thank you @majormoses , will give it a test to see if its working!

Unfortunately no smoke light yet,,, this is the kitchen Im trying with:

---
driver:
  name: dokken
  chef_version: latest
  privileged: true # because Docker and SystemD/Upstart
  customize:
    memory: '512'

transport:
  name: dokken

provisioner:
  name: dokken

verifier:
  name: inspec

platforms:
  - name: ubuntu-16.04
    driver:
      # image: ubuntu:16.04
      image: dokken/ubuntu-16.04
      pid_one_command: /bin/systemd
      volumes:
        - /sys/fs/cgroup:/sys/fs/cgroup:ro # required by systemd
      intermediate_instructions: # make systemd work as process 1
        # install addtional packages that can't be installed by cookbook
        - ENV container docker
        - RUN rm -rf /var/lib/apt/lists/*
        - RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done)
        - RUN rm -f /lib/systemd/system/multi-user.target.wants/*
        - RUN rm -f /etc/systemd/system/*.wants/*
        - RUN rm -f /lib/systemd/system/local-fs.target.wants/*
        - RUN rm -f /lib/systemd/system/sockets.target.wants/*udev*
        - RUN rm -f /lib/systemd/system/sockets.target.wants/*initctl*
        - RUN rm -f /lib/systemd/system/basic.target.wants/*
        - RUN rm -f /lib/systemd/system/anaconda.target.wants/*
        - RUN apt-get -y update
        - RUN apt-get install -y apt-transport-https build-essential zlib1g-dev python-pip sudo net-tools
        - RUN pip install PyYAML && pip install awscli
    run_list:
      - recipe[apt]
    attributes:
      apt:
        compile_time_update: true

suites:
- name: default
  run_list:
    - recipe[monitor::master]

from sensu-chef.

jarnohenneman avatar jarnohenneman commented on August 16, 2024

Can you try replicating this with older versions of chef?

It used to work with chef-lxc and chef12, but would like to throw lxc out of the window and go for a container like setup.

from sensu-chef.

majormoses avatar majormoses commented on August 16, 2024

@jarnohenneman I see you are using the monitor cookbook which is quite old and not been updated. If you are using all the default attributes (not properly overriding them) the version of sensu defined does not include a systemd unit file which I believe started shipping in 0.27. I know that when I was there we were also on chef 12 and I am not sure if they have upgraded to chef 13 yet. I can try asking if they have done that yet. That being said at my current org we are using chef 13 our setup but are still sadly on Ubuntu 14.04 so I cant really confirm what other changes would be necessary.

from sensu-chef.

autarchprinceps avatar autarchprinceps commented on August 16, 2024

We are not using the supermarket monitor cookbook. As mentioned we are deploying sensu in version 1.4 not 0.27. It works for us with Chef 12 on VMs / Cloud instances, be it as a test with kitchen or in production, and as mentioned in our usual quick testing environment of kitchen-lxc.
Sensu is also entirely installed by the sensu cookbook (meaning the one this discussion is in). The purpose of our cookbook, is to setup the basic checks of every system and the sensu gems/plugins, handlers, etc. necessary to do so, as well as the transport and therefore the target of sensu-clients to which to report to. What we certainly do not modify is the fact that there is a service, or that it is started, enabled, etc. and how that works one different distributions or operating systems.

from sensu-chef.

majormoses avatar majormoses commented on August 16, 2024

It used to work with chef-lxc and chef12, but would like to throw lxc out of the window and go for a container like setup.

Can we try changing one thing at a time to see if its more of a dokken/docker issue and use chef 12?

@autarchprinceps makes sense, I would have no way of knowing that its an internal cookbook based on the code block I was given. I will try to see if I can put together a minimal reproduction case when I have some time. It might be a bit as I have very limited personal time for the next week or so due to some family events.

from sensu-chef.

majormoses avatar majormoses commented on August 16, 2024

To help me reproduce does this happen only on the server component or does it fail on client as well?

from sensu-chef.

majormoses avatar majormoses commented on August 16, 2024

I was not able to reproduce this with a minimal setup, perhaps with more information as to what you are doing in your custom cookbook I will be able to further assist.

Minimal setup: https://github.com/sensu/sensu-chef/compare/feature/local-dokken-testing?expand=1

Output: https://gist.github.com/majormoses/ef35735eaf05b38bda9aba9fd7f96b2a

from sensu-chef.

jarnohenneman avatar jarnohenneman commented on August 16, 2024

Thank you @majormoses , think I have it running let me do some more testing and get back to you

from sensu-chef.

jarnohenneman avatar jarnohenneman commented on August 16, 2024

For me its working now with the following setup;

---
driver:
  name: dokken
  chef_version: latest
  privileged: true # because Docker and SystemD/Upstart

platforms:
  - name: ubuntu-16.04
    driver:
      image: dokken/ubuntu-16.04
      pid_one_command: /bin/systemd

My problem was that I ended up commenting to much recipes, or saying it differently sensu::default is required to run sensu::server_service - sensu::api_service - sensu::client_service, not sure why but above worked for me. Thank you so much @majormoses !

from sensu-chef.

jarnohenneman avatar jarnohenneman commented on August 16, 2024

Its working perfectly @majormoses ! Thank you for your help I'm closing the issue.

from sensu-chef.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.