+ - 0:00:00
Notes for current slide
Notes for next slide

Welcome to DevOps State College

1 / 16

Why DevOps State College?

  • Build a community and make connections
  • Exchange ideas
  • Learn
  • Promote DevOps culture
  • Fun
  • Not tied to one vendor/technology
2 / 16

What is DevOps?

Grand unification of philosophy around how to manage Development (programmers, application analysts, application owners, project managers) and IT Operations (system admins, network admins, security, data center, storage, database admin) in a tightly-integrated way.

DevOps is the belief that working together as a collaborative team will produce better results, and break down barriers and finger pointing.

3 / 16

Future Presentations

4 / 16

Job Opportunities

5 / 16

Intro to systemd

  • Commands
    • systemctl
    • systemd-cgls
    • systemd-analyze
    • journalctl
6 / 16

Overview of all services

  • systemctl
    • show loaded active units
  • systemd-cgls
    • Recursively show control group contents
  • systemctl status
    • shows all system statuses for active units
  • systemctl list-unit-files
    • shows all unit files
7 / 16

Service Info

  • systemctl status apache2.service

    apache2.service - LSB: Apache2 web server Loaded: loaded (/etc/init.d/apache2) Active: active (running) since Wed 2016-03-09 12:13:04 EST; 1 day 4h ago Process: 784 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS) CGroup: /system.slice/apache2.service

    ├─1012 /usr/sbin/apache2 -k start
    ├─1017 /usr/sbin/apache2 -k start
    ├─1023 /usr/sbin/apache2 -k start
    └─1024 /usr/sbin/apache2 -k start
    • flags
    • -l: shows full lines. by default, elipsizes long lines
    • -n: shows N lines of log
    • works for other unit files to (socket, timer, etc...)
8 / 16

Reading the journal

  • journalctl
    • journalctl
    • shows all logs
    • journalctl _SYSTEMD_UNIT=apache2.service
    • shows logs from unit file
9 / 16

Managing Services

  • systemctl start
    • Starts a service. If no systemd unit file exists, will run /etc/init.d/service start
  • systemctl stop
    • Stops a service. If no systemd unit file exists, will run /etc/init.d/service stop
  • systemctl restart
    • Restarts a service. If no systemd unit file exists, will run /etc/init.d/service restart
  • systemctl reload
    • Reloads configuration for a service. In case of apache, would be httpd.conf
10 / 16

Analyzing System bootup

  • systemd-analyze

    Startup finished in 3.982s (kernel) + 14.781s (userspace) = 18.764s
  • systemd-analyze blame

    6.323s wysevpn.service
    4.030s networking.service
    2.472s exim4.service
    1.344s apache2.service
11 / 16

Writing service unit files

[Unit]
Description=recipe application
After=network.target
[Service]
PIDFile=/tmp/recipe.pid
User=ansible
Group=ansible
WorkingDirectory=/opt/recipe
ExecStart=/opt/recipe/python/bin/gunicorn -b 0.0.0.0:8080
--pid /tmp/recipe.pid recipe:app
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
  • systemctl daemon-reload
    • reloads service unit files from disk
12 / 16

Logging

  • Journal collects logging from 3 sources:

    1. All data logged via libc syslog()
    2. The data from the kernel logged with printk()
    3. Everything written to STDOUT/STDERR of any system service
13 / 16

Socket Activation

  • Listening sockets are created before the daemon is started
  • Dependencies don't matter
  • Services can be terminated and replaced without the client even knowing
  • Software needs to support it
14 / 16

Live Demo

16 / 16

Why DevOps State College?

  • Build a community and make connections
  • Exchange ideas
  • Learn
  • Promote DevOps culture
  • Fun
  • Not tied to one vendor/technology
2 / 16
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow