Yanyg - Software Engineer

Linux Systemd Introduce and Analysis

目录

1 介绍

一言以蔽之,systemdsysvinit的后继,通过并行启动方式,提供更快的系统启动速度。缺点是庞大复杂,不如sysvinit清晰。目前主流发行版本已全部切换到Systemd。

Homepage: https://freedesktop.org/wiki/Software/systemd/ ArchWiki: https://wiki.archlinux.org/index.php/systemd_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)

systemd是一个Linux系统基础组件的集合,提供了一个系统和服务管理器,运行为PID 1并负责启动其它程序。功能包括:

  • 支持并行化任务;
  • 采用socket式与D-Bus总线式激活服务;
  • 按需启动守护进程(daemon);
  • 利用Linux的cgroups监视进程;
  • 支持快照和系统恢复;
  • 维护挂载点和自动挂载点;
  • 各服务间基于依赖关系进行精密控制。

systemd 支持 SysV 和 LSB 初始脚本,可以替代 sysvinit。除此之外,功能还包括日志进程、控制基础系统配置,维护登陆用户列表以及系统账户、运行时目录和设置,可以运行容器和虚拟机,可以简单的管理网络配置、网络时间同步、日志转发和名称解析等。

systemd is a suite of basic building blocks for a Linux system. It provides a system and service manager that runs as PID 1 and starts the rest of the system. systemd provides aggressive(积极主动的) parallelization capabilities, uses socket and D-Bus activation for starting services, offers on-demand starting of daemons, keeps track of processes using Linux control groups, maintains mount and automount points, and implements an elaborate(详尽的) transactional dependency-based service control logic. systemd supports SysV and LSB init scripts and works as a replacement for sysvinit. Other parts include a logging daemon, utilities to control basic system configuration like the hostname, date, locale, maintain a list of logged-in users and running containers and virtual machines, system accounts, runtime directories and settings, and daemons to manage simple network configuration, network time synchronization, log forwarding, and name resolution. See Lennart's blog story for a longer introduction, and the three status updates since then. Also see the Wikipedia article. If you are wondering whether systemd is for you, please have a look at this comparison of init systems by one of the creators of systemd.

2 使用命令

2.1 版本:systemctl –version

~$ systemctl --version
systemd 215
+PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR

2.2 主机名称控制:hostnamectl

2.2.1 Example

~$ hostnamectl
   Static hostname: t
         Icon name: computer-laptop
           Chassis: laptop
        Machine ID: 3f8fab35efba44a482161bc965a1d153
           Boot ID: cdaca32c1ba6410281c5eab7af23957e
  Operating System: Debian GNU/Linux 8 (jessie)
            Kernel: Linux 3.16.0-4-amd64
      Architecture: x86-64
~$ sudo hostnamectl set-hostname yyy

2.2.2 Manpage

DESCRIPTION hostnamectl may be used to query and change the system hostname and related settings.

This tool distinguishes three different hostnames: the high-level "pretty" hostname which might include all kinds of special characters (e.g. "Lennart's Laptop"), the static hostname which is used to initialize the kernel hostname at boot (e.g. "lennarts-laptop"), and the transient hostname which is a default received from network configuration. If a static hostname is set, and is valid (something other than localhost), then the transient hostname is not used.

Note that the pretty hostname has little restrictions on the characters used, while the static and transient hostnames are limited to the usually accepted characters of Internet domain names.

The static hostname is stored in /etc/hostname, see hostname(5) for more information. The pretty hostname, chassis type, and icon name are stored in /etc/machine-info, see machine-id(5).

OPTIONS The following options are understood:

–no-ask-password Do not query the user for authentication for privileged operations.

–static, –transient, –pretty If status is used (or no explicit command is given) and one of those fields is given, hostnamectl will print out just this selected hostname.

If used with set-hostname, only the selected hostname(s) will be updated. When more than one of those options is used, all the specified hostnames will be updated.

-H, –host= Execute the operation remotely. Specify a hostname, or a username and hostname separated by "@", to connect to. The hostname may optionally be suffixed by a container name, separated by ":", which connects directly to a specific container on the specified host. This will use SSH to talk to the remote machine manager instance. Container names may be enumerated with machinectl -H HOST.

-h, –help Print a short help text and exit.

–version Print a short version string and exit.

The following commands are understood:

status Show current system hostname and related information.

set-hostname NAME Set the system hostname to NAME. By default, this will alter the pretty, the static, and the transient hostname alike; however, if one or more of –static, –transient, –pretty are used, only the selected hostnames are changed. If the pretty hostname is being set, and static or transient are being set as well, the specified hostname will be simplified in regards to the character set used before the latter are updated. This is done by replacing spaces with "-" and removing special characters. This ensures that the pretty and the static hostname are always closely related while still following the validity rules of the specific name. This simplification of the hostname string is not done if only the transient and/or static host names are set, and the pretty host name is left untouched.

Pass the empty string "" as the hostname to reset the selected hostnames to their default (usually "localhost").

set-icon-name NAME Set the system icon name to NAME. The icon name is used by some graphical applications to visualize this host. The icon name should follow the Icon Naming Specification[1].

Pass an empty string to reset the icon name to the default value, which is determined from chassis type (see below) and possibly other parameters.

set-chassis TYPE Set the chassis type to TYPE. The chassis type is used by some graphical applications to visualize the host or alter user interaction. Currently, the following chassis types are defined: "desktop", "laptop", "server", "tablet", "handset", "watch", as well as the special chassis types "vm" and "container" for virtualized systems that lack an immediate physical chassis.

Pass an empty string to reset the chassis type to the default value which is determined from the firmware and possibly other parameters.

EXIT STATUS On success, 0 is returned, a non-zero failure code otherwise.

2.3 系统本地化与键盘布局:localectl

2.3.1 example

~$ localectl
   System Locale: LANG=en_US.UTF-8
                  LANGUAGE=en_US:en
       VC Keymap: n/a
      X11 Layout: us
       X11 Model: pc105
~$ sudo localectl set-locale LANG=zh_CN.utf8

2.3.2 Manpage

NAME localectl - Control the system locale and keyboard layout settings

SYNOPSIS localectl [OPTIONS…] {COMMAND}

DESCRIPTION localectl may be used to query and change the system locale and keyboard layout settings.

The system locale controls the language settings of system services and of the UI before the user logs in, such as the display manager, as well as the default for users after login.

The keyboard settings control the keyboard layout used on the text console and of the graphical UI before the user logs in, such as the display manager, as well as the default for users after login.

OPTIONS

The following options are understood: –no-ask-password Do not query the user for authentication for privileged operations.

–no-convert If set-keymap or set-x11-keymap is invoked and this option is passed, then the keymap will not be converted from the console to X11, or X11 to console, respectively.

-H, –host= Execute the operation remotely. Specify a hostname, or a username and hostname separated by "@", to connect to. The hostname may optionally be suffixed by a container name, separated by ":", which connects directly to a specific container on the specified host. This will use SSH to talk to the remote machine manager instance. Container names may be enumerated with machinectl -H HOST.

-h, –help Print a short help text and exit.

–version Print a short version string and exit.

–no-pager Do not pipe output into a pager.

The following commands are understood:

status Show current settings of the system locale and keyboard mapping.

set-locale LOCALE… Set the system locale. This takes one or more assignments such as "LANG=de_DE.utf8", "LC_MESSAGES=en_GB.utf8", and so on. See locale(7) for details on the available settings and their meanings. Use list-locales for a list of available locales (see below).

list-locales List available locales useful for configuration with set-locale.

set-keymap MAP [TOGGLEMAP] Set the system keyboard mapping for the console. This takes a keyboard mapping name (such as "de" or "us"), and possibly a second one to define a toggle keyboard mapping. Unless –no-convert is passed, the selected setting is also applied to the default keyboard mapping of X11, after converting it to the closest matching X11 keyboard mapping. Use list-keymaps for a list of available keyboard mappings (see below).

list-keymaps List available keyboard mappings for the console, useful for configuration with set-keymap.

set-x11-keymap LAYOUT [MODEL] [VARIANT] [OPTIONS] Set the system default keyboard mapping for X11. This takes a keyboard mapping name (such as "de" or "us"), and possibly a model, variant and options, see kbd(4) for details. Unless –no-convert is passed, the selected setting is also applied to the system console keyboard mapping, after converting it to the closest matching console keyboard mapping.

list-x11-keymap-models, list-x11-keymap-layouts, list-x11-keymap-variants [LAYOUT], list-x11-keymap-options List available X11 keymap models, layouts, variants and options, useful for configuration with set-keymap. The command list-x11-keymap-variants optionally takes a layout parameter to limit the output to the variants suitable for the specific layout.

EXIT STATUS On success, 0 is returned, a non-zero failure code otherwise.

ENVIRONMENT $SYSTEMD_PAGER Pager to use when –no-pager is not given; overrides $PAGER. Setting this to an empty string or the value "cat" is equivalent to passing –no-pager.

$SYSTEMD_LESS Override the default options passed to less ("FRSXMK").

2.4 系统时间和日期:timedatectl

2.4.1 example

~$ timedatectl
      Local time: Fri 2018-03-30 11:11:25 CST
  Universal time: Fri 2018-03-30 03:11:25 UTC
        RTC time: Fri 2018-03-30 03:11:25
       Time zone: Asia/Shanghai (CST, +0800)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: n/a

~$ sudo timedatectl set-time HH:MM:SS
~$ sudo timedatectl set-time YYYY-MM-DD
~$ sudo timedatectl set-timezone Asia/Shanghai
~$ timedatectl set-ntp true

2.4.2 help

timedatectl --help
timedatectl [OPTIONS...] COMMAND ...

Query or change system time and date settings.

  -h --help                Show this help message
     --version             Show package version
     --no-pager            Do not pipe output into a pager
     --no-ask-password     Do not prompt for password
  -H --host=[USER@]HOST    Operate on remote host
  -M --machine=CONTAINER   Operate on local container
     --adjust-system-clock Adjust system clock when changing local RTC mode

Commands:
  status                   Show current time settings
  set-time TIME            Set system time
  set-timezone ZONE        Set system time zone
  list-timezones           Show known time zones
  set-local-rtc BOOL       Control whether RTC is in local time
  set-ntp BOOL             Control whether NTP is enabled

2.5 系统登录管理:loginctl

2.5.1 example

~$ loginctl show-user yanyg
UID=1000
GID=1000
Name=yanyg
Timestamp=Fri 2018-03-30 09:57:52 CST
TimestampMonotonic=34018185
RuntimePath=/run/user/1000
Service[email protected]
Slice=user-1000.slice
State=active
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
Linger=no

~$ loginctl list-sessions
   SESSION        UID USER             SEAT
        c1        119 Debian-gdm       seat0
         1       1000 yanyg            seat0

2 sessions listed.

2.5.2 help

~$ loginctl --help
loginctl [OPTIONS...] {COMMAND} ...

Send control commands to or query the login manager.

  -h --help              Show this help
     --version           Show package version
     --no-pager          Do not pipe output into a pager
     --no-legend         Do not show the headers and footers
     --no-ask-password   Don't prompt for password
  -H --host=[USER@]HOST  Operate on remote host
  -M --machine=CONTAINER Operate on local container
  -p --property=NAME     Show only properties by this name
  -a --all               Show all properties, including empty ones
  -l --full              Do not ellipsize output
     --kill-who=WHO      Who to send signal to
  -s --signal=SIGNAL     Which signal to send

Commands:
  list-sessions            List sessions
  session-status ID...     Show session status
  show-session [ID...]     Show properties of sessions or the manager
  activate ID              Activate a session
lock-session ID...       Screen lock one or more sessions
unlock-session ID...     Screen unlock one or more sessions
lock-sessions            Screen lock all current sessions
unlock-sessions          Screen unlock all current sessions
terminate-session ID...  Terminate one or more sessions
kill-session ID...       Send signal to processes of a session
list-users               List users
user-status USER...      Show user status
show-user [USER...]      Show properties of users or the manager
enable-linger USER...    Enable linger state of one or more users
disable-linger USER...   Disable linger state of one or more users
terminate-user USER...   Terminate all sessions of one or more users
kill-user USER...        Send signal to processes of a user
list-seats               List seats
seat-status NAME...      Show seat status
show-seat NAME...        Show properties of one or more seats
attach NAME DEVICE...    Attach one or more devices to a seat
flush-devices            Flush all device associations
terminate-seat NAME...   Terminate all sessions on one or more seats

2.6 Systemd系统和服务管理:systemctl

2.6.1 example

2.6.1.1 显示已知units:systemctl list-units [PATTERN…]
~$ systemctl list-units
  UNIT                         LOAD   ACTIVE SUB       DESCRIPTION
  proc-sys-fs-binfmt_misc.automount loaded active running   Arbitrary Executable Fil
  sys-devices-pci0000:00-0000:00:02.0-drm-card0-card0\x2dLVDS\x2d1-intel_backlight.d
  sys-devices-pci0000:00-0000:00:14.0-usb3-3\x2d2-3\x2d2:1.0-host6-target6:0:0-6:0:0
  sys-devices-pci0000:00-0000:00:14.0-usb3-3\x2d2-3\x2d2:1.0-host6-target6:0:0-6:0:0
  sys-devices-pci0000:00-0000:00:16.3-tty-ttyS0.device loaded active plugged   7 Ser
  sys-devices-pci0000:00-0000:00:19.0-net-eth0.device loaded active plugged   82579L
  sys-devices-pci0000:00-0000:00:1a.0-usb1-1\x2d1-1\x2d1.4-1\x2d1.4:1.0-bluetooth-hc
  sys-devices-pci0000:00-0000:00:1a.0-usb1-1\x2d1-1\x2d1.4-1\x2d1.4:1.0-bluetooth-hc
  sys-devices-pci0000:00-0000:00:1b.0-sound-card0.device loaded active plugged   7 S
  sys-devices-pci0000:00-0000:00:1c.1-0000:03:00.0-ieee80211-phy0-rfkill2.device loa
  sys-devices-pci0000:00-0000:00:1c.1-0000:03:00.0-net-wlan0.device loaded active pl
  sys-devices-pci0000:00-0000:00:1f.2-ata1-host0-target0:0:0-0:0:0:0-block-sda-sda1.
  sys-devices-pci0000:00-0000:00:1f.2-ata1-host0-target0:0:0-0:0:0:0-block-sda-sda2.
~$ systemctl list-units '*ssh*'
UNIT        LOAD   ACTIVE SUB     DESCRIPTION
ssh.service loaded active running OpenBSD Secure Shell server

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

1 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

~$ systemctl list-units --all
  UNIT                        LOAD      ACTIVE   SUB       DESCRIPTION
  proc-sys-fs-binfmt_misc.automount loaded    active   running   Arbitrary Executabl
  dev-disk-by\x2did-ata\x2dSamsung_SSD_850_EVO_250GB_S2R7NX0H704812X.device loaded
  dev-disk-by\x2did-ata\x2dSamsung_SSD_850_EVO_250GB_S2R7NX0H704812X\x2dpart1.device
  dev-disk-by\x2did-ata\x2dSamsung_SSD_850_EVO_250GB_S2R7NX0H704812X\x2dpart2.device
  dev-disk-by\x2did-ata\x2dSamsung_SSD_850_EVO_250GB_S2R7NX0H704812X\x2dpart3.device
  dev-disk-by\x2did-ata\x2dSamsung_SSD_850_EVO_250GB_S2R7NX0H704812X\x2dpart4.device
  dev-disk-by\x2did-ata\x2dST2000LM007\x2d1R8174_WCC12JNZ.device loaded    active
  dev-disk-by\x2did-ata\x2dST2000LM007\x2d1R8174_WCC12JNZ\x2dpart1.device loaded
● var-lock.mount              not-found inactive dead      var-lock.mount
● var-run.mount               not-found inactive dead      var-run.mount
  acpid.path                  loaded    active   running   ACPI Events Check
  alsa-restore.service        loaded    inactive dead      Restore Sound Card State
2.6.1.2 显示安装的unit文件:list-unit-files [PATTERN…]
~$ systemctl list-unit-files | wc -l
263

~$ systemctl list-unit-files
UNIT FILE                                  STATE
proc-sys-fs-binfmt_misc.automount          static
dev-hugepages.mount                        static
dev-mqueue.mount                           static
proc-sys-fs-binfmt_misc.mount              static
sys-fs-fuse-connections.mount              static
sys-kernel-config.mount                    static
sys-kernel-debug.mount                     static
tmp.mount                                  disabled
acpid.path                                 enabled
cups.path                                  enabled
systemd-ask-password-console.path          static
2.6.1.3 systemctl candidates: systemctl with two tabs
~$ systemctl
cancel                 is-active              reload-or-restart
cat                    is-enabled             reload-or-try-restart
condreload             is-failed              rescue
condrestart            isolate                reset-failed
condstop               kexec                  restart
daemon-reexec          kill                   set-default
daemon-reload          link                   set-environment
default                list-dependencies      show
delete                 list-jobs              show-environment
disable                list-sockets           snapshot
emergency              list-timers            start
enable                 list-unit-files        status
exit                   list-units             stop
force-reload           mask                   suspend
get-default            poweroff               try-restart
halt                   preset                 unmask
help                   reboot                 unset-environment
hibernate              reenable
hybrid-sleep           reload

2.6.2 help

~$ systemctl [OPTIONS...] {COMMAND} ...

Query or send control commands to the systemd manager.

  -h --help           Show this help
     --version        Show package version
     --system         Connect to system manager
     --user           Connect to user service manager
  -H --host=[USER@]HOST
                      Operate on remote host
  -M --machine=CONTAINER
                      Operate on local container
  -t --type=TYPE      List only units of a particular type
     --state=STATE    List only units with particular LOAD or SUB or ACTIVE state
  -p --property=NAME  Show only properties by this name
  -a --all            Show all loaded units/properties, including dead/empty
                      ones. To list all units installed on the system, use
                      the 'list-unit-files' command instead.
  -l --full           Don't ellipsize unit names on output
  -r --recursive      Show unit list of host and local containers
     --reverse        Show reverse dependencies with 'list-dependencies'
     --job-mode=MODE  Specify how to deal with already queued jobs, when
                      queueing a new job
     --show-types     When showing sockets, explicitly show their type
  -i --ignore-inhibitors
                      When shutting down or sleeping, ignore inhibitors
     --kill-who=WHO   Who to send signal to
  -s --signal=SIGNAL  Which signal to send
  -q --quiet          Suppress output
     --no-block       Do not wait until operation finished
     --no-wall        Don't send wall message before halt/power-off/reboot
     --no-reload      When enabling/disabling unit files, don't reload daemon
                      configuration
     --no-legend      Do not print a legend (column headers and hints)
     --no-pager       Do not pipe output into a pager
     --no-ask-password
                      Do not ask for system passwords
     --global         Enable/disable unit files globally
     --runtime        Enable unit files only temporarily until next reboot
  -f --force          When enabling unit files, override existing symlinks
                      When shutting down, execute action immediately
     --preset-mode=   Specifies whether fully apply presets, or only enable,
                      or only disable
     --root=PATH      Enable unit files in the specified root directory
  -n --lines=INTEGER  Number of journal entries to show
  -o --output=STRING  Change journal output mode (short, short-monotonic,
                      verbose, export, json, json-pretty, json-sse, cat)
     --plain          Print unit dependencies as a list instead of a tree
Unit Commands:
  list-units [PATTERN...]         List loaded units
  list-sockets [PATTERN...]       List loaded sockets ordered by address
  list-timers [PATTERN...]        List loaded timers ordered by next elapse
  start NAME...                   Start (activate) one or more units
  stop NAME...                    Stop (deactivate) one or more units
  reload NAME...                  Reload one or more units
  restart NAME...                 Start or restart one or more units
  try-restart NAME...             Restart one or more units if active
  reload-or-restart NAME...       Reload one or more units if possible,
                                  otherwise start or restart
  reload-or-try-restart NAME...   Reload one or more units if possible,
                                  otherwise restart if active
  isolate NAME                    Start one unit and stop all others
  kill NAME...                    Send signal to processes of a unit
  is-active PATTERN...            Check whether units are active
  is-failed PATTERN...            Check whether units are failed
  status [PATTERN...|PID...]      Show runtime status of one or more units
  show [PATTERN...|JOB...]        Show properties of one or more
                                  units/jobs or the manager
  cat PATTERN...                  Show files and drop-ins of one or more units
  set-property NAME ASSIGNMENT... Sets one or more properties of a unit
  help PATTERN...|PID...          Show manual for one or more units
  reset-failed [PATTERN...]       Reset failed state for all, one, or more
                                  units
  list-dependencies [NAME]        Recursively show units which are required
                                  or wanted by this unit or by which this
                                  unit is required or wanted

Unit File Commands:
  list-unit-files [PATTERN...]    List installed unit files
  enable NAME...                  Enable one or more unit files
  disable NAME...                 Disable one or more unit files
  reenable NAME...                Reenable one or more unit files
  preset NAME...                  Enable/disable one or more unit files
                                  based on preset configuration
  preset-all                      Enable/disable all unit files based on
                                  preset configuration
  is-enabled NAME...              Check whether unit files are enabled

  mask NAME...                    Mask one or more units
  unmask NAME...                  Unmask one or more units
  link PATH...                    Link one or more units files into
                                  the search path
  get-default                     Get the name of the default target
  set-default NAME                Set the default target

Machine Commands:
  list-machines [PATTERN...]      List local containers and host

Job Commands:
  list-jobs [PATTERN...]          List jobs
  cancel [JOB...]                 Cancel all, one, or more jobs

Snapshot Commands:
  snapshot [NAME]                 Create a snapshot
  delete NAME...                  Remove one or more snapshots

Environment Commands:
  show-environment                Dump environment
  set-environment NAME=VALUE...   Set one or more environment variables
  unset-environment NAME...       Unset one or more environment variables
  import-environment NAME...      Import all, one or more environment variables

Manager Lifecycle Commands:
  daemon-reload                   Reload systemd manager configuration
  daemon-reexec                   Reexecute systemd manager

System Commands:
  is-system-running               Check whether system is fully running
  default                         Enter system default mode
  rescue                          Enter system rescue mode
  emergency                       Enter system emergency mode
  halt                            Shut down and halt the system
  poweroff                        Shut down and power-off the system
  reboot [ARG]                    Shut down and reboot the system
  kexec                           Shut down and reboot the system with kexec
  exit                            Request user instance exit
  switch-root ROOT [INIT]         Change to a different root file system
  suspend                         Suspend the system
  hibernate                       Hibernate the system
  hybrid-sleep                    Hibernate and suspend the system

3 学习笔记

参考:systemd学习笔记

4 作者

Systemd作者Lennart Poettering(Homepage, GitHub)。

因Systemd复杂性,作者受到了很多攻击。他在G+上有过一次口水战:

Much of the Open Source community tries to advertise the community as one happy place to the outside. Where contributions are valued only by their technical quality, and everybody meets at conferences for beers.

Well, it is not like that. It's quite a sick place to be in.

I don't usually talk about this too much, and hence I figure that people are really not aware of this, but yes, the Open Source community is full of assholes, and I probably more than most others am one of their most favourite targets. I get hate mail for hacking on Open Source. People have started multiple "petitions" on petition web sites, asking me to stop working (google for it). Recently, people started collecting Bitcoins to hire a hitman for me (this really happened!). Just the other day, some idiot posted a "song" on youtube, a creepy work, filled with expletives about me and suggestions of violence. People post websites about boycotting my projects, containing pretty personal attacks. On IRC, people /msg me sometimes, with nasty messages, and references to artwork in 4chan style. And there's more. A lot more.

I am used to rough discussions on mailing lists, and yes, when I was younger I did not always stay technical in flamewars, but nowadays I am pretty good at that, I am sometimes articulate, but never personal. I have a thick skin (and so do most of the others involved in systemd, apparently), and I figure that plays a major role why we managed to bring systemd to success, despite all the pressure in the opposite direction. But from time to time, I just have to stand back and say "Wow, what an awful community Linux has!".

The Internet is full of deranged people, no doubt, so one might just discount all of this on the grounds that the Open Source community isn't any different than any other community on the Internet or even offline. But I don't think so. I am pretty sure there are certain things that foster bad behaviour. On one hand there are certain communities where it appears to be a lot more accepted to vent hate, communities that attract a certain kind of people (Hey, Gentoo!) more than others do. (Yes, the folks who post the stuff they do usually pretty clearly state from wich community they come).

But more importantly, I'd actually put some blame on a certain circle of folks that play a major role in kernel development, and first and foremost Linus Torvalds himself. By many he is a considered a role model, but he is quite a bad one. If he posts words like "[specific folks] …should be retroactively aborted. Who the f*ck does idiotic things like that? How did they not die as babies, considering that they were likely too stupid to find a tit to suck on?" (google for it), than that's certainly bad. But what I find particularly appalling is the fact that he regularly defends this, and advertises this as an efficient way to run a community. (But it is not just Linus, it's a certain group of people around him who use the exact same style, some of which semi-publically even phantasize about the best ways to, … well, kill me).

But no, it's not an efficient way to run a community. If Linux had success, then that certainly happened despite, not because of this behaviour. I am pretty sure the damage being done by this is quite obvious, it not only sours the tone in the Linux community, it is also teaches new contributors to adopt the same style, but that only if it doesn't scare them away in the first place.

In other words: A fish rots from the head down.

I don't mind using strong language, I don't mind the use of words such as "fuck", I use the word all the time too, it's really not about that. I must simply say that I wished it would stay at that, because what actually is happening is so much worse, and and so much more hateful.

If you are a newcomer to Linux, either grow a really thick skin. Or run away, it's not a friendly place to be in. It is sad that it is that way, but it certainly is.

The Linux community is dominated by western, white, straight, males in their 30s and 40s these days. I perfectly fit in that pattern, and the rubbish they pour over me is awful. I can only imagine that it is much worse for members of minorities, or people from different cultural backgrounds, in particular ones where losing face is a major issue.

You know, I can deal with all this shit, and I guess in a way with the energy we are pushing the changes we propose with we are calling for opposition, so this post is really not intended to be a call for sympathy. The main point I want to make with this is to correct a few things about our communities, and how their are percieved. Open Source isn't a kindergarten. Open Source is awful in many ways, and people should be aware of this.

Not everybody in the Linux community is like this, the vast majority isn't. Not even all our different communities really have a problem with this at all. But many do, and the most prominent one, the Linux community as a whole certainly has.

I am not the one to fix any of this, I cannot tell you how one could do it. And quite frankly, I really don't want to be involved in fixing this. I am a technical guy, I want to do technical things.

My personal conclusion out of all this is mostly just that I don't want to have much to do with the worst offenders, and the communities they run. My involvement with the kernel community ended pretty much before it even started, I never post on LKML, and haven't done in years. Also, in our own project we are policying posts. We regularly put a few folks on moderation on the mailing list, and we will continue to do so. Currently, the systemd community is fantastic, and I really hope we can keep it that way.

And that's all about this topic from me. I have no intentions to ever talk about this again on a public forum.

5 References