Agile Web Development
Liip.ch
Only highlighting what is relevant to us!
See the What's New in the Release Notes
(without XCP)
Configuration files naming constraint
/etc/sites-available/sitename
/etc/sites-available/sitename.conf
No restrictions
Has mod_authz_core by default
<Directory /var/www/my-poney>
Require all granted
</Directory>
<Directory /var/www/my-poney>
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
</Directory>
By all means…
By a wide margin,
Init systems used to be about
But what happens when
Ever heard of supervisord?
to track all child processes
/etc/init.d/apache2 {start|stop|graceful-stop|restart|reload|force-reload}
service apache2 {start|stop|graceful-stop|restart|reload|force-reload}
systemctl {start|stop|graceful-stop|restart|reload|force-reload|…} apache2
Gives no output by default
service apache2 {start|stop|graceful-stop|restart|reload|force-reload}
# 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.
Layer between processes and syslog
Logs to syslog by default
journalctl -f
journalctl -f -u ssh
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
#! /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
[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!
man systemd
man systemd.unit
man systemd.socket
man sysctl
man journald
© 2015 - Liip SA - Didier Raboud
© Pixar for all Toy Story caracters
http://reveal.odyx.org/Debian/20150423-Debian-Jessie-whats-new.html