SlideShare ist ein Scribd-Unternehmen logo
1 von 75
Downloaden Sie, um offline zu lesen
Getting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemd
Julien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien Pivotto
FLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring Conference
March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016
whoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoami
Julien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien Pivotto
• Sysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.eu
• FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004
• systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010
EEEEEEEEEEEEEEEEExherbo Linux
• DevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believer
• @roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie on irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/github
inuits.eu
systemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemd
• AAAAAAAAAAAAAAAAAn init system
• IIIIIIIIIIIIIIIIImprove the Linux init process
• SSSSSSSSSSSSSSSSStarting more in parallel
• MMMMMMMMMMMMMMMMMaking better decisions
• TTTTTTTTTTTTTTTTTakes advantages of Linux features
systemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoption
• 22222222222222222011: Fedora, Exherbo
• 22222222222222222012: Mageia, openSUSE, Arch Linux
• 22222222222222222013: CoreOS
• 22222222222222222014: RHEL, CentOS
• 22222222222222222015: Ubuntu, Debian
AlternativesAlternativesAlternativesAlternativesAlternativesAlternativesAlternativesAlternativesAlternativesAlternativesAlternativesAlternativesAlternativesAlternativesAlternativesAlternativesAlternatives
• SSSSSSSSSSSSSSSSSystem V: legacy
• UUUUUUUUUUUUUUUUUpstart: Ubuntu < 2015 and EL6
• OOOOOOOOOOOOOOOOOpenRC: mainly Gentoo
Talk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibility
• CCCCCCCCCCCCCCCCContent of this talk runs on CentOS 7.2
• sssssssssssssssssystemd 219
• SSSSSSSSSSSSSSSSShould work on any other distro
UnitsUnitsUnitsUnitsUnitsUnitsUnitsUnitsUnitsUnitsUnitsUnitsUnitsUnitsUnitsUnitsUnits
Licensed under a Creative Commons Attribution 2.0 License
https://www.flickr.com/photos/dbackmansfo/10939296845
systemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd units
• BBBBBBBBBBBBBBBBBase bricks of systemd systems
• OOOOOOOOOOOOOOOOOne unit = one resource
• mmmmmmmmmmmmmmmmmountpoint, service, device, timer, socket, …
• nnnnnnnnnnnnnnnnnetwork.target
• mmmmmmmmmmmmmmmmmariadb.service
• ssssssssssssssssshaarli.socket
• pppppppppppppppppuppet-run.timer
• hhhhhhhhhhhhhhhhhome.mount
• sssssssssssssssssession-1.scope
Unit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configuration
• IIIIIIIIIIIIIIIIIni-style text files
• LLLLLLLLLLLLLLLLList: systemctl list-units --all
• RRRRRRRRRRRRRRRRRead: systemctl cat
Unit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit example
[Unit]
Description=nscd
[Service]
Type=forking
PIDFile=/run/nscd/nscd.pid
ExecStart=/usr/host/bin/nscd
ExecStop=/usr/host/bin/nscd −−shutdown
[Install]
WantedBy=multi−user.target
Where?Where?Where?Where?Where?Where?Where?Where?Where?Where?Where?Where?Where?Where?Where?Where?Where?
• /////////////////etc/systemd/system/*
• /////////////////run/systemd/system/*
• /////////////////usr/lib/systemd/system/*
Here is the rule:
Packaged files go in /usr/lib.
Humans (or Config management
tools) override in /etc.
Overriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding units
Licensed under a Creative Commons Attribution 2.0 License
https://www.flickr.com/photos/alovesdc/3468924493
Overriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: why
• AAAAAAAAAAAAAAAAAdd/Remove/Change parameters
• AAAAAAAAAAAAAAAAAdapt them to your needs
• SSSSSSSSSSSSSSSSSet ulimits, user, …
• FFFFFFFFFFFFFFFFFix bugs
Changing services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemd
• RRRRRRRRRRRRRRRRReplace /etc/init.d scripts
• /////////////////etc/default, /etc/sysconfig
• SSSSSSSSSSSSSSSSSpaghetti code
Overriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemd
• OOOOOOOOOOOOOOOOOverride completely a unit
• JJJJJJJJJJJJJJJJJust add/change one parameter
• """""""""""""""""Patch" vendor units
Complete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete override
# /etc/systemd/system/openvpn.service
[Unit]
Description=OpenVPN
After=syslog.target
[Service]
ExecStart=/usr/host/bin/openvpn −−syslog −−writepid /run
/openvpn.pid −−cd /etc/openvpn −−config /etc/openvpn/
openvpn.conf
[Install]
WantedBy=multi−user.target
Advantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overrides
• IIIIIIIIIIIIIIIIIn /etc/systemd/system
• DDDDDDDDDDDDDDDDDo not conflict with packages
• OOOOOOOOOOOOOOOOOverride everything, even dependencies
• NNNNNNNNNNNNNNNNNot only for overrides: if you have
unpackaged units, put them there
Partial overridePartial overridePartial overridePartial overridePartial overridePartial overridePartial overridePartial overridePartial overridePartial overridePartial overridePartial overridePartial overridePartial overridePartial overridePartial overridePartial override
# /etc/systemd/system/mariadb.service.d/niceness.conf
[service]
Nice=5
Advantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overrides
• IIIIIIIIIIIIIIIIIn /etc/systemd/system/$Unit
name.d/*.conf
• DDDDDDDDDDDDDDDDDo not conflict with packages
• OOOOOOOOOOOOOOOOOverride only what is needed
• AAAAAAAAAAAAAAAAAdapt while still accept upstream work
• NNNNNNNNNNNNNNNNNo need to adapt at each upgrade
• WWWWWWWWWWWWWWWWWorks for everything (not only services)
The price of that flexibility:
systemctl daemon-reload
Verify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unit
systemctl cat mariadb.service
# /usr/x86_64−pc−linux−gnu/lib/systemd/system/mariadb.
service
[Unit]
Description=MySQL database server
After=syslog.target
After=network.target
[Service]
User=mysql
Group=mysql
ExecStart=/usr/sbin/mysqld −−defaults−file=/etc/mysql/my
.cnf −−basedir=/usr −−datadir=/var/lib/mysql
# /etc/systemd/system/mariadb.service.d/nice.conf
[service]
Nice=5
Instantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated units
• UUUUUUUUUUUUUUUUUnits cat take @ in the name
• ooooooooooooooooopenvpn@inuits.service
• OOOOOOOOOOOOOOOOOn-disk: openvpn@.service
• IIIIIIIIIIIIIIIIIn the file: %i will be "inuits"
• %%%%%%%%%%%%%%%%%p will be "openvpn"
Instantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit example
[Unit]
Description=OpenVPN daemon %i
After=syslog.target
[Service]
ExecStart=/usr/host/bin/openvpn −−writepid /run/openvpn
.%i.pid −−cd /etc/openvpn −−config /etc/openvpn/%i.
conf
PIDFile=/run/openvpn.%i.pid
Controlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling units
• sssssssssssssssssystemctl start mariadb.service
• sssssssssssssssssystemctl status /dev/sda
• sssssssssssssssssystemctl stop openvpn@*.service
• sssssssssssssssssystemctl kill openvpn
• sssssssssssssssssystemctl kill -s SIGKILL openvpn.service
• sssssssssssssssssystemctl is-active runlevel1.target
• sssssssssssssssssystemctl is-failed puppet-run.service
• sssssssssssssssssystemctl is-failed puppet-run.service
• sssssssssssssssssystemctl help mariadb.service
Enabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a service
• sssssssssssssssssystemctl disable mariadb.service
• WWWWWWWWWWWWWWWWWill disable the service
• PPPPPPPPPPPPPPPPPrevent it to start automatically
MaskingMaskingMaskingMaskingMaskingMaskingMaskingMaskingMaskingMaskingMaskingMaskingMaskingMaskingMaskingMaskingMasking
• sssssssssssssssssystemctl mask mariadb.service
• sssssssssssssssssystemctl mask --force mariadb.service
• llllllllllllllllln -s /dev/null
/etc/systemd/system/mariadb.service
• PPPPPPPPPPPPPPPPPrevents a unit to start
• BBBBBBBBBBBBBBBBBetter than "disabling"
• PPPPPPPPPPPPPPPPPrevent units to be launched by hand or
systemd
ServicesServicesServicesServicesServicesServicesServicesServicesServicesServicesServicesServicesServicesServicesServicesServicesServices
Licensed under a Creative Commons Attribution ShareAlike 2.0 License
https://www.flickr.com/photos/nojhan/754257252
ServiceServiceServiceServiceServiceServiceServiceServiceServiceServiceServiceServiceServiceServiceServiceServiceService
• AAAAAAAAAAAAAAAAAn important part of the units
• UUUUUUUUUUUUUUUUUses cgroups to track processes
• [[[[[[[[[[[[[[[[[Service] section inside units
What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?
• TTTTTTTTTTTTTTTTThe command(s) to run
• MMMMMMMMMMMMMMMMMost of them can fork or stay in foreground
• sssssssssssssssssystemd can manage both
Type=simpleType=simpleType=simpleType=simpleType=simpleType=simpleType=simpleType=simpleType=simpleType=simpleType=simpleType=simpleType=simpleType=simpleType=simpleType=simpleType=simple
• UUUUUUUUUUUUUUUUUsecase: the service stays in foreground
• sssssssssssssssssystemd will track the process
• IIIIIIIIIIIIIIIIIt will take care of running it "in the
background"
Type=forkingType=forkingType=forkingType=forkingType=forkingType=forkingType=forkingType=forkingType=forkingType=forkingType=forkingType=forkingType=forkingType=forkingType=forkingType=forkingType=forking
• UUUUUUUUUUUUUUUUUsecase: the service forks when ready
• sssssssssssssssssystemd will track process and its forks
Type=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshot
• UUUUUUUUUUUUUUUUUsecase: A command to run
• eeeeeeeeeeeeeeeee.g: puppet agent --test
• IIIIIIIIIIIIIIIIInteresting options: RemainAfterExit=,
SuccessExitStatus=
• RRRRRRRRRRRRRRRRReliable way to run commands
• CCCCCCCCCCCCCCCCCan have all the services properties
Other propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther properties
• EEEEEEEEEEEEEEEEExecStart= ExecStop=
• EEEEEEEEEEEEEEEEExecStartPre= ExecStartPost=
• EEEEEEEEEEEEEEEEExecReload=
• TTTTTTTTTTTTTTTTTimeoutStartSec= TimeoutSec=
• RRRRRRRRRRRRRRRRRuntimeMaxSec=
• RRRRRRRRRRRRRRRRRestart=on-failure
ExecsExecsExecsExecsExecsExecsExecsExecsExecsExecsExecsExecsExecsExecsExecsExecsExecs
Licensed under a Creative Commons Attribution 2.0 License
https://www.flickr.com/photos/daveynin/3657852579/
execsexecsexecsexecsexecsexecsexecsexecsexecsexecsexecsexecsexecsexecsexecsexecsexecs
• AAAAAAAAAAAAAAAAA set of properties to configure an exec
environment
• UUUUUUUUUUUUUUUUUsed in services, mounts, swap, socket
units
• DDDDDDDDDDDDDDDDDeterministic environment for processes
Classic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic properties
• UUUUUUUUUUUUUUUUUser= Group=
• NNNNNNNNNNNNNNNNNice=
• OOOOOOOOOOOOOOOOOOMScoreAdjust=
• LLLLLLLLLLLLLLLLLimitNOFILE=
• EEEEEEEEEEEEEEEEEnvironment= EnvironmentFile=
Isolation/SecurityIsolation/SecurityIsolation/SecurityIsolation/SecurityIsolation/SecurityIsolation/SecurityIsolation/SecurityIsolation/SecurityIsolation/SecurityIsolation/SecurityIsolation/SecurityIsolation/SecurityIsolation/SecurityIsolation/SecurityIsolation/SecurityIsolation/SecurityIsolation/Security
• PPPPPPPPPPPPPPPPPrivateTmp=
• PPPPPPPPPPPPPPPPPrivateNetwork= PrivateDevices=
• PPPPPPPPPPPPPPPPProtectSystem=
• PPPPPPPPPPPPPPPPProtectHome=
• RRRRRRRRRRRRRRRRReadWriteDirectories=
ReadOnlyDirectories=
• IIIIIIIIIIIIIIIIInaccessibleDirectories=
DependenciesDependenciesDependenciesDependenciesDependenciesDependenciesDependenciesDependenciesDependenciesDependenciesDependenciesDependenciesDependenciesDependenciesDependenciesDependenciesDependencies
• RRRRRRRRRRRRRRRRRequires=
• WWWWWWWWWWWWWWWWWants=
• AAAAAAAAAAAAAAAAAfter= Before=
• AAAAAAAAAAAAAAAAAny unit can depent on any unit
• AAAAAAAAAAAAAAAAA service can require a mountpoint
• AAAAAAAAAAAAAAAAA moutpoint can require a target
Problems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solved
• RRRRRRRRRRRRRRRRRun service as a different user
• JJJJJJJJJJJJJJJJJava Service Wrapper
• GGGGGGGGGGGGGGGGGo Service Wrapper
• YYYYYYYYYYYYYYYYYou can still use custom scripts
tmpfilestmpfilestmpfilestmpfilestmpfilestmpfilestmpfilestmpfilestmpfilestmpfilestmpfilestmpfilestmpfilestmpfilestmpfilestmpfilestmpfiles
Licensed under a Creative Commons Attribution 2.0 License
https://www.flickr.com/photos/english106/4357529719
temp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp files
• /////////////////etc/tmpfiles.d/*.conf
• /////////////////run/tmpfiles.d/*.conf
• /////////////////usr/lib/tmpfiles.d/*.conf
temp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp files
• sssssssssssssssssystemd will create, and cleanup temporary
files
• YYYYYYYYYYYYYYYYYou can assign files, directories to specific
users
• IIIIIIIIIIIIIIIIIt will decide when to delete them
• WWWWWWWWWWWWWWWWWhen you change the files, run
systemd-tmpfiles --create
MountpointsMountpointsMountpointsMountpointsMountpointsMountpointsMountpointsMountpointsMountpointsMountpointsMountpointsMountpointsMountpointsMountpointsMountpointsMountpointsMountpoints
Licensed under a Creative Commons Attribution ShareAlike 2.0 License
https://www.flickr.com/photos/manchesterlibrary/5425248883/
mountmountmountmountmountmountmountmountmountmountmountmountmountmountmountmountmount
• mmmmmmmmmmmmmmmmmounts are units
• sssssssssssssssssystemd parses /etc/fstab
• sssssssssssssssssystemd creates dependencies
systemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab options
• xxxxxxxxxxxxxxxxx-systemd.automount
• nnnnnnnnnnnnnnnnnofail
• aaaaaaaaaaaaaaaaauto noauto
/etc/fstab/etc/fstab/etc/fstab/etc/fstab/etc/fstab/etc/fstab/etc/fstab/etc/fstab/etc/fstab/etc/fstab/etc/fstab/etc/fstab/etc/fstab/etc/fstab/etc/fstab/etc/fstab/etc/fstab
//host1/share /net/share cifs noauto ,nofail ,x−systemd.
automount ,x−systemd.requires=network.target 0 0
journaldjournaldjournaldjournaldjournaldjournaldjournaldjournaldjournaldjournaldjournaldjournaldjournaldjournaldjournaldjournaldjournald
Licensed under a Creative Commons Attribution 2.0 License
https://www.flickr.com/photos/gregloby/3763720734
systemd-journaldsystemd-journaldsystemd-journaldsystemd-journaldsystemd-journaldsystemd-journaldsystemd-journaldsystemd-journaldsystemd-journaldsystemd-journaldsystemd-journaldsystemd-journaldsystemd-journaldsystemd-journaldsystemd-journaldsystemd-journaldsystemd-journald
• AAAAAAAAAAAAAAAAA daemon that captures and stores the logs
• sssssssssssssssssyslog
• kkkkkkkkkkkkkkkkkernel logs
• bbbbbbbbbbbbbbbbboot messages
• ssssssssssssssssstdout/stderr of services
systemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integration
• sssssssssssssssssystemctl status shows the latest logs
• sssssssssssssssssystemctl status -n 100
• sssssssssssssssssystemctl status -l
Enabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journald
• BBBBBBBBBBBBBBBBBy default (el7), hybrid mode (not
persistent)
• MMMMMMMMMMMMMMMMMake it persistent: mkdir -p /var/log/journal
Reading the logsReading the logsReading the logsReading the logsReading the logsReading the logsReading the logsReading the logsReading the logsReading the logsReading the logsReading the logsReading the logsReading the logsReading the logsReading the logsReading the logs
• fffffffffffffffffollow: journalctl -f
• lllllllllllllllllast lines: journalctl -n 100
• fffffffffffffffffrom a unit: journalctl -u puppet-run.service
• ooooooooooooooooonly this boot: journalctl -b
• ooooooooooooooooonly this process: journalctl
/opt/puppetlabs/puppet/bin/ruby
Logs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs example
− Logs begin at Mon 2016−03−14 18:30:28 CET, end at Tue
2016
Mar 14 18:30:28 fqdn systemd−journal[137]: Runtime journ
Mar 14 18:30:28 fqdn systemd−journal[137]: Runtime journ
Mar 14 18:30:28 fqdn kernel: Initializing cgroup subsys
Mar 14 18:30:28 fqdn kernel: Initializing cgroup subsys
Mar 14 18:30:28 fqdn kernel: Initializing cgroup subsys
Mar 14 18:30:28 fqdn kernel: Linux version 3.10.0−327.10
Mar 14 18:30:28 fqdn kernel: Command line: BOOT_IMAGE=/b
Mar 14 18:30:28 fqdn kernel: e820: BIOS−provided physica
Mar 14 18:30:28 fqdn kernel: BIOS−e820: [mem 0x000000000
Mar 14 18:30:28 fqdn kernel: BIOS−e820: [mem 0x000000000
Mar 14 18:30:28 fqdn kernel: BIOS−e820: [mem 0x000000000
Mar 14 18:30:28 fqdn kernel: BIOS−e820: [mem 0x000000000
Mar 14 18:30:28 fqdn kernel: BIOS−e820: [mem 0x00000000b
Mar 14 18:30:28 fqdn kernel: BIOS−e820: [mem 0x00000000f
Mar 14 18:30:28 fqdn kernel: BIOS−e820: [mem 0x00000000f
Mar 14 18:30:28 fqdn kernel: BIOS−e820: [mem 0x000000010
timerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimers
Licensed under a Creative Commons Attribution 2.0 License
https://www.flickr.com/photos/modomatic/2538687135
Traditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cron
AMQP_BROKER_HOST =10.1.40.19
MAILTO="sysadmin@example.com"
ORACLE_HOME="/opt/example/part/python−oracle"
PG_HOSTNAME ="10.1.30.10"
PG_NAME="example"
WS_URL=https://prod.example.com/ws/input
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/example/lib"
CUPS_HOSTNAME ="10.1.40.1"
LOGGING_HOST ="10.0.50.16"
LOGGING_PORT="5544"
0 * * * * /opt/example/bin/cron−hourly
30 times.
What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?
• NNNNNNNNNNNNNNNNNo one reads those mails
• DDDDDDDDDDDDDDDDDo not keep track of exit code
• HHHHHHHHHHHHHHHHHard to read that crontab
• HHHHHHHHHHHHHHHHHow to reproduce the script?
timerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimers
• UUUUUUUUUUUUUUUUUnits that are used to launch a service unit
• SSSSSSSSSSSSSSSSSupports some cron features and anacron
• AAAAAAAAAAAAAAAAAllows you to launch commands in a
controlled environment
timers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs cron
• NNNNNNNNNNNNNNNNNo built-in emails function
• CCCCCCCCCCCCCCCCCron is more simple (one line to one file vs 2
units)
• TTTTTTTTTTTTTTTTTimers uses services, so predictible env
• YYYYYYYYYYYYYYYYYou can run independently the service unit
• TTTTTTTTTTTTTTTTTimers logs are in systemd
Timers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers example
# /etc/systemd/system/puppet−run.timer
[Unit]
Description=Systemd Timer for Puppet Agent
[Timer]
OnCalendar=*−*−* *:0,30:00
Persistent=true
[Install]
WantedBy=timers.target
What, when?What, when?What, when?What, when?What, when?What, when?What, when?What, when?What, when?What, when?What, when?What, when?What, when?What, when?What, when?What, when?What, when?
• sssssssssssssssssystemctl list-timers
• LLLLLLLLLLLLLLLLLast run time
• NNNNNNNNNNNNNNNNNext run time
• SSSSSSSSSSSSSSSSService unit
Socket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activation
Licensed under a Creative Commons Attribution 2.0 License
https://www.flickr.com/photos/alikai/1376760481
Socket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activation
• GGGGGGGGGGGGGGGGGoal: start a service when needed
• sssssssssssssssssystemd will open a socket
• SSSSSSSSSSSSSSSSStart the service at first connection
• pppppppppppppppppass the socket to the service
socket unitsocket unitsocket unitsocket unitsocket unitsocket unitsocket unitsocket unitsocket unitsocket unitsocket unitsocket unitsocket unitsocket unitsocket unitsocket unitsocket unit
# /etc/systemd/system/proxy−to−shaarli.socket
[Unit]
Description=Shaarli Proxy
[Socket]
ListenStream =127.0.0.1:43000
[Install]
WantedBy=default.target
systemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unit
[Unit]
Requires=shaarli.service
After=shaarli.service
JoinsNamespaceOf=shaarli.service
[Service]
ExecStart=/usr/lib/systemd/systemd−socket−proxyd
127.0.0.1:43001
Actual service unitActual service unitActual service unitActual service unitActual service unitActual service unitActual service unitActual service unitActual service unitActual service unitActual service unitActual service unitActual service unitActual service unitActual service unitActual service unitActual service unit
[Unit]
Description=Shaarli
[Service]
WorkingDirectory=/opt/Shaarli/dev
ExecStart=/usr/bin/php −S 127.0.0.1:43001
ExecStartPost=/bin/sleep 0.1
User=shaarli
Group=shaarli
[Install]
WantedBy=default.target
Side commandsSide commandsSide commandsSide commandsSide commandsSide commandsSide commandsSide commandsSide commandsSide commandsSide commandsSide commandsSide commandsSide commandsSide commandsSide commandsSide commands
Licensed under a Creative Commons Attribution ShareAlike 2.0 License
https://www.flickr.com/photos/archer10/3029638204/
systemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commands
• sssssssssssssssssystemd-cgls: Show the cgroups hierarchy
• sssssssssssssssssystemd-analyze blame: Shows the startup
time
• sssssssssssssssssystemd-nspawn: Containers
• sssssssssssssssssystemd-run: run a command like if it was a
service unit
systemd-runsystemd-runsystemd-runsystemd-runsystemd-runsystemd-runsystemd-runsystemd-runsystemd-runsystemd-runsystemd-runsystemd-runsystemd-runsystemd-runsystemd-runsystemd-runsystemd-run
systemd−run −t −p PrivateTmp=true −p PrivateNetwork=yes
−p ProtectHome=true bash
system settingssystem settingssystem settingssystem settingssystem settingssystem settingssystem settingssystem settingssystem settingssystem settingssystem settingssystem settingssystem settingssystem settingssystem settingssystem settingssystem settings
• tttttttttttttttttimedatectl: manage/show current
datetime, timezome, DST change
• lllllllllllllllllocatectl: locale/keyboard changes
• mmmmmmmmmmmmmmmmmachinectl: containers/vms management
• hhhhhhhhhhhhhhhhhostnamectl: change/view system
hostname and os info
ConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusion
Licensed under a Creative Commons Attribution 2.0 License
https://www.flickr.com/photos/drainrat/14090130452
systemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemd
• AAAAAAAAAAAAAAAAAvailable in all modern distros
• BBBBBBBBBBBBBBBBBy default in almost all of them
• MMMMMMMMMMMMMMMMMakes a lot for standardization
• RRRRRRRRRRRRRRRRRemoves "Distro" lock-in, Adds "Linux"
lock-in
• IIIIIIIIIIIIIIIIIt did more for standardization than LFS
systemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemd
• PPPPPPPPPPPPPPPPPowerful tools, easily configured
• RRRRRRRRRRRRRRRRReadable configuration
• TTTTTTTTTTTTTTTTTakes advantage of Linux-specific
mechanisms
• RRRRRRRRRRRRRRRRRemoves the need for a lot of workarounds
ContactContactContactContactContactContactContactContactContactContactContactContactContactContactContactContactContact
Julien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien Pivotto
julien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eu
@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie
inuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuits
https://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.eu
info@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.eu
+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636

Weitere ähnliche Inhalte

Was ist angesagt?

Managing a R&D Lab with Foreman
Managing a R&D Lab with ForemanManaging a R&D Lab with Foreman
Managing a R&D Lab with ForemanJulien Pivotto
 
CentOS Config Management SIG
CentOS Config Management SIGCentOS Config Management SIG
CentOS Config Management SIGJulien Pivotto
 
Monitoring at Cloud Scale
Monitoring at Cloud ScaleMonitoring at Cloud Scale
Monitoring at Cloud ScaleJulien Pivotto
 
Postgresql 9.0 HA at RMLL 2012
Postgresql 9.0 HA at RMLL 2012Postgresql 9.0 HA at RMLL 2012
Postgresql 9.0 HA at RMLL 2012Julien Pivotto
 
Testing your puppet code
Testing your puppet codeTesting your puppet code
Testing your puppet codeJulien Pivotto
 
Deployment and Continous Integration of a Zope/Plone application
Deployment and Continous Integration of a Zope/Plone applicationDeployment and Continous Integration of a Zope/Plone application
Deployment and Continous Integration of a Zope/Plone applicationJulien Pivotto
 
BSides Hannover 2015 - Shell on Wheels
BSides Hannover 2015 - Shell on WheelsBSides Hannover 2015 - Shell on Wheels
BSides Hannover 2015 - Shell on Wheelsinfodox
 
Augeas, swiss knife resources for your puppet tree
Augeas, swiss knife resources for your puppet treeAugeas, swiss knife resources for your puppet tree
Augeas, swiss knife resources for your puppet treeJulien Pivotto
 
Steelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trashSteelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trashinfodox
 
OSDC 2016 - Automating a R&D lab with Foreman: What can be hard? by Julien Pi...
OSDC 2016 - Automating a R&D lab with Foreman: What can be hard? by Julien Pi...OSDC 2016 - Automating a R&D lab with Foreman: What can be hard? by Julien Pi...
OSDC 2016 - Automating a R&D lab with Foreman: What can be hard? by Julien Pi...NETWAYS
 
Working with multiple git repositories
Working with multiple git repositoriesWorking with multiple git repositories
Working with multiple git repositoriesJulien Pivotto
 
11 Tools for your Open Source devops stack
11 Tools for your Open Source devops stack 11 Tools for your Open Source devops stack
11 Tools for your Open Source devops stack Kris Buytaert
 
Destruction, Decapods and Doughnuts: Continuous Delivery for Audio & Video Fa...
Destruction, Decapods and Doughnuts: Continuous Delivery for Audio & Video Fa...Destruction, Decapods and Doughnuts: Continuous Delivery for Audio & Video Fa...
Destruction, Decapods and Doughnuts: Continuous Delivery for Audio & Video Fa...Rachel Evans
 
BSides Edinburgh 2017 - TR-06FAIL and other CPE Configuration Disasters
BSides Edinburgh 2017 - TR-06FAIL and other CPE Configuration DisastersBSides Edinburgh 2017 - TR-06FAIL and other CPE Configuration Disasters
BSides Edinburgh 2017 - TR-06FAIL and other CPE Configuration Disastersinfodox
 
Using Eclipse to Build a Linux Distribution
Using Eclipse to Build a Linux DistributionUsing Eclipse to Build a Linux Distribution
Using Eclipse to Build a Linux Distributionjerboaa
 

Was ist angesagt? (20)

DNSSec
DNSSecDNSSec
DNSSec
 
Managing a R&D Lab with Foreman
Managing a R&D Lab with ForemanManaging a R&D Lab with Foreman
Managing a R&D Lab with Foreman
 
CentOS Config Management SIG
CentOS Config Management SIGCentOS Config Management SIG
CentOS Config Management SIG
 
Monitoring at Cloud Scale
Monitoring at Cloud ScaleMonitoring at Cloud Scale
Monitoring at Cloud Scale
 
Coworking with git
Coworking with gitCoworking with git
Coworking with git
 
Postgresql 9.0 HA at RMLL 2012
Postgresql 9.0 HA at RMLL 2012Postgresql 9.0 HA at RMLL 2012
Postgresql 9.0 HA at RMLL 2012
 
Testing your puppet code
Testing your puppet codeTesting your puppet code
Testing your puppet code
 
Linux HA anno 2014
Linux HA anno 2014Linux HA anno 2014
Linux HA anno 2014
 
Deployment and Continous Integration of a Zope/Plone application
Deployment and Continous Integration of a Zope/Plone applicationDeployment and Continous Integration of a Zope/Plone application
Deployment and Continous Integration of a Zope/Plone application
 
Logstash and friends
Logstash and friendsLogstash and friends
Logstash and friends
 
BSides Hannover 2015 - Shell on Wheels
BSides Hannover 2015 - Shell on WheelsBSides Hannover 2015 - Shell on Wheels
BSides Hannover 2015 - Shell on Wheels
 
Augeas, swiss knife resources for your puppet tree
Augeas, swiss knife resources for your puppet treeAugeas, swiss knife resources for your puppet tree
Augeas, swiss knife resources for your puppet tree
 
Test Continuous
Test ContinuousTest Continuous
Test Continuous
 
Steelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trashSteelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trash
 
OSDC 2016 - Automating a R&D lab with Foreman: What can be hard? by Julien Pi...
OSDC 2016 - Automating a R&D lab with Foreman: What can be hard? by Julien Pi...OSDC 2016 - Automating a R&D lab with Foreman: What can be hard? by Julien Pi...
OSDC 2016 - Automating a R&D lab with Foreman: What can be hard? by Julien Pi...
 
Working with multiple git repositories
Working with multiple git repositoriesWorking with multiple git repositories
Working with multiple git repositories
 
11 Tools for your Open Source devops stack
11 Tools for your Open Source devops stack 11 Tools for your Open Source devops stack
11 Tools for your Open Source devops stack
 
Destruction, Decapods and Doughnuts: Continuous Delivery for Audio & Video Fa...
Destruction, Decapods and Doughnuts: Continuous Delivery for Audio & Video Fa...Destruction, Decapods and Doughnuts: Continuous Delivery for Audio & Video Fa...
Destruction, Decapods and Doughnuts: Continuous Delivery for Audio & Video Fa...
 
BSides Edinburgh 2017 - TR-06FAIL and other CPE Configuration Disasters
BSides Edinburgh 2017 - TR-06FAIL and other CPE Configuration DisastersBSides Edinburgh 2017 - TR-06FAIL and other CPE Configuration Disasters
BSides Edinburgh 2017 - TR-06FAIL and other CPE Configuration Disasters
 
Using Eclipse to Build a Linux Distribution
Using Eclipse to Build a Linux DistributionUsing Eclipse to Build a Linux Distribution
Using Eclipse to Build a Linux Distribution
 

Andere mochten auch

Configuration Surgery with Augeas
Configuration Surgery with AugeasConfiguration Surgery with Augeas
Configuration Surgery with AugeasPuppet
 
Systemd evolution revolution_regression
Systemd evolution revolution_regressionSystemd evolution revolution_regression
Systemd evolution revolution_regressionSusant Sahani
 
Systemd mlug-20140614
Systemd mlug-20140614Systemd mlug-20140614
Systemd mlug-20140614Susant Sahani
 
CLUG 2010 09 - systemd - the new init system
CLUG 2010 09 - systemd - the new init systemCLUG 2010 09 - systemd - the new init system
CLUG 2010 09 - systemd - the new init systemPaulWay
 
Systemd for developers
Systemd for developersSystemd for developers
Systemd for developersAlison Chaiken
 
systemd and configuration management
systemd and configuration managementsystemd and configuration management
systemd and configuration managementJulien Pivotto
 
Introduction to systemd
Introduction to systemdIntroduction to systemd
Introduction to systemdYusaku OGAWA
 
Your first dive into systemd!
Your first dive into systemd!Your first dive into systemd!
Your first dive into systemd!Etsuji Nakai
 
Epoll - from the kernel side
Epoll -  from the kernel sideEpoll -  from the kernel side
Epoll - from the kernel sidellj098
 
linux software architecture
linux software architecture linux software architecture
linux software architecture Sneha Ramesh
 
Full system roll-back and systemd in SUSE Linux Enterprise 12
Full system roll-back and systemd in SUSE Linux Enterprise 12Full system roll-back and systemd in SUSE Linux Enterprise 12
Full system roll-back and systemd in SUSE Linux Enterprise 12Gábor Nyers
 
Linux architecture
Linux architectureLinux architecture
Linux architecturemcganesh
 
Red hat enterprise linux 7 (rhel 7)
Red hat enterprise linux 7 (rhel 7)Red hat enterprise linux 7 (rhel 7)
Red hat enterprise linux 7 (rhel 7)Ramola Dhande
 
RedHat Linux
RedHat LinuxRedHat Linux
RedHat LinuxApo
 
[오픈소스컨설팅]systemd on RHEL7
[오픈소스컨설팅]systemd on RHEL7[오픈소스컨설팅]systemd on RHEL7
[오픈소스컨설팅]systemd on RHEL7Ji-Woong Choi
 
Red Hat Enterprise Linux 7
Red Hat Enterprise Linux 7Red Hat Enterprise Linux 7
Red Hat Enterprise Linux 7Mazenetsolution
 
Introduction to Red Hat
Introduction to Red HatIntroduction to Red Hat
Introduction to Red HatAlbert Wong
 

Andere mochten auch (20)

Configuration Surgery with Augeas
Configuration Surgery with AugeasConfiguration Surgery with Augeas
Configuration Surgery with Augeas
 
Systemd evolution revolution_regression
Systemd evolution revolution_regressionSystemd evolution revolution_regression
Systemd evolution revolution_regression
 
Systemd mlug-20140614
Systemd mlug-20140614Systemd mlug-20140614
Systemd mlug-20140614
 
CLUG 2010 09 - systemd - the new init system
CLUG 2010 09 - systemd - the new init systemCLUG 2010 09 - systemd - the new init system
CLUG 2010 09 - systemd - the new init system
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
Systemd for developers
Systemd for developersSystemd for developers
Systemd for developers
 
systemd and configuration management
systemd and configuration managementsystemd and configuration management
systemd and configuration management
 
Pdf c1t tlawaxb
Pdf c1t tlawaxbPdf c1t tlawaxb
Pdf c1t tlawaxb
 
SystemV vs systemd
SystemV vs systemdSystemV vs systemd
SystemV vs systemd
 
Introduction to systemd
Introduction to systemdIntroduction to systemd
Introduction to systemd
 
Your first dive into systemd!
Your first dive into systemd!Your first dive into systemd!
Your first dive into systemd!
 
Epoll - from the kernel side
Epoll -  from the kernel sideEpoll -  from the kernel side
Epoll - from the kernel side
 
linux software architecture
linux software architecture linux software architecture
linux software architecture
 
Full system roll-back and systemd in SUSE Linux Enterprise 12
Full system roll-back and systemd in SUSE Linux Enterprise 12Full system roll-back and systemd in SUSE Linux Enterprise 12
Full system roll-back and systemd in SUSE Linux Enterprise 12
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
 
Red hat enterprise linux 7 (rhel 7)
Red hat enterprise linux 7 (rhel 7)Red hat enterprise linux 7 (rhel 7)
Red hat enterprise linux 7 (rhel 7)
 
RedHat Linux
RedHat LinuxRedHat Linux
RedHat Linux
 
[오픈소스컨설팅]systemd on RHEL7
[오픈소스컨설팅]systemd on RHEL7[오픈소스컨설팅]systemd on RHEL7
[오픈소스컨설팅]systemd on RHEL7
 
Red Hat Enterprise Linux 7
Red Hat Enterprise Linux 7Red Hat Enterprise Linux 7
Red Hat Enterprise Linux 7
 
Introduction to Red Hat
Introduction to Red HatIntroduction to Red Hat
Introduction to Red Hat
 

Ähnlich wie Getting the maximum out of systemd

Diving Into Puppet Providers Development: The Puppet-Corosync Module
Diving Into Puppet Providers Development: The Puppet-Corosync ModuleDiving Into Puppet Providers Development: The Puppet-Corosync Module
Diving Into Puppet Providers Development: The Puppet-Corosync ModuleJulien Pivotto
 
Introduction to Gitlab
Introduction to GitlabIntroduction to Gitlab
Introduction to GitlabJulien Pivotto
 
Repositories as Code
Repositories as CodeRepositories as Code
Repositories as CodeKris Buytaert
 
apidays Australia 2023 - Building On-Premise Hybrid API Platforms, David Free...
apidays Australia 2023 - Building On-Premise Hybrid API Platforms, David Free...apidays Australia 2023 - Building On-Premise Hybrid API Platforms, David Free...
apidays Australia 2023 - Building On-Premise Hybrid API Platforms, David Free...apidays
 
Coldfusion comparison
Coldfusion comparisonColdfusion comparison
Coldfusion comparisonisotools_2012
 
Automating MySQL operations with Puppet
Automating MySQL operations with PuppetAutomating MySQL operations with Puppet
Automating MySQL operations with PuppetKris Buytaert
 
On the Importance of Infrastructure as Code
On the Importance of Infrastructure as CodeOn the Importance of Infrastructure as Code
On the Importance of Infrastructure as CodeKris Buytaert
 
Icinga Camp Amsterdam - Infrastructure as Code
Icinga Camp Amsterdam - Infrastructure as CodeIcinga Camp Amsterdam - Infrastructure as Code
Icinga Camp Amsterdam - Infrastructure as CodeIcinga
 
Continous Delivery of your Infrastructure
Continous Delivery of your InfrastructureContinous Delivery of your Infrastructure
Continous Delivery of your InfrastructureKris Buytaert
 
Sail In The Cloud
Sail In The CloudSail In The Cloud
Sail In The CloudAlex Soto
 
Using Liferay Portal with LDAP and Single sign-on
Using Liferay Portal with LDAP and Single sign-onUsing Liferay Portal with LDAP and Single sign-on
Using Liferay Portal with LDAP and Single sign-onFirelay
 
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 -  Rock Solid Deployment of Symfony AppsSymfony Live NYC 2014 -  Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony AppsPablo Godel
 
Intro to WordPress Plugins
Intro to WordPress PluginsIntro to WordPress Plugins
Intro to WordPress Pluginszamoose
 
Escape the defaults - Configure Sling like AEM as a Cloud Service
Escape the defaults - Configure Sling like AEM as a Cloud ServiceEscape the defaults - Configure Sling like AEM as a Cloud Service
Escape the defaults - Configure Sling like AEM as a Cloud ServiceRobert Munteanu
 
Introducing Oracle Linux and Securing It With ksplice
Introducing Oracle Linux and Securing It With kspliceIntroducing Oracle Linux and Securing It With ksplice
Introducing Oracle Linux and Securing It With kspliceLF Events
 
Onsi Fakhouri at SpringOne Platform 2017
Onsi Fakhouri at SpringOne Platform 2017Onsi Fakhouri at SpringOne Platform 2017
Onsi Fakhouri at SpringOne Platform 2017VMware Tanzu
 

Ähnlich wie Getting the maximum out of systemd (20)

Diving Into Puppet Providers Development: The Puppet-Corosync Module
Diving Into Puppet Providers Development: The Puppet-Corosync ModuleDiving Into Puppet Providers Development: The Puppet-Corosync Module
Diving Into Puppet Providers Development: The Puppet-Corosync Module
 
Pinto+Stratopan+Love
Pinto+Stratopan+LovePinto+Stratopan+Love
Pinto+Stratopan+Love
 
Introduction to Gitlab
Introduction to GitlabIntroduction to Gitlab
Introduction to Gitlab
 
Dive into Puppet 4
Dive into Puppet 4Dive into Puppet 4
Dive into Puppet 4
 
Repositories as Code
Repositories as CodeRepositories as Code
Repositories as Code
 
apidays Australia 2023 - Building On-Premise Hybrid API Platforms, David Free...
apidays Australia 2023 - Building On-Premise Hybrid API Platforms, David Free...apidays Australia 2023 - Building On-Premise Hybrid API Platforms, David Free...
apidays Australia 2023 - Building On-Premise Hybrid API Platforms, David Free...
 
Coldfusion comparison
Coldfusion comparisonColdfusion comparison
Coldfusion comparison
 
Automating MySQL operations with Puppet
Automating MySQL operations with PuppetAutomating MySQL operations with Puppet
Automating MySQL operations with Puppet
 
On the Importance of Infrastructure as Code
On the Importance of Infrastructure as CodeOn the Importance of Infrastructure as Code
On the Importance of Infrastructure as Code
 
Icinga Camp Amsterdam - Infrastructure as Code
Icinga Camp Amsterdam - Infrastructure as CodeIcinga Camp Amsterdam - Infrastructure as Code
Icinga Camp Amsterdam - Infrastructure as Code
 
Pipe Laying Barge
Pipe Laying BargePipe Laying Barge
Pipe Laying Barge
 
Pipe laying barge
Pipe laying bargePipe laying barge
Pipe laying barge
 
Continous Delivery of your Infrastructure
Continous Delivery of your InfrastructureContinous Delivery of your Infrastructure
Continous Delivery of your Infrastructure
 
Sail In The Cloud
Sail In The CloudSail In The Cloud
Sail In The Cloud
 
Using Liferay Portal with LDAP and Single sign-on
Using Liferay Portal with LDAP and Single sign-onUsing Liferay Portal with LDAP and Single sign-on
Using Liferay Portal with LDAP and Single sign-on
 
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 -  Rock Solid Deployment of Symfony AppsSymfony Live NYC 2014 -  Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
 
Intro to WordPress Plugins
Intro to WordPress PluginsIntro to WordPress Plugins
Intro to WordPress Plugins
 
Escape the defaults - Configure Sling like AEM as a Cloud Service
Escape the defaults - Configure Sling like AEM as a Cloud ServiceEscape the defaults - Configure Sling like AEM as a Cloud Service
Escape the defaults - Configure Sling like AEM as a Cloud Service
 
Introducing Oracle Linux and Securing It With ksplice
Introducing Oracle Linux and Securing It With kspliceIntroducing Oracle Linux and Securing It With ksplice
Introducing Oracle Linux and Securing It With ksplice
 
Onsi Fakhouri at SpringOne Platform 2017
Onsi Fakhouri at SpringOne Platform 2017Onsi Fakhouri at SpringOne Platform 2017
Onsi Fakhouri at SpringOne Platform 2017
 

Mehr von Julien Pivotto

What's New in Prometheus and Its Ecosystem
What's New in Prometheus and Its EcosystemWhat's New in Prometheus and Its Ecosystem
What's New in Prometheus and Its EcosystemJulien Pivotto
 
Prometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is comingPrometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is comingJulien Pivotto
 
What's new in Prometheus?
What's new in Prometheus?What's new in Prometheus?
What's new in Prometheus?Julien Pivotto
 
Introduction to Grafana Loki
Introduction to Grafana LokiIntroduction to Grafana Loki
Introduction to Grafana LokiJulien Pivotto
 
Why you should revisit mgmt
Why you should revisit mgmtWhy you should revisit mgmt
Why you should revisit mgmtJulien Pivotto
 
Observing the HashiCorp Ecosystem From Prometheus
Observing the HashiCorp Ecosystem From PrometheusObserving the HashiCorp Ecosystem From Prometheus
Observing the HashiCorp Ecosystem From PrometheusJulien Pivotto
 
Monitoring in a fast-changing world with Prometheus
Monitoring in a fast-changing world with PrometheusMonitoring in a fast-changing world with Prometheus
Monitoring in a fast-changing world with PrometheusJulien Pivotto
 
5 tips for Prometheus Service Discovery
5 tips for Prometheus Service Discovery5 tips for Prometheus Service Discovery
5 tips for Prometheus Service DiscoveryJulien Pivotto
 
Prometheus and TLS - an Introduction
Prometheus and TLS - an IntroductionPrometheus and TLS - an Introduction
Prometheus and TLS - an IntroductionJulien Pivotto
 
Powerful graphs in Grafana
Powerful graphs in GrafanaPowerful graphs in Grafana
Powerful graphs in GrafanaJulien Pivotto
 
HAProxy as Egress Controller
HAProxy as Egress ControllerHAProxy as Egress Controller
HAProxy as Egress ControllerJulien Pivotto
 
Improved alerting with Prometheus and Alertmanager
Improved alerting with Prometheus and AlertmanagerImproved alerting with Prometheus and Alertmanager
Improved alerting with Prometheus and AlertmanagerJulien Pivotto
 
SIngle Sign On with Keycloak
SIngle Sign On with KeycloakSIngle Sign On with Keycloak
SIngle Sign On with KeycloakJulien Pivotto
 
Monitoring as an entry point for collaboration
Monitoring as an entry point for collaborationMonitoring as an entry point for collaboration
Monitoring as an entry point for collaborationJulien Pivotto
 
Incident Resolution as Code
Incident Resolution as CodeIncident Resolution as Code
Incident Resolution as CodeJulien Pivotto
 
Monitor your CentOS stack with Prometheus
Monitor your CentOS stack with PrometheusMonitor your CentOS stack with Prometheus
Monitor your CentOS stack with PrometheusJulien Pivotto
 
Monitor your CentOS stack with Prometheus
Monitor your CentOS stack with PrometheusMonitor your CentOS stack with Prometheus
Monitor your CentOS stack with PrometheusJulien Pivotto
 
An introduction to Ansible
An introduction to AnsibleAn introduction to Ansible
An introduction to AnsibleJulien Pivotto
 

Mehr von Julien Pivotto (20)

The O11y Toolkit
The O11y ToolkitThe O11y Toolkit
The O11y Toolkit
 
What's New in Prometheus and Its Ecosystem
What's New in Prometheus and Its EcosystemWhat's New in Prometheus and Its Ecosystem
What's New in Prometheus and Its Ecosystem
 
Prometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is comingPrometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is coming
 
What's new in Prometheus?
What's new in Prometheus?What's new in Prometheus?
What's new in Prometheus?
 
Introduction to Grafana Loki
Introduction to Grafana LokiIntroduction to Grafana Loki
Introduction to Grafana Loki
 
Why you should revisit mgmt
Why you should revisit mgmtWhy you should revisit mgmt
Why you should revisit mgmt
 
Observing the HashiCorp Ecosystem From Prometheus
Observing the HashiCorp Ecosystem From PrometheusObserving the HashiCorp Ecosystem From Prometheus
Observing the HashiCorp Ecosystem From Prometheus
 
Monitoring in a fast-changing world with Prometheus
Monitoring in a fast-changing world with PrometheusMonitoring in a fast-changing world with Prometheus
Monitoring in a fast-changing world with Prometheus
 
5 tips for Prometheus Service Discovery
5 tips for Prometheus Service Discovery5 tips for Prometheus Service Discovery
5 tips for Prometheus Service Discovery
 
Prometheus and TLS - an Introduction
Prometheus and TLS - an IntroductionPrometheus and TLS - an Introduction
Prometheus and TLS - an Introduction
 
Powerful graphs in Grafana
Powerful graphs in GrafanaPowerful graphs in Grafana
Powerful graphs in Grafana
 
YAML Magic
YAML MagicYAML Magic
YAML Magic
 
HAProxy as Egress Controller
HAProxy as Egress ControllerHAProxy as Egress Controller
HAProxy as Egress Controller
 
Improved alerting with Prometheus and Alertmanager
Improved alerting with Prometheus and AlertmanagerImproved alerting with Prometheus and Alertmanager
Improved alerting with Prometheus and Alertmanager
 
SIngle Sign On with Keycloak
SIngle Sign On with KeycloakSIngle Sign On with Keycloak
SIngle Sign On with Keycloak
 
Monitoring as an entry point for collaboration
Monitoring as an entry point for collaborationMonitoring as an entry point for collaboration
Monitoring as an entry point for collaboration
 
Incident Resolution as Code
Incident Resolution as CodeIncident Resolution as Code
Incident Resolution as Code
 
Monitor your CentOS stack with Prometheus
Monitor your CentOS stack with PrometheusMonitor your CentOS stack with Prometheus
Monitor your CentOS stack with Prometheus
 
Monitor your CentOS stack with Prometheus
Monitor your CentOS stack with PrometheusMonitor your CentOS stack with Prometheus
Monitor your CentOS stack with Prometheus
 
An introduction to Ansible
An introduction to AnsibleAn introduction to Ansible
An introduction to Ansible
 

Kürzlich hochgeladen

Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

Getting the maximum out of systemd

  • 1. Getting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemdGetting the maximum out of systemd Julien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien Pivotto FLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring ConferenceFLOSS UK Spring Conference March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016March 16, 2016
  • 2. whoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoami Julien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien Pivotto • Sysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.euSysadmin at inuits.eu • FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004FLOSS user since 2004 • systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010systemd user since 2010 EEEEEEEEEEEEEEEEExherbo Linux • DevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believer • @roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie on irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/github
  • 4. systemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemd • AAAAAAAAAAAAAAAAAn init system • IIIIIIIIIIIIIIIIImprove the Linux init process • SSSSSSSSSSSSSSSSStarting more in parallel • MMMMMMMMMMMMMMMMMaking better decisions • TTTTTTTTTTTTTTTTTakes advantages of Linux features
  • 5. systemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoptionsystemd adoption • 22222222222222222011: Fedora, Exherbo • 22222222222222222012: Mageia, openSUSE, Arch Linux • 22222222222222222013: CoreOS • 22222222222222222014: RHEL, CentOS • 22222222222222222015: Ubuntu, Debian
  • 7. Talk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibilityTalk compatibility • CCCCCCCCCCCCCCCCContent of this talk runs on CentOS 7.2 • sssssssssssssssssystemd 219 • SSSSSSSSSSSSSSSSShould work on any other distro
  • 8. UnitsUnitsUnitsUnitsUnitsUnitsUnitsUnitsUnitsUnitsUnitsUnitsUnitsUnitsUnitsUnitsUnits Licensed under a Creative Commons Attribution 2.0 License https://www.flickr.com/photos/dbackmansfo/10939296845
  • 9. systemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd unitssystemd units • BBBBBBBBBBBBBBBBBase bricks of systemd systems • OOOOOOOOOOOOOOOOOne unit = one resource • mmmmmmmmmmmmmmmmmountpoint, service, device, timer, socket, …
  • 10. • nnnnnnnnnnnnnnnnnetwork.target • mmmmmmmmmmmmmmmmmariadb.service • ssssssssssssssssshaarli.socket • pppppppppppppppppuppet-run.timer • hhhhhhhhhhhhhhhhhome.mount • sssssssssssssssssession-1.scope
  • 11. Unit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configurationUnit configuration • IIIIIIIIIIIIIIIIIni-style text files • LLLLLLLLLLLLLLLLList: systemctl list-units --all • RRRRRRRRRRRRRRRRRead: systemctl cat
  • 12. Unit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit exampleUnit example [Unit] Description=nscd [Service] Type=forking PIDFile=/run/nscd/nscd.pid ExecStart=/usr/host/bin/nscd ExecStop=/usr/host/bin/nscd −−shutdown [Install] WantedBy=multi−user.target
  • 14. Here is the rule: Packaged files go in /usr/lib. Humans (or Config management tools) override in /etc.
  • 15. Overriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding unitsOverriding units Licensed under a Creative Commons Attribution 2.0 License https://www.flickr.com/photos/alovesdc/3468924493
  • 16. Overriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: whyOverriding units: why • AAAAAAAAAAAAAAAAAdd/Remove/Change parameters • AAAAAAAAAAAAAAAAAdapt them to your needs • SSSSSSSSSSSSSSSSSet ulimits, user, … • FFFFFFFFFFFFFFFFFix bugs
  • 17. Changing services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemdChanging services before systemd • RRRRRRRRRRRRRRRRReplace /etc/init.d scripts • /////////////////etc/default, /etc/sysconfig • SSSSSSSSSSSSSSSSSpaghetti code
  • 18. Overriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemdOverriding units: with systemd • OOOOOOOOOOOOOOOOOverride completely a unit • JJJJJJJJJJJJJJJJJust add/change one parameter • """""""""""""""""Patch" vendor units
  • 19. Complete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete overrideComplete override # /etc/systemd/system/openvpn.service [Unit] Description=OpenVPN After=syslog.target [Service] ExecStart=/usr/host/bin/openvpn −−syslog −−writepid /run /openvpn.pid −−cd /etc/openvpn −−config /etc/openvpn/ openvpn.conf [Install] WantedBy=multi−user.target
  • 20. Advantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overridesAdvantages of "full" overrides • IIIIIIIIIIIIIIIIIn /etc/systemd/system • DDDDDDDDDDDDDDDDDo not conflict with packages • OOOOOOOOOOOOOOOOOverride everything, even dependencies • NNNNNNNNNNNNNNNNNot only for overrides: if you have unpackaged units, put them there
  • 21. Partial overridePartial overridePartial overridePartial overridePartial overridePartial overridePartial overridePartial overridePartial overridePartial overridePartial overridePartial overridePartial overridePartial overridePartial overridePartial overridePartial override # /etc/systemd/system/mariadb.service.d/niceness.conf [service] Nice=5
  • 22. Advantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overridesAdvantages of partial overrides • IIIIIIIIIIIIIIIIIn /etc/systemd/system/$Unit name.d/*.conf • DDDDDDDDDDDDDDDDDo not conflict with packages • OOOOOOOOOOOOOOOOOverride only what is needed • AAAAAAAAAAAAAAAAAdapt while still accept upstream work • NNNNNNNNNNNNNNNNNo need to adapt at each upgrade • WWWWWWWWWWWWWWWWWorks for everything (not only services)
  • 23. The price of that flexibility: systemctl daemon-reload
  • 24. Verify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unitVerify the loaded unit systemctl cat mariadb.service # /usr/x86_64−pc−linux−gnu/lib/systemd/system/mariadb. service [Unit] Description=MySQL database server After=syslog.target After=network.target [Service] User=mysql Group=mysql ExecStart=/usr/sbin/mysqld −−defaults−file=/etc/mysql/my .cnf −−basedir=/usr −−datadir=/var/lib/mysql # /etc/systemd/system/mariadb.service.d/nice.conf [service] Nice=5
  • 25. Instantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated unitsInstantiated units • UUUUUUUUUUUUUUUUUnits cat take @ in the name • ooooooooooooooooopenvpn@inuits.service • OOOOOOOOOOOOOOOOOn-disk: openvpn@.service • IIIIIIIIIIIIIIIIIn the file: %i will be "inuits" • %%%%%%%%%%%%%%%%%p will be "openvpn"
  • 26. Instantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit exampleInstantiated unit example [Unit] Description=OpenVPN daemon %i After=syslog.target [Service] ExecStart=/usr/host/bin/openvpn −−writepid /run/openvpn .%i.pid −−cd /etc/openvpn −−config /etc/openvpn/%i. conf PIDFile=/run/openvpn.%i.pid
  • 27. Controlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling unitsControlling units • sssssssssssssssssystemctl start mariadb.service • sssssssssssssssssystemctl status /dev/sda • sssssssssssssssssystemctl stop openvpn@*.service • sssssssssssssssssystemctl kill openvpn • sssssssssssssssssystemctl kill -s SIGKILL openvpn.service • sssssssssssssssssystemctl is-active runlevel1.target • sssssssssssssssssystemctl is-failed puppet-run.service • sssssssssssssssssystemctl is-failed puppet-run.service • sssssssssssssssssystemctl help mariadb.service
  • 28. Enabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a serviceEnabling/Disabling a service • sssssssssssssssssystemctl disable mariadb.service • WWWWWWWWWWWWWWWWWill disable the service • PPPPPPPPPPPPPPPPPrevent it to start automatically
  • 29. MaskingMaskingMaskingMaskingMaskingMaskingMaskingMaskingMaskingMaskingMaskingMaskingMaskingMaskingMaskingMaskingMasking • sssssssssssssssssystemctl mask mariadb.service • sssssssssssssssssystemctl mask --force mariadb.service • llllllllllllllllln -s /dev/null /etc/systemd/system/mariadb.service • PPPPPPPPPPPPPPPPPrevents a unit to start • BBBBBBBBBBBBBBBBBetter than "disabling" • PPPPPPPPPPPPPPPPPrevent units to be launched by hand or systemd
  • 30. ServicesServicesServicesServicesServicesServicesServicesServicesServicesServicesServicesServicesServicesServicesServicesServicesServices Licensed under a Creative Commons Attribution ShareAlike 2.0 License https://www.flickr.com/photos/nojhan/754257252
  • 31. ServiceServiceServiceServiceServiceServiceServiceServiceServiceServiceServiceServiceServiceServiceServiceServiceService • AAAAAAAAAAAAAAAAAn important part of the units • UUUUUUUUUUUUUUUUUses cgroups to track processes • [[[[[[[[[[[[[[[[[Service] section inside units
  • 32. What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service?What defines a service? • TTTTTTTTTTTTTTTTThe command(s) to run • MMMMMMMMMMMMMMMMMost of them can fork or stay in foreground • sssssssssssssssssystemd can manage both
  • 33. Type=simpleType=simpleType=simpleType=simpleType=simpleType=simpleType=simpleType=simpleType=simpleType=simpleType=simpleType=simpleType=simpleType=simpleType=simpleType=simpleType=simple • UUUUUUUUUUUUUUUUUsecase: the service stays in foreground • sssssssssssssssssystemd will track the process • IIIIIIIIIIIIIIIIIt will take care of running it "in the background"
  • 35. Type=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshotType=oneshot • UUUUUUUUUUUUUUUUUsecase: A command to run • eeeeeeeeeeeeeeeee.g: puppet agent --test • IIIIIIIIIIIIIIIIInteresting options: RemainAfterExit=, SuccessExitStatus= • RRRRRRRRRRRRRRRRReliable way to run commands • CCCCCCCCCCCCCCCCCan have all the services properties
  • 36. Other propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther propertiesOther properties • EEEEEEEEEEEEEEEEExecStart= ExecStop= • EEEEEEEEEEEEEEEEExecStartPre= ExecStartPost= • EEEEEEEEEEEEEEEEExecReload= • TTTTTTTTTTTTTTTTTimeoutStartSec= TimeoutSec= • RRRRRRRRRRRRRRRRRuntimeMaxSec= • RRRRRRRRRRRRRRRRRestart=on-failure
  • 37. ExecsExecsExecsExecsExecsExecsExecsExecsExecsExecsExecsExecsExecsExecsExecsExecsExecs Licensed under a Creative Commons Attribution 2.0 License https://www.flickr.com/photos/daveynin/3657852579/
  • 38. execsexecsexecsexecsexecsexecsexecsexecsexecsexecsexecsexecsexecsexecsexecsexecsexecs • AAAAAAAAAAAAAAAAA set of properties to configure an exec environment • UUUUUUUUUUUUUUUUUsed in services, mounts, swap, socket units • DDDDDDDDDDDDDDDDDeterministic environment for processes
  • 39. Classic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic propertiesClassic properties • UUUUUUUUUUUUUUUUUser= Group= • NNNNNNNNNNNNNNNNNice= • OOOOOOOOOOOOOOOOOOMScoreAdjust= • LLLLLLLLLLLLLLLLLimitNOFILE= • EEEEEEEEEEEEEEEEEnvironment= EnvironmentFile=
  • 41. DependenciesDependenciesDependenciesDependenciesDependenciesDependenciesDependenciesDependenciesDependenciesDependenciesDependenciesDependenciesDependenciesDependenciesDependenciesDependenciesDependencies • RRRRRRRRRRRRRRRRRequires= • WWWWWWWWWWWWWWWWWants= • AAAAAAAAAAAAAAAAAfter= Before= • AAAAAAAAAAAAAAAAAny unit can depent on any unit • AAAAAAAAAAAAAAAAA service can require a mountpoint • AAAAAAAAAAAAAAAAA moutpoint can require a target
  • 42. Problems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solvedProblems solved • RRRRRRRRRRRRRRRRRun service as a different user • JJJJJJJJJJJJJJJJJava Service Wrapper • GGGGGGGGGGGGGGGGGo Service Wrapper • YYYYYYYYYYYYYYYYYou can still use custom scripts
  • 44. temp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp files • /////////////////etc/tmpfiles.d/*.conf • /////////////////run/tmpfiles.d/*.conf • /////////////////usr/lib/tmpfiles.d/*.conf
  • 45. temp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp filestemp files • sssssssssssssssssystemd will create, and cleanup temporary files • YYYYYYYYYYYYYYYYYou can assign files, directories to specific users • IIIIIIIIIIIIIIIIIt will decide when to delete them • WWWWWWWWWWWWWWWWWhen you change the files, run systemd-tmpfiles --create
  • 47. mountmountmountmountmountmountmountmountmountmountmountmountmountmountmountmountmount • mmmmmmmmmmmmmmmmmounts are units • sssssssssssssssssystemd parses /etc/fstab • sssssssssssssssssystemd creates dependencies
  • 48. systemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab optionssystemd /etc/fstab options • xxxxxxxxxxxxxxxxx-systemd.automount • nnnnnnnnnnnnnnnnnofail • aaaaaaaaaaaaaaaaauto noauto
  • 52. systemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integrationsystemctl integration • sssssssssssssssssystemctl status shows the latest logs • sssssssssssssssssystemctl status -n 100 • sssssssssssssssssystemctl status -l
  • 53. Enabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journaldEnabling journald • BBBBBBBBBBBBBBBBBy default (el7), hybrid mode (not persistent) • MMMMMMMMMMMMMMMMMake it persistent: mkdir -p /var/log/journal
  • 54. Reading the logsReading the logsReading the logsReading the logsReading the logsReading the logsReading the logsReading the logsReading the logsReading the logsReading the logsReading the logsReading the logsReading the logsReading the logsReading the logsReading the logs • fffffffffffffffffollow: journalctl -f • lllllllllllllllllast lines: journalctl -n 100 • fffffffffffffffffrom a unit: journalctl -u puppet-run.service • ooooooooooooooooonly this boot: journalctl -b • ooooooooooooooooonly this process: journalctl /opt/puppetlabs/puppet/bin/ruby
  • 55. Logs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs exampleLogs example − Logs begin at Mon 2016−03−14 18:30:28 CET, end at Tue 2016 Mar 14 18:30:28 fqdn systemd−journal[137]: Runtime journ Mar 14 18:30:28 fqdn systemd−journal[137]: Runtime journ Mar 14 18:30:28 fqdn kernel: Initializing cgroup subsys Mar 14 18:30:28 fqdn kernel: Initializing cgroup subsys Mar 14 18:30:28 fqdn kernel: Initializing cgroup subsys Mar 14 18:30:28 fqdn kernel: Linux version 3.10.0−327.10 Mar 14 18:30:28 fqdn kernel: Command line: BOOT_IMAGE=/b Mar 14 18:30:28 fqdn kernel: e820: BIOS−provided physica Mar 14 18:30:28 fqdn kernel: BIOS−e820: [mem 0x000000000 Mar 14 18:30:28 fqdn kernel: BIOS−e820: [mem 0x000000000 Mar 14 18:30:28 fqdn kernel: BIOS−e820: [mem 0x000000000 Mar 14 18:30:28 fqdn kernel: BIOS−e820: [mem 0x000000000 Mar 14 18:30:28 fqdn kernel: BIOS−e820: [mem 0x00000000b Mar 14 18:30:28 fqdn kernel: BIOS−e820: [mem 0x00000000f Mar 14 18:30:28 fqdn kernel: BIOS−e820: [mem 0x00000000f Mar 14 18:30:28 fqdn kernel: BIOS−e820: [mem 0x000000010
  • 56. timerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimers Licensed under a Creative Commons Attribution 2.0 License https://www.flickr.com/photos/modomatic/2538687135
  • 57. Traditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cronTraditional cron AMQP_BROKER_HOST =10.1.40.19 MAILTO="sysadmin@example.com" ORACLE_HOME="/opt/example/part/python−oracle" PG_HOSTNAME ="10.1.30.10" PG_NAME="example" WS_URL=https://prod.example.com/ws/input LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/example/lib" CUPS_HOSTNAME ="10.1.40.1" LOGGING_HOST ="10.0.50.16" LOGGING_PORT="5544" 0 * * * * /opt/example/bin/cron−hourly 30 times.
  • 58. What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong?What's wrong? • NNNNNNNNNNNNNNNNNo one reads those mails • DDDDDDDDDDDDDDDDDo not keep track of exit code • HHHHHHHHHHHHHHHHHard to read that crontab • HHHHHHHHHHHHHHHHHow to reproduce the script?
  • 59. timerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimerstimers • UUUUUUUUUUUUUUUUUnits that are used to launch a service unit • SSSSSSSSSSSSSSSSSupports some cron features and anacron • AAAAAAAAAAAAAAAAAllows you to launch commands in a controlled environment
  • 60. timers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs crontimers vs cron • NNNNNNNNNNNNNNNNNo built-in emails function • CCCCCCCCCCCCCCCCCron is more simple (one line to one file vs 2 units) • TTTTTTTTTTTTTTTTTimers uses services, so predictible env • YYYYYYYYYYYYYYYYYou can run independently the service unit • TTTTTTTTTTTTTTTTTimers logs are in systemd
  • 61. Timers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers exampleTimers example # /etc/systemd/system/puppet−run.timer [Unit] Description=Systemd Timer for Puppet Agent [Timer] OnCalendar=*−*−* *:0,30:00 Persistent=true [Install] WantedBy=timers.target
  • 62. What, when?What, when?What, when?What, when?What, when?What, when?What, when?What, when?What, when?What, when?What, when?What, when?What, when?What, when?What, when?What, when?What, when? • sssssssssssssssssystemctl list-timers • LLLLLLLLLLLLLLLLLast run time • NNNNNNNNNNNNNNNNNext run time • SSSSSSSSSSSSSSSSService unit
  • 63. Socket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activation Licensed under a Creative Commons Attribution 2.0 License https://www.flickr.com/photos/alikai/1376760481
  • 64. Socket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activationSocket activation • GGGGGGGGGGGGGGGGGoal: start a service when needed • sssssssssssssssssystemd will open a socket • SSSSSSSSSSSSSSSSStart the service at first connection • pppppppppppppppppass the socket to the service
  • 65. socket unitsocket unitsocket unitsocket unitsocket unitsocket unitsocket unitsocket unitsocket unitsocket unitsocket unitsocket unitsocket unitsocket unitsocket unitsocket unitsocket unit # /etc/systemd/system/proxy−to−shaarli.socket [Unit] Description=Shaarli Proxy [Socket] ListenStream =127.0.0.1:43000 [Install] WantedBy=default.target
  • 66. systemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unitsystemd-proxy service unit [Unit] Requires=shaarli.service After=shaarli.service JoinsNamespaceOf=shaarli.service [Service] ExecStart=/usr/lib/systemd/systemd−socket−proxyd 127.0.0.1:43001
  • 67. Actual service unitActual service unitActual service unitActual service unitActual service unitActual service unitActual service unitActual service unitActual service unitActual service unitActual service unitActual service unitActual service unitActual service unitActual service unitActual service unitActual service unit [Unit] Description=Shaarli [Service] WorkingDirectory=/opt/Shaarli/dev ExecStart=/usr/bin/php −S 127.0.0.1:43001 ExecStartPost=/bin/sleep 0.1 User=shaarli Group=shaarli [Install] WantedBy=default.target
  • 68. Side commandsSide commandsSide commandsSide commandsSide commandsSide commandsSide commandsSide commandsSide commandsSide commandsSide commandsSide commandsSide commandsSide commandsSide commandsSide commandsSide commands Licensed under a Creative Commons Attribution ShareAlike 2.0 License https://www.flickr.com/photos/archer10/3029638204/
  • 69. systemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commandssystemd-* commands • sssssssssssssssssystemd-cgls: Show the cgroups hierarchy • sssssssssssssssssystemd-analyze blame: Shows the startup time • sssssssssssssssssystemd-nspawn: Containers • sssssssssssssssssystemd-run: run a command like if it was a service unit
  • 71. system settingssystem settingssystem settingssystem settingssystem settingssystem settingssystem settingssystem settingssystem settingssystem settingssystem settingssystem settingssystem settingssystem settingssystem settingssystem settingssystem settings • tttttttttttttttttimedatectl: manage/show current datetime, timezome, DST change • lllllllllllllllllocatectl: locale/keyboard changes • mmmmmmmmmmmmmmmmmachinectl: containers/vms management • hhhhhhhhhhhhhhhhhostnamectl: change/view system hostname and os info
  • 73. systemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemd • AAAAAAAAAAAAAAAAAvailable in all modern distros • BBBBBBBBBBBBBBBBBy default in almost all of them • MMMMMMMMMMMMMMMMMakes a lot for standardization • RRRRRRRRRRRRRRRRRemoves "Distro" lock-in, Adds "Linux" lock-in • IIIIIIIIIIIIIIIIIt did more for standardization than LFS
  • 74. systemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemdsystemd • PPPPPPPPPPPPPPPPPowerful tools, easily configured • RRRRRRRRRRRRRRRRReadable configuration • TTTTTTTTTTTTTTTTTakes advantage of Linux-specific mechanisms • RRRRRRRRRRRRRRRRRemoves the need for a lot of workarounds
  • 75. ContactContactContactContactContactContactContactContactContactContactContactContactContactContactContactContactContact Julien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien Pivotto julien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eu @roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie inuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuits https://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.eu info@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.eu +32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636