bc-bd.org

Not a blog

Kvm, Trim and the Discard Operation Is Not Supported

Getting the discard operation is not supported when running fstrim on a kvm guest? Make sure to

  • use virtio-scsi
  • pass discard='unmap' to the disk driver
  • use a machine type >= 2.1, e.g. pc-i440fx-2.3

Stretch Without Systemd

Following http://without-systemd.org/wiki/index.php/Debian_Stretch and adding a pin on *systemd* will lead to libvirt-daemon-system being uninstalled though (dependency chain: libvirt-daemon-system -> polkit -> libpam-systemd).

It is possible to build rebuild polkit without systemd, see https://github.com/bidaian/no-systemd, but that means tracking another package diversion.

An alternative solution is to just not use systemd as init, put keep the other packages installed:

apt-get install sysvinit-core sysvinit-utils
apt-get remove --purge systemd-sysv

Windows 7 Qlx BSOD

A recent Windows 7 installation started crashing with a Bluescreen of Death after installing the qlx driver inside the guest. Switching back to the vga model allowed me to boot it again:

<video>
  <model type='vga' vram='16384' heads='1' primary='yes'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>

Install Terminator on a Minimal CentOS 7

To remotly start terminator on a minimal CentOS install these packages:

yum install terminator xauth dbus-x11.x86_64 dejavu-sans-fonts.noarch dejavu-sans-mono-fonts.noarch

Without the font packages you’ll only see boxes.

Ssh X11 Forwarding Fails on IPv4 Only Host

If ssh -X fails with X11 forwarding request failed on channel 0 when connecting to an IPv4 only host, check your /etc/ssh/sshd_config for AddressFamily inet:

Specifies which address family should be used by sshd(8). Valid arguments are “any”, “inet” (use IPv4 only), or “inet6” (use IPv6 only). The default is “any”.

PuppetDB Start Failing With ‘java.lang.AssertionError: Assert Failed: (Keyword? Kw)’

Is your puppetdb failing with something like this:

java.lang.AssertionError: Assert failed: (keyword? kw)
 at puppetlabs.kitchensink.core$without_ns.invokeStatic (core.clj:613)
    puppetlabs.kitchensink.core$without_ns.invoke (core.clj:613)
    puppetlabs.trapperkeeper.core$main.invokeStatic (core.clj:175)
    puppetlabs.trapperkeeper.core$main.doInvoke (core.clj:159)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invokeStatic (core.clj:646)
    clojure.core$apply.invoke (core.clj:641)
    puppetlabs.puppetdb.cli.services$_main.invokeStatic (services.clj:468)
    puppetlabs.puppetdb.cli.services$_main.doInvoke (services.clj:465)
    ...

make sure your postgresql setup works.

Building (Semi-)static Subversion 1.9 for EPEL 7

Setup mock:

mock -r epel-7-x86_64 --rootdir /tmp/mock --init
mock -r epel-7-x86_64 --rootdir /tmp/mock -i yum
mock -r epel-7-x86_64 --rootdir /tmp/mock --shell

Install dependencies:

yum install wget scons apr-devel apr-util-devel zlib-devel openssl-devel sqlite-devel perl-ExtUtils-Embed autoconf libtool

Download and build serf:

cd /tmp
wget https://www.apache.org/dist/serf/serf-1.3.9.tar.bz2
tar -xjf serf-1.3.9.tar.bz2
cd serf-1.3.9
scons

Download and build subversion:

cd /tmp
wget http://ftp.heikorichter.name/apache/subversion/subversion-1.9.7.tar.bz2
tar -xjf subversion-1.9.7.tar.bz2
cd subversion-1.9.7
./autogen.sh
./configure --disable-shared --enable-static --with-serf=/tmp/serf-1.3.9 CPPFLAGS="-I/tmp/serf-1.3.9" LDFLAGS="/tmp/serf-1.3.9/libserf-1.a"

Edit Makefile and change

SVN_SERF_LIBS = -lserf-1

into

SVN_SERF_LIBS =

Build

make -j5 svn

You will get a couple of unresolved symbols errors e.g.:

/tmp/subversion-1.9.7/subversion/libsvn_ra_serf/.libs/libsvn_ra_serf-1.a(serf.o): In function `ra_serf_get_description':
/tmp/subversion-1.9.7/subversion/libsvn_ra_serf/serf.c:75: undefined reference to `serf_lib_version'
...

Rerun the last command, but append /tmp/serf-1.3.9/libserf-1.a -lssl -lcrypto

The result is not a completely static build

# ldd ./svn | grep serf
#

but it contains serf:

# ./subversion/svn/svn --version
    svn, version 1.9.7 (r1800392)
    ...
    * ra_serf : Module for accessing a repository via WebDAV protocol using serf.
      - using serf 1.3.9 (compiled with 1.3.9)
      - handles 'http' scheme
      - handles 'https' scheme
    ...

Debian Jessie and Mock

I recently needed to build a CentOS package on Debian Jessie, however mock from jessie-backports gave me this error:

ImportError: No module named six

Turns out, I was missing the package python3-six.