Upgrade to Pro — share decks privately, control downloads, hide ads and more …

systemd: wymyślmy jeszcze jedno koło

Tomasz
January 15, 2011

systemd: wymyślmy jeszcze jedno koło

Prezentacja w ramach Zimowiska TLUG 2011. Wprowadzenie do systemd.
http://vimeo.com/20205771

Tomasz

January 15, 2011
Tweet

More Decks by Tomasz

Other Decks in Technology

Transcript

  1. Autorzy systemd% git log --format=%an | sort -u | wc

    -l 47 >10 commitów: Michael Biebl, Kay Sievers, Lennart Pöttering Pomysły: reszta świata
  2. Usługi - kontrola WorkingDirectory= RootDirectory= User= Group= SupplementaryGroups= Nice= OOMScoreAdjust=

    IOSchedulingClass= IOSchedulingPriority= CPUSchedulingPolicy= CPUSchedulingPriority= CPUSchedulingResetOnFork= CPUAffinity= UMask= Environment= EnvironmentFile= StandardInput= StandardOutput= StandardError= TTYPath= SyslogIdentifer= SyslogFacility= SyslogLevel= SyslogLevelPrefix= TimerSlackNSec= LimitCPU= LimitFSIZE= LimitDATA= LimitSTACK= LimitCORE= LimitRSS= LimitNOFILE= LimitAS= LimitNPROC= LimitMEMLOCK= LimitLOCKS= LimitSIGPENDING= LimitMSGQUEUE= LimitNICE= LimitRTPRIO= LimitRTTIME= PAMName= TCPWrapName= Capabilities= SecureBits= CapabilityBoundingSetDrop= ControlGroup= ReadWriteDirectories= ReadOnlyDirectories= InaccessibleDirectories= PrivateTmp= MountFlags=
  3. Usługi - kontrola WorkingDirectory= RootDirectory= User= Group= SupplementaryGroups= Nice= OOMScoreAdjust=

    IOSchedulingClass= IOSchedulingPriority= CPUSchedulingPolicy= CPUSchedulingPriority= CPUSchedulingResetOnFork= CPUAffinity= UMask= Environment= EnvironmentFile= StandardInput= StandardOutput= StandardError= TTYPath= SyslogIdentifer= SyslogFacility= SyslogLevel= SyslogLevelPrefix= TimerSlackNSec= LimitCPU= LimitFSIZE= LimitDATA= LimitSTACK= LimitCORE= LimitRSS= LimitNOFILE= LimitAS= LimitNPROC= LimitMEMLOCK= LimitLOCKS= LimitSIGPENDING= LimitMSGQUEUE= LimitNICE= LimitRTPRIO= LimitRTTIME= PAMName= TCPWrapName= Capabilities= SecureBits= CapabilityBoundingSetDrop= ControlGroup= ReadWriteDirectories= ReadOnlyDirectories= InaccessibleDirectories= PrivateTmp= MountFlags=
  4. Usługi - kontrola WorkingDirectory= RootDirectory= User= Group= SupplementaryGroups= Nice= OOMScoreAdjust=

    IOSchedulingClass= IOSchedulingPriority= CPUSchedulingPolicy= CPUSchedulingPriority= CPUSchedulingResetOnFork= CPUAffinity= UMask= Environment= EnvironmentFile= StandardInput= StandardOutput= StandardError= TTYPath= SyslogIdentifer= SyslogFacility= SyslogLevel= SyslogLevelPrefix= TimerSlackNSec= LimitCPU= LimitFSIZE= LimitDATA= LimitSTACK= LimitCORE= LimitRSS= LimitNOFILE= LimitAS= LimitNPROC= LimitMEMLOCK= LimitLOCKS= LimitSIGPENDING= LimitMSGQUEUE= LimitNICE= LimitRTPRIO= LimitRTTIME= PAMName= TCPWrapName= Capabilities= SecureBits= CapabilityBoundingSetDrop= ControlGroup= ReadWriteDirectories= ReadOnlyDirectories= InaccessibleDirectories= PrivateTmp= MountFlags=
  5. Usługi - kontrola WorkingDirectory= RootDirectory= User= Group= SupplementaryGroups= Nice= OOMScoreAdjust=

    IOSchedulingClass= IOSchedulingPriority= CPUSchedulingPolicy= CPUSchedulingPriority= CPUSchedulingResetOnFork= CPUAffinity= UMask= Environment= EnvironmentFile= StandardInput= StandardOutput= StandardError= TTYPath= SyslogIdentifer= SyslogFacility= SyslogLevel= SyslogLevelPrefix= TimerSlackNSec= LimitCPU= LimitFSIZE= LimitDATA= LimitSTACK= LimitCORE= LimitRSS= LimitNOFILE= LimitAS= LimitNPROC= LimitMEMLOCK= LimitLOCKS= LimitSIGPENDING= LimitMSGQUEUE= LimitNICE= LimitRTPRIO= LimitRTTIME= PAMName= TCPWrapName= Capabilities= SecureBits= CapabilityBoundingSetDrop= ControlGroup= ReadWriteDirectories= ReadOnlyDirectories= InaccessibleDirectories= PrivateTmp= MountFlags=
  6. Usługi - kontrola WorkingDirectory= RootDirectory= User= Group= SupplementaryGroups= Nice= OOMScoreAdjust=

    IOSchedulingClass= IOSchedulingPriority= CPUSchedulingPolicy= CPUSchedulingPriority= CPUSchedulingResetOnFork= CPUAffinity= UMask= Environment= EnvironmentFile= StandardInput= StandardOutput= StandardError= TTYPath= SyslogIdentifer= SyslogFacility= SyslogLevel= SyslogLevelPrefix= TimerSlackNSec= LimitCPU= LimitFSIZE= LimitDATA= LimitSTACK= LimitCORE= LimitRSS= LimitNOFILE= LimitAS= LimitNPROC= LimitMEMLOCK= LimitLOCKS= LimitSIGPENDING= LimitMSGQUEUE= LimitNICE= LimitRTPRIO= LimitRTTIME= PAMName= TCPWrapName= Capabilities= SecureBits= CapabilityBoundingSetDrop= ControlGroup= ReadWriteDirectories= ReadOnlyDirectories= InaccessibleDirectories= PrivateTmp= MountFlags=
  7. Usługi - sysvinit #!/bin/bash # # ladvd Startup script for

    the [cefn]dp/lldp sender # # chkconfig: - 85 15 # description: ladvd uses [cefn]dp / lldp frames to inform switches \ # about connected hosts, which simplifies ethernet \ # switch management. # processname: ladvd # pidfile: /var/run/ladvd.pid # ### BEGIN INIT INFO # Provides: ladvd # Required-Start: $local_fs $network # Required-Stop: $local_fs $network # Short-Description: start and stop cdp/lldp sender # Description: ladvd uses [cefn]dp / lldp frames to inform switches # about connected hosts, which simplifies ethernet # switch management. ### END INIT INFO # Source function library. . /etc/rc.d/init.d/functions [ -f /etc/sysconfig/network ] && . /etc/sysconfig/network [ "${NETWORKING}" = "yes" ] || exit 0 [ -r /etc/sysconfig/ladvd ] && . /etc/sysconfig/ladvd start() { [ -z "$ARGS" ] && exit 6 echo -n $"Starting ladvd: " [ ! -d "/var/run/ladvd" ] && mkdir /var/run/ladvd && chown ladvd.ladvd /var/run/ladvd daemon /usr/sbin/ladvd $ARGS $LADVDARGS RETVAL=$? echo [ $RETVAL = 0 ] && touch /var/lock/subsys/ladvd return $RETVAL } stop() { echo -n $"Shutting down ladvd: " killproc ladvd RETVAL=$? rm -f /var/lock/subsys/ladvd echo return $RETVAL } [ -f /usr/sbin/ladvd ] || exit 0 # See how we were called. case "$1" in start) start ;; stop) stop ;; force-reload|restart|reload) stop start ;; try-restart|condrestart) [ -e /var/lock/subsys/ladvd ] && (stop; start) ;; status) status ladvd RETVAL=$? ;; *) echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}" exit 3 esac exit $RETVAL
  8. Usługi - sysvinit #!/bin/bash # # ladvd Startup script for

    the [cefn]dp/lldp sender # # chkconfig: - 85 15 # description: ladvd uses [cefn]dp / lldp frames to inform switches \ # about connected hosts, which simplifies ethernet \ # switch management. # processname: ladvd # pidfile: /var/run/ladvd.pid # ### BEGIN INIT INFO # Provides: ladvd # Required-Start: $local_fs $network # Required-Stop: $local_fs $network # Short-Description: start and stop cdp/lldp sender # Description: ladvd uses [cefn]dp / lldp frames to inform switches # about connected hosts, which simplifies ethernet # switch management. ### END INIT INFO
  9. Usługi - sysvinit [ -r /etc/sysconfig/ladvd ] && . /etc/sysconfig/ladvd

    start() { [ -z "$ARGS" ] && exit 6 echo -n $"Starting ladvd: " [ ! -d "/var/run/ladvd" ] && mkdir /var/run/ladvd && chown ladvd.ladvd /var/run/ladvd daemon /usr/sbin/ladvd $ARGS $LADVDARGS RETVAL=$? echo [ $RETVAL = 0 ] && touch /var/lock/subsys/ladvd return $RETVAL } stop() { echo -n $"Shutting down ladvd: " killproc ladvd RETVAL=$? rm -f /var/lock/subsys/ladvd echo return $RETVAL } [ -f /usr/sbin/ladvd ] || exit 0
  10. Usługi - sysvinit # See how we were called. case

    "$1" in start) start ;; stop) stop ;; force-reload|restart|reload) stop start ;; try-restart|condrestart) [ -e /var/lock/subsys/ladvd ] && (stop; start) ;; status) status ladvd RETVAL=$? ;; *) echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}" exit 3 esac exit $RETVAL
  11. Usługi - systemd [Unit] Description=uses [cefn]dp / lldp frames to

    inform switches about connected hosts [Service] EnvironmentFile=/etc/sysconfig/ladvd ExecStart=/usr/sbin/ladvd -a -f $LADVD_OPTIONS PIDFile=/var/run/ladvd.pid StandardOutput=syslog
  12. Gniazda - kontrola BindIPv6Only= Backlog= BindToDevice= SocketMode= MaxConnections= KeepAlive= Priority=

    ReceiveBuffer= SendBuffer= IPTOS= IPTTL= Mark= PipeSize= FreeBind= TCPCongestion=
  13. Urządzenia – [email protected] [Unit] Description=%I shock protection daemon [Service] EnvironmentFile=/etc/sysconfig/hdapsd

    StandardOutput=syslog SyslogIdentifier=%p(%I) Nice=-5 ExecStart=/usr/sbin/hdapsd -d %I $HDAPSD_OPTIONS (DEMO)
  14. Podsumowując 2 zintegrowanie usług dystrybucyjnych (random seed, clock, API mounts)

    ujednolicenie skryptów startowych szybki start, zintegrowany readahead
  15. avahi-daemon.service [Unit] Description=Avahi mDNS/DNS-SD Stack Requires=avahi-daemon.socket After=syslog.target [Service] Type=dbus BusName=org.freedesktop.Avahi

    ExecStart=/usr/sbin/avahi-daemon -s ExecReload=/usr/sbin/avahi-daemon -r NotifyAccess=main [Install] WantedBy=multi-user.target Also=avahi-daemon.socket
  16. systemctl status # systemctl status avahi-daemon.service avahi-daemon.service - Avahi mDNS/DNS-SD

    Stack Loaded: loaded (/lib/systemd/system/avahi-daemon.service) Active: active (running) since [Sat, 18 Sep 2010 23:32:54 +0200; 16h ago] Main PID: 3300 (avahi-daemon) Status: "Server startup complete. Host name is dhartha.local. Local service cookie is 966442585." CGroup: name=systemd:/systemd-1/avahi-daemon.service ├ 3300 avahi-daemon: running [dhartha.local] └ 3305 avahi-daemon: chroot helper
  17. systemctl status # systemctl status avahi-daemon.service avahi-daemon.service - Avahi mDNS/DNS-SD

    Stack Loaded: loaded (/lib/systemd/system/avahi-daemon.service) Active: active (running) since [Sat, 18 Sep 2010 23:32:54 +0200; 16h ago] Main PID: 3300 (avahi-daemon) Status: "Server startup complete. Host name is dhartha.local. Local service cookie is 966442585." CGroup: name=systemd:/systemd-1/avahi-daemon.service ├ 3300 avahi-daemon: running [dhartha.local] ├ 3305 avahi-daemon: chroot helper
  18. status mount # systemctl status boot.mount boot.mount - /boot Loaded:

    loaded Active: active (mounted) since [Sat, 18 Sep 2010 23:32:54 +0200; 16h ago] Where: /boot CGroup: name=systemd:/systemd-1/boot.mount