Agile Web Development
Liip.ch

What's new in Debian 8 Jessie ?

Also…


Why should I care?

Debian 8 Jessie

What's new then?

Only highlighting what is relevant to us!


See the What's New in the Release Notes

Linux 3.16

Virtualization

Xen 4.4

(without XCP)

LXC 1.0.6

Qemu-KVM 2.1

Use libvirt !

Virtualization no moar

Virtualbox

OpenVZ

Apache 2.4

NGinx 1.6

Apache HTTPD

Configuration files naming constraint

2.2


/etc/sites-available/sitename
                    

2.4


/etc/sites-available/sitename.conf
                    

Apache HTTPD

2.2

No restrictions

2.4

Has mod_authz_core by default


<Directory /var/www/my-poney>
    Require all granted
</Directory>
                    

Apache HTTPD

2.2 & 2.4 compatible code


<Directory /var/www/my-poney>
    <IfModule mod_authz_core.c>
        Require all granted
    </IfModule>
</Directory>
                    

PHP 5.6

No HHVM

PostgreSQL 9.4

MySQL 5.5

MariaDB 10.0.16

Python 3.4

Python 2.7 is still around!

End-of-life in 2020

Will get removed from Stretch

What else?

By a wide margin,

the largest

  • flamewar in the (recent) Debian history,
  • number of emails on the discussion bug
    (> 7000, bug page weighs 11M),
  • number of ragequit or other related resignations,

Competitors

  • SysVinit (all distros 10 years ago)
  • upstart (Ubuntu, ChromeOS, old RedHat)
  • systemd (RedHat, most other modern distros)
  • OpenRC

The distinction no longer matters

Literally everyone relevant is moving to systemd

Init systems used to be about

Starting and stopping services

But what happens when

A service crashes?

systemd
is about monitoring services

Ever heard of supervisord?

systemd

Leverages Linux cgroups

to track all child processes

systemd

doesn't impose double-forking

can hand over sockets

Sysvinit


/etc/init.d/apache2 {start|stop|graceful-stop|restart|reload|force-reload}
                    

Sysvinit - 2nd try


service apache2 {start|stop|graceful-stop|restart|reload|force-reload}
                    

systemd


systemctl {start|stop|graceful-stop|restart|reload|force-reload|…} apache2 
                    

Gives no output by default

Distro-agnostic


service apache2 {start|stop|graceful-stop|restart|reload|force-reload}
                    

Better status


# service apache2 status
● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2)
   Active: active (running) since jeu 2015-04-23 09:20:13 CEST; 5min ago
  Process: 23103 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
  Process: 23128 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/apache2.service
           ├─23143 /usr/sbin/apache2 -k start
           ├─23146 /usr/sbin/apache2 -k start
           ├─23148 /usr/sbin/apache2 -k start
           ├─23149 /usr/sbin/apache2 -k start
           ├─23150 /usr/sbin/apache2 -k start
           ├─23151 /usr/sbin/apache2 -k start
           └─23152 /usr/sbin/apache2 -k start

avr 23 09:20:11 gyllingar apache2[23128]: Starting web server: apache2AH00112: Warning: ...ist
avr 23 09:20:11 gyllingar apache2[23128]: AH00558: apache2: Could not reliably determine...age
avr 23 09:20:13 gyllingar apache2[23128]: .
Hint: Some lines were ellipsized, use -l to show in full.
                    

journald

Layer between processes and syslog

Logs to syslog by default

journald commands

Follow everything


journalctl -f
                    

Follow a unit


journalctl -f -u ssh
                    

journald internal format


jeu 2015-04-23 09:52:48.739973 CEST [s=f5941da87c7a447e93cda921ca2b18f3;i=d61;b=899d63693bd54bb98a5ca96f012c9f8f;m=7b104cc42;t=5145f90
    PRIORITY=6
    _UID=0
    _GID=0
    _BOOT_ID=899d63693bd54bb98a5ca96f012c9f8f
    _MACHINE_ID=a8879639f90ca539f9b0c3ea00000f94
    _HOSTNAME=gyllingar
    SYSLOG_FACILITY=3
    _TRANSPORT=stdout
    _CAP_EFFECTIVE=3fffffffff
    _SYSTEMD_CGROUP=/
    SYSLOG_IDENTIFIER=apache2
    _COMM=apache2
    _SYSTEMD_UNIT=apache2.service
    MESSAGE=Reloading web server: apache2.
    _PID=24323

journald advantages

  • Structured log, more than vomit to syslog
  • Captures stdout, stderr and log

Services description

Services under SysVinit


#! /bin/sh
### BEGIN INIT INFO
# Provides:          cups
# Required-Start:    $syslog $remote_fs
# Required-Stop:     $syslog $remote_fs
# Should-Start:      $network avahi-daemon slapd nslcd
# Should-Stop:       $network
# X-Start-Before:    samba
# X-Stop-After:      samba
# Default-Start:     2 3 4 5
# Default-Stop:      1
# Short-Description: CUPS Printing spooler and server
# Description:       Manage the CUPS Printing spooler and server;
#                    make it's web interface accessible on http://localhost:631/
### END INIT INFO

# Author: Debian Printing Team 

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/cupsd
NAME=cupsd
PIDFILE=/var/run/cups/$NAME.pid
DESC="Common Unix Printing System"
SCRIPTNAME=/etc/init.d/cups

unset TMPDIR

# Exit if the package is not installed
test -x $DAEMON || exit 0

mkdir -p /var/run/cups/certs
[ -x /sbin/restorecon ] && /sbin/restorecon -R /var/run/cups

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
. /lib/lsb/init-functions

# Get the timezone set.
if [ -z "$TZ" -a -e /etc/timezone ]; then
    TZ=`cat /etc/timezone`
    export TZ
fi

case "$1" in
  start)
        log_daemon_msg "Starting $DESC" "$NAME"

        mkdir -p `dirname "$PIDFILE"`
        start-stop-daemon --start --quiet --oknodo --pidfile "$PIDFILE" --exec $DAEMON
        status=$?
        [ $status = 0 ] && coldplug_usb_printers
        log_end_msg $status
        ;;
  stop)
        log_daemon_msg "Stopping $DESC" "$NAME"
        start-stop-daemon --stop --quiet --retry 5 --oknodo --pidfile $PIDFILE --name $NAME
        status=$?
        log_end_msg $status
        ;;
  reload|force-reload)
       log_daemon_msg "Reloading $DESC" "$NAME"
       start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME --signal 1
       status=$?
       log_end_msg $status
       ;;
  restart)
        log_daemon_msg "Restarting $DESC" "$NAME"
        if start-stop-daemon --stop --quiet --retry 5 --oknodo --pidfile $PIDFILE --name $NAME; then
                start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec $DAEMON
        fi
        status=$?
        log_end_msg $status
        ;;
  status)
        status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME" && exit 0 || exit $?
        ;;
  *)
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
        exit 3
        ;;
esac

exit 0
                  

Services under systemd


[Unit]
Description=CUPS Scheduler
Documentation=man:cupsd(8)

[Service]
ExecStart=/usr/sbin/cupsd -l
Type=simple

[Install]
Also=cups.socket cups.path
WantedBy=printer.target
                  

Declarative FTW!

More infos

  • systemd slides by the former DPL
  • man systemd
  • man systemd.unit
  • man systemd.socket
  • man sysctl
  • man journald