Comments (14)
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.
Can you try replicating this with older versions of chef?
from sensu-chef.
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.
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.
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.
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.
@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.
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.
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.
To help me reproduce does this happen only on the server component or does it fail on client as well?
from sensu-chef.
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.
Thank you @majormoses , think I have it running let me do some more testing and get back to you
from sensu-chef.
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.
Its working perfectly @majormoses ! Thank you for your help I'm closing the issue.
from sensu-chef.
Related Issues (20)
- Execute integration tests on Travis HOT 2
- Consistency with Sensu Plugins development HOT 1
- testing slack integration.
- Enterprise data bag for enterprise repo credentials does not seem to work HOT 3
- Amazon Linux 2 support HOT 4
- Document how to install gems into a non embedded ruby setup HOT 5
- Cookbook breaks in Chef < 13 because of apt cookbook dependency HOT 12
- Changelog for 5.1.2 missing HOT 3
- server components should be broken out into a unique cookbook HOT 13
- rabbitmq-server Fails to Start After Updating Erlang Packages HOT 8
- Package install is never up to date HOT 5
- How do I add keys to a `sensu_check` resources that are not part of the spec? HOT 2
- Yum package versioning is busted HOT 3
- i want to create a document for chef14. HOT 1
- Sensu server and api restart every run since Chef 14
- Sensu installation fails due to rabbitmq cookbook HOT 3
- Unsigned packages can't be installed on systems that support gpg key checking HOT 3
- The repository 'https://repositories.sensuapp.org/apt cosmic Release' does not have a Release file. HOT 1
- Install fails on RHEL8 clients
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sensu-chef.