From cbc9b06e4abe070de71529e02fcb9f247e56c85e Mon Sep 17 00:00:00 2001 From: Carlos Sosa Date: Wed, 14 Aug 2019 23:34:59 -0700 Subject: Add list of categories as templates for index.html --- article/x240-debian-jessie.html | 1321 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 1321 insertions(+) create mode 100755 article/x240-debian-jessie.html (limited to 'article') diff --git a/article/x240-debian-jessie.html b/article/x240-debian-jessie.html new file mode 100755 index 0000000..ef6c905 --- /dev/null +++ b/article/x240-debian-jessie.html @@ -0,0 +1,1321 @@ +--- +title: Debian Jessie on Thinkpad X240 +categories: [article] +--- + + + +Debian Jessie on Thinkpad X240 + + + + + + + + + + + + + +
+

Debian Jessie on Thinkpad X240

+ + + +
+

Why not Debian Wheezy?

+
+

+I've tried really hard to get the X240 running on Debian Wheezy (Stable), +but after investing days trying to fix basic hardware failures I decided to +move to Debian Jessie (testing). +

+
+
+ +
+

Hardware

+
+
+

Kernel

+
+

+Before you do anything you should get the hardware working correctly. +In order to do that, any Linux kernel image from the +testing/unstable/experimental repositories will work great. +

+ +

+It's known that most hardware components will work properly starting kernel +version 3.12.
+3.13.x and 3.14.x versions only worked for me. +

+ +
+ +
uname -a
+
+
+ +
+Linux raiser 3.14-1-amd64 #1 SMP Debian 3.14.7-1 (2014-06-16) x86_64 GNU/Linux
+
+ +

+This is how your output of lspci should look like. +

+ +
+ +
lspci
+
+
+ +
+00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 0b)
+00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 0b)
+00:03.0 Audio device: Intel Corporation Haswell-ULT HD Audio Controller (rev 0b)
+00:14.0 USB controller: Intel Corporation Lynx Point-LP USB xHCI HC (rev 04)
+00:16.0 Communication controller: Intel Corporation Lynx Point-LP HECI #0 (rev 04)
+00:16.3 Serial controller: Intel Corporation Lynx Point-LP HECI KT (rev 04)
+00:19.0 Ethernet controller: Intel Corporation Ethernet Connection I218-LM (rev 04)
+00:1b.0 Audio device: Intel Corporation Lynx Point-LP HD Audio Controller (rev 04)
+00:1c.0 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 6 (rev e4)
+00:1c.1 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 3 (rev e4)
+00:1d.0 USB controller: Intel Corporation Lynx Point-LP USB EHCI #1 (rev 04)
+00:1f.0 ISA bridge: Intel Corporation Lynx Point-LP LPC Controller (rev 04)
+00:1f.2 SATA controller: Intel Corporation Lynx Point-LP SATA Controller 1 [AHCI mode] (rev 04)
+00:1f.3 SMBus: Intel Corporation Lynx Point-LP SMBus Controller (rev 04)
+02:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5227 PCI Express Card Reader (rev 01)
+03:00.0 Network controller: Intel Corporation Wireless 7260 (rev 83)
+
+
+
+ +
+

Brightness Controls

+
+

+By default, the brightness keys will control stages of the brightness +level. To change that behavior to gradually change the brightness, add +the following line to your /etc/default/grub: +

+ +
+ +
cat /etc/default/grub | grep GRUB_CMDLINE_LINUX_DEFAULT
+
+
+ +
+GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux acpi_backlight=vendor"
+
+ +

+Next update GRUB: +

+ +
+ +
update-grub
+
+
+
+
+ +
+

Intel Graphics

+
+

+By default, X server will enable the hardware acceleration, DRI, and +other GL settings. To enable SNA acceleration for the Intel GPU, +create a configuration file in /etc/X11/xorg.conf.d/ with the +following: +

+ +
+ +
cat /etc/X11/xorg.conf.d/20-intel.conf
+
+
+ +
+Section "Device"
+   Identifier  "Intel Graphics"
+   Driver      "intel"
+   Option      "AccelMethod"  "sna"
+EndSection
+
+
+
+ +
+

Power Saving

+
+
+

Powertop

+
+

+Powertop is a tool that will output the current usage of electricity +by each hardware component, and how it's been managed. +

+ +

+The best feature from Powertop is the Tunables section. In this +section, you're able to fine tune the available power saving modes of +your hardware components. +

+ +

+Start Powertop +

+ +
+ +
sudo powertop
+
+
+ +

+Hit the key <TAB> to browse, and select from a range of tunable +options. Powertop tells you which to change with a description of +Bad. +

+
+
+ +
+

RC6 Kernel Settings

+
+

+The Intel i915 RC6 triggers a lower power state during the GPUs idle +state. +

+ +

+To enable RC6, you need to add the GRUB boot flag: +

+ +
+ +
cat /etc/default/grub | grep GRUB_CMDLINE_LINUX_DEFAULT
+
+
+ +
+GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i915.i915_enable_rc6=1"
+
+ +

+Next update GRUB: +

+ +
+ +
update-grub
+
+
+ +

+This will enable it on boot, but usually TLP handles RC6 switching +on suspend/hibernation/resume modes. +

+ +

+For more information on Intel i915 power saving settings, see +Ubuntu's Power Saving Tweaks. +

+
+
+ +
+

TLP

+
+

+Everybody in the community recommends TLP for controlling power +usage, and triggering the power saving capabilities of multiple +hardware devices. TLP works well with systemd, and it provides +specific modules for modern Lenovo Thinkpads. +

+
+ +
  • Installation
    +

    +Create a tlp.list file for the tlp repositories in +/etc/apt/sources.list.d/ that contains the following line: +

    + +
    + +
    cat /etc/apt/sources.list.d/tlp.list
    +
    +
    + +
    +deb http://ppa.launchpad.net/linrunner/tlp/ubuntu lucid main 
    +
    + +

    +Add TLP's keys to the apt keyring with the following command: +

    + +
    + +
    apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 02D65EFF
    +
    +
    + +

    +Re-synchronize the packages index and install the TLP's packages: +

    + +
    + +
    apt-get update
    +
    +
    + +
    + +
    apt-get install tlp tlp-rdw tp-smapi-dkms acpi-call-tools
    +
    +
    + +

    +For more information about the installation process, see TLP's +installation section. +

    +
    +
  • + +
  • Configuration
    +

    +My TLP configuration: +

    + +
    + +
    cat /etc/default/tlp
    +
    +
    + +
    +# ------------------------------------------------------------------------------
    +# tlp - Parameters for power save
    +
    +# Hint: some features are disabled by default, remove the leading # to enable them
    +
    +# Set to 0 to disable/1 to enable TLP
    +TLP_ENABLE=1
    +
    +# Seconds laptop mode has to to wait after the disk goes idle before doing a sync.
    +# Non-zero value enables, zero disables laptop mode.
    +DISK_IDLE_SECS_ON_AC=0
    +DISK_IDLE_SECS_ON_BAT=2
    +
    +# Dirty page values (timeouts in secs).
    +MAX_LOST_WORK_SECS_ON_AC=15
    +MAX_LOST_WORK_SECS_ON_BAT=60
    +
    +# Select a cpu frequency scaling governor: ondemand/powersave/performance/conservative
    +# Important:
    +# - You *must* disable your distribution's governor settings or conflicts will occur
    +# - ondemand is sufficient for *almost all* workloads, you should know what you're doing!
    +CPU_SCALING_GOVERNOR_ON_AC=performance
    +CPU_SCALING_GOVERNOR_ON_BAT=ondemand
    +
    +# Set the min/max frequency available for the scaling governor.
    +# Possible values strongly depend on your cpu. For available frequencies see
    +# tlp-stat output, Section "+++ Processor".
    +# Hint: Parameters are disabled by default, remove the leading # to enable them,
    +#       otherwise kernel default values are used.
    +#CPU_SCALING_MIN_FREQ_ON_AC=0
    +#CPU_SCALING_MAX_FREQ_ON_AC=0
    +#CPU_SCALING_MIN_FREQ_ON_BAT=0
    +#CPU_SCALING_MAX_FREQ_ON_BAT=0
    +
    +# Set the cpu "turbo boost" feature: 0=disable / 1=allow
    +# Requires an Intel Core i processor and kernel 3.7 or later.
    +# Important:
    +# - This may conflict with your distribution's governor settings
    +# - A value of 1 does *not* activate boosting, it just allows it
    +CPU_BOOST_ON_AC=1
    +CPU_BOOST_ON_BAT=0
    +
    +# Minimize number of used cpu cores/hyper-threads under light load conditions
    +SCHED_POWERSAVE_ON_AC=0
    +SCHED_POWERSAVE_ON_BAT=1
    +
    +# Kernel NMI Watchdog
    +# 0=disable (default, saves power) / 1=enable (for kernel debugging only)
    +NMI_WATCHDOG=0
    +
    +# Change CPU voltages aka "undervolting" - Kernel with PHC patch required
    +# Freq:voltage pairs are written to /sys/devices/system/cpu/cpu0/cpufreq/phc_controls
    +# CAUTION: only use this, if you thoroughly understand what you are doing!
    +#PHC_CONTROLS="F:V F:V F:V F:V"
    +
    +# Hard disk devices, separate multiple devices with spaces (default: sda).
    +# Devices can be specified by disk id too (lookup with: tlp diskid).
    +DISK_DEVICES="sda sdb"
    +
    +# Hard disk advanced power management level: 1(max saving)..254(off)
    +# Levels 1..127 may spin down the disk.
    +# Separate values for multiple devices with spaces.
    +DISK_APM_LEVEL_ON_AC="254 254"
    +DISK_APM_LEVEL_ON_BAT="128 128"
    +
    +# Hard disk spin down timeout:
    +# 0:        spin down disabled
    +# 1..240:   timeouts from 5s to 20min (in units of 5s)
    +# 241..251: timeouts from 30min to 5.5 hours (in units of 30min)
    +# (see 'man hdparm' for details)
    +#DISK_SPINDOWN_TIMEOUT_ON_AC="0 0"
    +#DISK_SPINDOWN_TIMEOUT_ON_BAT="0 0"
    +
    +# Select io scheduler for the disk devices: noop/deadline/cfq (Default: cfq)
    +# Separate values for multiple devices with spaces.
    +#DISK_IOSCHED="cfq cfq"
    +
    +# SATA aggressive link power management (ALPM):
    +# min_power/medium_power/max_performance
    +SATA_LINKPWR_ON_AC=max_performance
    +SATA_LINKPWR_ON_BAT=medium_power
    +
    +# PCI Express Active State Power Management (PCIe ASPM):
    +# default/performance/powersave
    +# Hint: needs kernel boot option pcie_aspm=force on some machines
    +PCIE_ASPM_ON_AC=performance
    +PCIE_ASPM_ON_BAT=powersave
    +
    +# Radeon graphics clock speed (profile method): low/mid/high/auto/default
    +# auto = mid on BAT, high on AC; default = use hardware defaults
    +# (Kernel >= 2.6.35 only, not with fglrx driver!)
    +RADEON_POWER_PROFILE_ON_AC=high
    +RADEON_POWER_PROFILE_ON_BAT=low
    +
    +# New radeon dynamic power management method (dpm): battery/performance
    +# (Kernel >= 3.11 only, requires boot option radeon.dpm=1)
    +RADEON_DPM_STATE_ON_AC=performance
    +RADEON_DPM_STATE_ON_BAT=battery
    +
    +# New radeon dpm performance level: auto/low/high (auto is recommended)
    +RADEON_DPM_PERF_LEVEL_ON_AC=auto
    +RADEON_DPM_PERF_LEVEL_ON_BAT=auto
    +
    +# WiFi power saving mode: 1=disable/5=enable
    +# (Linux 2.6.32 and later, some adapters only!)
    +WIFI_PWR_ON_AC=1
    +WIFI_PWR_ON_BAT=5
    +
    +# Disable wake on lan: Y/N
    +WOL_DISABLE=Y
    +
    +# Enable audio power saving for Intel HDA, AC97 devices (timeout in secs).
    +# A value of 0 disables / >=1 enables power save.
    +SOUND_POWER_SAVE_ON_AC=0
    +SOUND_POWER_SAVE_ON_BAT=1
    +
    +# Disable controller too (HDA only): Y/N
    +SOUND_POWER_SAVE_CONTROLLER=Y
    +
    +# Set to 1 to power off optical drive in UltraBay (ThinkPads only)
    +# when running on battery. A value of 0 disables this Feature (Default).
    +# Drive can be powered on again by releasing (and reinserting) the
    +# eject lever or by pressing the disc eject button on newer models.
    +# Note: an UltraBay hard disk is never powered off.
    +BAY_POWEROFF_ON_BAT=0
    +# Optical drive device to power off (default sr0)
    +BAY_DEVICE="sr0"
    +
    +# Runtime Power Management for pci(e) bus devices
    +# (Kernel >= 2.6.35 only): on=disable/auto=enable
    +RUNTIME_PM_ON_AC=on
    +RUNTIME_PM_ON_BAT=auto
    +
    +# Runtime PM for *all* pci(e) bus devices, expect backlisted ones:
    +# 0=disable / 1=enable
    +# Warning: experimental option, could cause system instabilities
    +RUNTIME_PM_ALL=0
    +
    +# Exclude pci(e) device adresses the following list from Runtime PM
    +# (separate with spaces). Use lspci to get the adresses (1st column).
    +#RUNTIME_PM_BLACKLIST="bb:dd.f 11:22.3 44:55.6"
    +
    +# Set to 0 to disable/1 to enable usb autosuspend feature
    +USB_AUTOSUSPEND=1
    +
    +# Devices from the following list are excluded from usb autosuspend
    +# (separate with spaces). Use lsusb to get the ids.
    +# Note: input devices (usbhid) are excluded automatically
    +#USB_BLACKLIST="1111:2222 3333:4444"
    +
    +# WWAN devices are excluded from usb autosuspend:
    +# 0=do not exclude / 1=exclude
    +# Note: works for ids 05c6:* 0bdb:* 1199:* only
    +USB_BLACKLIST_WWAN=1
    +
    +# Set to 1 to disable autosuspend before shutdown/0 to do nothing
    +# (workaround for usb devices that cause shutdown problems)
    +#USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN=1
    +
    +# Restore radio device state (bluetooth, wifi, wwan) from previous shutdown
    +# on system startup: 0=disable/1=enable
    +# Hint: the parameters DEVICES_TO_DISABLE/ENABLE_ON_STARTUP/SHUTDOWN below
    +#       are ignored when this is enabled!
    +RESTORE_DEVICE_STATE_ON_STARTUP=0
    +
    +# Radio devices to disable on startup: bluetooth wifi wwan
    +#DEVICES_TO_DISABLE_ON_STARTUP="bluetooth wifi wwan"
    +
    +# Radio devices to enable on startup: bluetooth wifi wwan
    +#DEVICES_TO_ENABLE_ON_STARTUP="wifi"
    +
    +# Radio devices to disable on shutdown: bluetooth wifi wwan
    +# (workaround for devices that are blocking shutdown)
    +#DEVICES_TO_DISABLE_ON_SHUTDOWN="bluetooth wifi wwan"
    +
    +# Radio devices to enable on shutdown: bluetooth wifi wwan
    +# (to prevent other operating systems from missing radios)
    +#DEVICES_TO_ENABLE_ON_SHUTDOWN="wwan"
    +
    +# Radio devices to enable when wireless radio switch is turned on:
    +# bluetooth wifi wwan (Ubuntu + ThinkPad only)
    +#DEVICES_TO_ENABLE_ON_RADIOSW="wifi wwan"
    +
    +# Battery charge thresholds (ThinkPad only, tp-smapi or acpi-call kernel module required)
    +# Charging starts when the remaining capacity falls below the START_CHARGE_TRESH
    +# value and stops when exceeding the STOP_CHARGE_TRESH value.
    +# Main battery (values in %)
    +#START_CHARGE_THRESH_BAT0=75
    +#STOP_CHARGE_THRESH_BAT0=80
    +# Ultrabay or slice battery (values in %)
    +#START_CHARGE_THRESH_BAT1=75
    +#STOP_CHARGE_THRESH_BAT1=80
    +
    +# Set to 1 to disable use of tpacpi-bat on Sandy Bridge or newer Thinkpads
    +# and force usage of tp-smapi instead
    +#DISABLE_TPACPIBAT=1
    +
    +# ------------------------------------------------------------------------------
    +# tlp-rdw - Parameters for the radio device wizard
    +# Possible devices: bluetooth/wifi/wwan
    +
    +# Hint: parameters are disabled by default, remove the leading # to enable them
    +
    +# Radio devices to disable on connect
    +DEVICES_TO_DISABLE_ON_LAN_CONNECT="wifi wwan"
    +DEVICES_TO_DISABLE_ON_WIFI_CONNECT="wwan"
    +DEVICES_TO_DISABLE_ON_WWAN_CONNECT="wifi"
    +
    +# Radio devices to enable on disconnect
    +DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="wifi wwan"
    +DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT=""
    +DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT=""
    +
    +# Radio devices to enable/disable when docked
    +#DEVICES_TO_ENABLE_ON_DOCK=""
    +#DEVICES_TO_DISABLE_ON_DOCK=""
    +
    +# Radio devices to enable/disable when undocked
    +#DEVICES_TO_ENABLE_ON_UNDOCK="wifi"
    +#DEVICES_TO_DISABLE_ON_UNDOCK=""
    +
    +
    +
+
+
+ +
+

Touchpad

+
+

+As you already notice, the touchpad is quite peculiar. Itself is a +giant click-button. In the upper section of the touchpad, there are +divisions assigned for each mouse button. It gets time to get used to, +but I prefer it since I mostly use my trackpad. The distance between +the divisions of the mouse buttons and the trackpad is perfect, this +makes the usage of both pleasant. +

+ +

+By default, the divisions of the buttons, two-finger scrolling, and +the sensibility calibration are not set. To enable all of them, set up +a configuration file for the X server in /etc/X11/xorg.conf.d/ +with the following: +

+ +
+ +
cat /etc/X11/xorg.conf.d/50-synaptics.conf
+
+
+ +
+# Synaptics Touchpad configuration for Thinkpad X240
+Section "InputClass"
+        Identifier "touchpad catchall"
+        Driver "synaptics"
+        MatchIsTouchpad "on"
+        MatchDevicePath "/dev/input/event*"
+ 
+        # buttons by multi-touch taps
+        Option "TapButton1"           "1"     # left click with one finger tap
+        Option "TapButton2"           "2"     # middle click with two finger tap
+        Option "TapButton3"           "3"     # right click with three finger tap
+ 
+        # bottom right corner tap is right click
+        Option "RBCornerButton"       "3"
+ 
+        # scroll with two fingers only
+        Option "VertEdgeScroll"       "off"
+        Option "VertTwoFingerScroll"  "on"
+        Option "HorizEdgeScroll"      "off"
+        Option "HorizTwoFingerScroll" "on"
+        Option "CircularScrolling"    "off"
+ 
+        # locked drags
+        Option "LockedDrags"          "1"
+        Option "LockedDragTimeout"    "500"
+ 
+        # top row click areas
+        Option "ClickPad"             "true"
+        Option "SoftButtonAreas"      "60% 0 0 5% 40% 60% 0 5%"
+        Option "AreaTopEdge"          "4%"
+EndSection
+ 
+# avoid interferences from other drivers
+Section "InputClass"
+        Identifier "touchpad ignore duplicates"
+        MatchIsTouchpad "on"
+        MatchOS "Linux"
+        MatchDevicePath "/dev/input/mouse*"
+        Option "Ignore" "on"
+EndSection
+
+
+
+
+ + +
+

System

+
+
+

systemd

+
+

+systemd is a great tool for managing services and system states. I +won't explain what systemd is, or why you should be using it in +your system. I will only add that, it does have a learning curve, it +goes against all the established patterns for upstarting a system and +its services. +

+ +

+For learning documents and other resources, go to systemd +official website. +

+
+ +
+

systemd for Debian

+
+

+It's redundant to explain how to install and configure systemd in +Debian, when the Debian's wiki covers everything you need. +

+ +

+Visit https://wiki.debian.org/systemd +

+
+
+ + +
+

journalctl

+
+

+journalctl is meant to query the systemd journal. systemd's +journal is an aggregation of most important logs and events occurring +in your system. +

+ +

+In order for the normal user to access journalctl, you must add the +user to the systemd-journal group. +

+ +
+ +
usermod -a -G systemd-journal <your username>
+
+
+ +

+Now reboot systemd: +

+ +
+ +
systemctl reboot
+
+
+
+
+ +
+

NetworkManager

+
+

+By default, NetworkManager.service should be part of the systemd lib +directory, and should be enabled. +

+ +

+You should be able to find the service units for NetworkManager in +/etc/systemd/system/ +

+ +
+ +
cat /etc/systemd/system/dbus-org.freedesktop.NetworkManager.service
+
+
+ +
+[Unit]
+Description=Network Manager
+
+[Service]
+Type=dbus
+BusName=org.freedesktop.NetworkManager
+ExecStart=/usr/sbin/NetworkManager --no-daemon
+# Suppress stderr to eliminate duplicated messages in syslog. NM calls openlog()
+# with LOG_PERROR when run in foreground. But systemd redirects stderr to
+# syslog by default, which results in logging each message twice.
+StandardError=null
+# NM doesn't want systemd to kill its children for it
+KillMode=process
+
+[Install]
+WantedBy=multi-user.target
+Alias=dbus-org.freedesktop.NetworkManager.service
+Also=NetworkManager-dispatcher.service
+
+ +
+ +
cat /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service
+
+
+ +
+[Unit]
+Description=Network Manager Script Dispatcher Service
+
+[Service]
+Type=dbus
+BusName=org.freedesktop.nm_dispatcher
+ExecStart=/usr/lib/NetworkManager/nm-dispatcher.action
+
+[Install]
+Alias=dbus-org.freedesktop.nm-dispatcher.service
+
+ +

+You should see that NetworkManager.service is enabled. +

+ +
+ +
systemctl status NetworkManager
+
+
+ +
+NetworkManager.service - Network Manager
+   Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled)
+   Active: active (running) since Thu 2014-08-07 08:51:25 PDT; 7min ago
+ Main PID: 1011 (NetworkManager)
+   CGroup: name=systemd:/system/NetworkManager.service
+           └─1011 /usr/sbin/NetworkManager --no-daemon
+
+Aug 07 08:51:24 raiser systemd[1]: Starting Network Manager...
+Aug 07 08:51:24 raiser NetworkManager[1011]: <info> NetworkManager (version 0.9.8.10) is starting...
+Aug 07 08:51:24 raiser NetworkManager[1011]: <info> Read config file /etc/NetworkManager/NetworkManager.conf
+Aug 07 08:51:24 raiser NetworkManager[1011]: <info> WEXT support is enabled
+Aug 07 08:51:25 raiser NetworkManager[1011]: SCPlugin-Ifupdown: init!
+Aug 07 08:51:25 raiser NetworkManager[1011]: SCPlugin-Ifupdown: update_system_hostname
+Aug 07 08:51:25 raiser NetworkManager[1011]: SCPluginIfupdown: management mode: unmanaged
+Aug 07 08:51:25 raiser NetworkManager[1011]: SCPlugin-Ifupdown: devices added (path: /sys/devices/pci0000:00/0000:00:19.0/net/eth0, iface: eth0)
+Aug 07 08:51:25 raiser NetworkManager[1011]: SCPlugin-Ifupdown: device added (path: /sys/devices/pci0000:00/0000:00:19.0/net/eth0, iface: eth0): no ifupdown configuration found.
+Aug 07 08:51:25 raiser NetworkManager[1011]: SCPlugin-Ifupdown: devices added (path: /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/net/wlan0, iface: wlan0)
+Aug 07 08:51:25 raiser NetworkManager[1011]: SCPlugin-Ifupdown: device added (path: /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/net/wlan0, iface: wlan0): no ifupdown configuration found.
+Aug 07 08:51:25 raiser NetworkManager[1011]: SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/lo, iface: lo)
+Aug 07 08:51:25 raiser NetworkManager[1011]: SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/lo, iface: lo): no ifupdown configuration found.
+Aug 07 08:51:25 raiser NetworkManager[1011]: SCPlugin-Ifupdown: end _init.
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> Loaded plugin ifupdown: (C) 2008 Canonical Ltd.  To report bugs please use the NetworkManager mailing list.
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> Loaded plugin keyfile: (c) 2007 - 2010 Red Hat, Inc.  To report bugs please use the NetworkManager mailing list.
+Aug 07 08:51:25 raiser NetworkManager[1011]: Ifupdown: get unmanaged devices count: 0
+Aug 07 08:51:25 raiser NetworkManager[1011]: SCPlugin-Ifupdown: (35959328) ... get_connections.
+Aug 07 08:51:25 raiser NetworkManager[1011]: SCPlugin-Ifupdown: (35959328) ... get_connections (managed=false): return empty list.
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto wutangclanaintnothingtofuckwithn ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto wutangclanaintnothingtofuckwithn'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto The Box Factory ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto The Box Factory'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto noisebridge ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto noisebridge'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto #SFO FREE WIFI ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto #SFO FREE WIFI'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto GoogleGuest ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto GoogleGuest'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto CoupaSM ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto CoupaSM'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Wired connection 1 ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Wired connection 1'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto wutangn ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto wutangn'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto MonkeyBrains.net ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto MonkeyBrains.net'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto Coupa ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto Coupa'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto NETGEAR-5G ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto NETGEAR-5G'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto wutangclanaintnothingtofuckwith ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto wutangclanaintnothingtofuckwith'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto hearth ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto hearth'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto Sycamore Public ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto Sycamore Public'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto _San_Francisco_Free_WiFi ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto _San_Francisco_Free_WiFi'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing CoupaHQ ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'CoupaHQ'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto cafelabohemesanfrancisco ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto cafelabohemesanfrancisco'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto SRGNC-GUEST ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto SRGNC-GUEST'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Stormpath Guest ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Stormpath Guest'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto Premium ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto Premium'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto JWAFREEWIFI ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto JWAFREEWIFI'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto Automattic-Guest ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto Automattic-Guest'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto CustomerSuccess ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto CustomerSuccess'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto CoffeeBarU ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto CoffeeBarU'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto hearth-new ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto hearth-new'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto Webroot-Guest ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto Webroot-Guest'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto UCBX ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto UCBX'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto BLUEFIG-guest ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto BLUEFIG-guest'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto .Workshop_FREE. ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto .Workshop_FREE.'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto protectyourneck ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto protectyourneck'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto AB4966 ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto AB4966'
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile: parsing Auto .FreeWiFibyYahoo! ...
+Aug 07 08:51:25 raiser NetworkManager[1011]: keyfile:     read connection 'Auto .FreeWiFibyYahoo!'
+Aug 07 08:51:25 raiser NetworkManager[1011]: Ifupdown: get unmanaged devices count: 0
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> monitoring kernel firmware directory '/lib/firmware'.
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> monitoring ifupdown state file '/run/network/ifstate'.
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> rfkill1: found WiFi radio killswitch (at /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/ieee80211/phy0/rfkill1) (driver iwlwifi)
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> WiFi hardware radio set enabled
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> WiFi enabled by radio killswitch; enabled by state file
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> WWAN enabled by radio killswitch; enabled by state file
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> WiMAX enabled by radio killswitch; enabled by state file
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> Networking is enabled by state file
+Aug 07 08:51:25 raiser NetworkManager[1011]: <warn> failed to allocate link cache: (-26) Protocol mismatch
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> (eth0): carrier is OFF
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> (eth0): new Ethernet device (driver: 'e1000e' ifindex: 2)
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> (eth0): exported as /org/freedesktop/NetworkManager/Devices/0
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> (eth0): device state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> (eth0): bringing up device.
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> (eth0): preparing device.
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> (eth0): deactivating device (reason 'managed') [2]
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> (wlan0): using nl80211 for WiFi device control
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> (wlan0): driver supports Access Point (AP) mode
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> (wlan0): new 802.11 WiFi device (driver: 'iwlwifi' ifindex: 3)
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> (wlan0): exported as /org/freedesktop/NetworkManager/Devices/1
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> (wlan0): device state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> (wlan0): bringing up device.
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> (wlan0): preparing device.
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> (wlan0): deactivating device (reason 'managed') [2]
+Aug 07 08:51:25 raiser NetworkManager[1011]: <warn> /sys/devices/virtual/net/lo: couldn't determine device driver; ignoring...
+Aug 07 08:51:25 raiser NetworkManager[1011]: <warn> /sys/devices/virtual/net/lo: couldn't determine device driver; ignoring...
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> ModemManager available in the bus
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> wpa_supplicant started
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> (wlan0) supports 5 scan SSIDs
+Aug 07 08:51:25 raiser NetworkManager[1011]: <warn> Trying to remove a non-existant call id.
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> (wlan0): supplicant interface state: starting -> ready
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> (wlan0): device state change: unavailable -> disconnected (reason 'supplicant-available') [20 30 42]
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> (wlan0): supplicant interface state: ready -> inactive
+Aug 07 08:51:25 raiser NetworkManager[1011]: <info> (wlan0) supports 5 scan SSIDs
+
+
+
+ + + +
+

MySQL

+
+

+The MySQL server debian package doesn't contain a unit service for +it. +

+ +

+Here's a version that I wrote myself: +

+ +
+ +
cat /etc/systemd/system/mysqld.service
+
+
+ +
+[Unit]
+Description=MySQL Server
+After=network.target
+
+[Service]
+PermissionsStartOnly=true
+ExecStartPre=/bin/mkdir /var/run/mysqld
+ExecStartPre=/bin/chown -R mysql:mysql /var/run/mysqld
+User=mysql
+Group=mysql
+WorkingDirectory=/usr
+ExecStart=/usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf --datadir=/var/lib/mysql --socket=/var/run/mysqld/mysqld.sock
+
+[Install]
+WantedBy=multi-user.target
+
+
+
+ + +
+

TLP

+
+

+TLP's Debian package by default, doesn't provide +/etc/systemd/system/tlp.service and +/etc/systemd/system/tlp-sleep.service files for systemd +

+ +

+You can grab this from the TLP's upstream git repository like I did. +

+ +
+ +
cat /etc/systemd/system/tlp.service
+
+
+ +
+# tlp - systemd startup/shutdown service
+#
+# Copyright (c) 2014 Thomas Koch <linrunner at gmx.net>
+# This software is licensed under the GPL v2 or later.
+
+[Unit]
+Description=TLP system startup/shutdown
+After=multi-user.target
+Before=shutdown.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/sbin/tlp init start
+ExecStop=/usr/sbin/tlp init stop
+
+[Install]
+WantedBy=multi-user.target
+
+ +
+ +
cat /etc/systemd/system/tlp-sleep.service
+
+
+ +
+# tlp - systemd suspend/resume service
+#
+# Copyright (c) 2014 Thomas Koch <linrunner at gmx.net>
+# This software is licensed under the GPL v2 or later.
+
+[Unit]
+Description=TLP suspend/resume
+Before=sleep.target
+StopWhenUnneeded=yes
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/sbin/tlp suspend
+ExecStop=/usr/sbin/tlp resume
+
+[Install]
+WantedBy=sleep.target
+
+ +

+After that enable both services. +

+ +
+ +
systemctl enable tlp.service
+
+
+ +
+ +
systemctl enable tlp-sleep.service
+
+
+ +

+Now check that everything is working properly. +

+ +
+ +
systemctl status tlp.service
+
+
+ +
+tlp.service - TLP system startup/shutdown
+   Loaded: loaded (/etc/systemd/system/tlp.service; enabled)
+   Active: active (exited) since Thu 2014-08-07 08:51:26 PDT; 7min ago
+  Process: 1602 ExecStart=/usr/sbin/tlp init start (code=exited, status=0/SUCCESS)
+
+Aug 07 08:51:26 raiser tlp[1602]: Loading tp-smapi kernel module...done.
+Aug 07 08:51:26 raiser tlp[1602]: Setting battery charge thresholds...done.
+
+
+
+ +
+

acpid

+
+

+systemd and acpid with acpi-support both offer the same +capabilities for events triggered by hardware, specifically, the ACPI +calls. For example, closing the lid to suspend a laptop. +

+ +

+For instance, by default, the closing the lid will trigger acpid to +call the suspend state of pm-utils, but at the same time +systemd recognizes the closing action which in the same case will +trigger suspend actions in systemd. +

+ +

+In order to avoid these, we have to disable the action in either +acpid or systemd. +

+
+ +
  • Disable Lid action
    +

    +To disable this in acpid, modify /etc/acpi/events/lidbtn, and +comment all of the lines. +

    + +
    + +
    cat /etc/acpi/events/lidbtn
    +
    +
    + +
    +# /etc/acpi/events/lidbtn
    +# Called when the user closes or opens the lid
    +
    +#event=button[ /]lid
    +#action=/etc/acpi/lid.sh
    +
    + + +

    +To disable this in systemd, modify /etc/systemd/logind.conf, and +change the key HandleLidSwitch to ignore: +

    + +
    +HandleLidSwitch=ignore
    +
    +
    +
  • + +
  • Enable Lid suspend action in systemd
    +

    +To enable suspend on closing the laptop lid, disable the acpid's +like mentioned above. Change the key HandleLidSwitch to suspend in +/etc/systemd/logind.conf: +

    + +
    +HandleLidSwitch=suspend
    +
    +
    +
+
+
+
+
+
+

Date: 2014-05-07

+

Author: Carlos Sosa

+

Created: 2014-08-07 Thu 08:58

+

Emacs 24.3.92.1 (Org mode 8.2.7b)

+

Validate

+
+ + -- cgit v1.3-2-g0d8e