stafwag Blog

staf wagemakers blog

Lxc Templates in Fedora 20

I’m a big fan of containers and used them a lot on Solaris and jails on Freebsd. Containers/jails are the fastest way to spinup an new system and the easiest way to isolate services.

As always with virtualization you’ve to careful with sharing systems or containers that doesn’t below to the same customer or service on the same physical machine since you’re never sure which traces are left behind in the memory etc.

Linux containers are getting more popular since the release of docker

When I tried to create a few containers on Fedora 20, the first attempt (a debian container) wasn’t an success.

On a newly create debian container networking didn’t work.

First debian container

Creating the container

1
2
3
4
5
6
7
8
9
[root@vicky ~]# lxc-create -n mydebian -t debian

lxc-create: No config file specified, using the default config /etc/lxc/default.conf
debootstrap is /sbin/debootstrap
Checking cache download in /var/cache/lxc/debian/rootfs-squeeze-i386 ... 
Copying rootfs to /var/lib/lxc/mydebian/rootfs...Generating locales (this might 
< snip >
'debian' template installed
'mydebian' created

Booting

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
[root@vicky ~]# lxc-start -n mydebian
INIT: version 2.88 booting
Using makefile-style concurrent boot in runlevel S.
Cleaning up ifupdown....
Setting up networking....
Activating lvm and md swap...done.
Checking file systems...fsck from util-linux-ng 2.17.2
done.
Mounting local filesystems...done.
Activating swapfile swap...done.
Cleaning up temporary files....
Configuring network interfaces...ifup: failed to open statefile /etc/network/run/ifstate: No such file or directory
failed.
Setting kernel variables ...done.
Cleaning up temporary files....
INIT: Entering runlevel: 3
Using makefile-style concurrent boot in runlevel 3.
Starting OpenBSD Secure Shell server: sshd.

Debian GNU/Linux 6.0 mydebian console

mydebian login: root
Password: 
Last login: Tue Jun 21 08:05:41 UTC 2014 on console
Linux mydebian 3.14.5-200.fc20.i686 #1 SMP Mon Jun 21 08:13:19 UTC 2014 i686

Network isn’t working…

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@mydebian:~# ifconfig -a
eth0      Link encap:Ethernet  HWaddr c2:71:98:d8:8f:c3  
          inet6 addr: fe80::c071:98ff:fed8:8fc3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:908 (908.0 B)  TX bytes:738 (738.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@mydebian:~# ifup eth0
ifup: failed to open statefile /etc/network/run/ifstate: No such file or directory
root@mydebian:~# 
root@mydebian:~# cat /etc/network/interfaces 
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
root@mydebian:~# 

Fedora container

A Fedora container worked better.

Creating the fedora container

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
root@vicky ~]# lxc-create -n myfedora -t fedora

lxc-create: No config file specified, using the default config /etc/lxc/default.conf
Host CPE ID from /etc/os-release: cpe:/o:fedoraproject:fedora:20
Checking cache download in /var/cache/lxc/fedora/i686/20/rootfs ... 
Downloading fedora minimal ...
Fetching rpm name from http://be.mirror.eurid.eu/fedora/linux/releases/20/Everything/i386/os//Packages/f...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   290  100   290    0     0    904      0 --:--:-- --:--:-- --:--:--   903
  0     0    0  145k    0     0  47212      0 --:--:--  0:00:03 --:--:-- 58525

<snip>
Updated:
  fedora-release.noarch 0:20-3                                                  

Complete!
Download complete.
Copy /var/cache/lxc/fedora/i686/20/rootfs to /var/lib/lxc/myfedora/rootfs ... 
Copying rootfs to /var/lib/lxc/myfedora/rootfs ...setting root passwd to root
installing fedora-release package
Package fedora-release-20-3.noarch already installed and latest version
Nothing to do
unlink: cannot unlink ‘/var/lib/lxc/myfedora/rootfs/etc/systemd/system/default.target’: No such file or directory
container rootfs and config created
'fedora' template installed
'myfedora' created
[root@vicky ~]# 

Booting

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[root@vicky ~]# lxc-start -n myfedora
systemd 208 running in system mode. (+PAM +LIBWRAP +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ)
Detected virtualization 'lxc'.

Welcome to Fedora 20 (Heisenbug)!

Set hostname to <myfedora>.
[  OK  ] Reached target Remote File Systems.
[  OK  ] Listening on Delayed Shutdown Socket.
[  OK  ] Created slice Root Slice.
[  OK  ] Created slice User and Session Slice.
[  OK  ] Started Login Service.
< snip >
[  OK  ] Reached target Multi-User System.

Fedora release 20 (Heisenbug)
Kernel 3.14.5-200.fc20.i686 on an i686 (console)

myfedora login: root
Password: 
Last login: Wed Jun 21 09:12:42 on console

Networking

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
[root@myfedora ~]# ping 8.8.8.8
connect: Network is unreachable
[root@myfedora ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
16: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 5a:89:44:04:99:2b brd ff:ff:ff:ff:ff:ff
    inet6 fe80::5889:44ff:fe04:992b/64 scope link 
       valid_lft forever preferred_lft forever
[root@myfedora ~]# ifup eth0

Determining IP information for eth0... done.
[root@myfedora ~]# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=49 time=113 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=49 time=123 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=49 time=123 ms
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 113.751/120.096/123.408/4.488 ms
[root@myfedora ~]# 

New templates

Since I wanted a Debian container I clone the lxc git on github and copied the templates.

Getting the templates

1
2
3
4
5
6
7
8
9
10
[staf@vicky github]$ git clone https://github.com/lxc/lxc 
Cloning into 'lxc'...
remote: Reusing existing pack: 17997, done.
remote: Counting objects: 17, done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 18014 (delta 9), reused 0 (delta 0)
Receiving objects: 100% (18014/18014), 9.14 MiB | 77.00 KiB/s, done.
Resolving deltas: 100% (11555/11555), done.
Checking connectivity... done.
[staf@vicky github]$ 

Configure

Create the configure script and it dependencies

1
2
3
4
5
6
7
8
[staf@vicky lxc]$ autoreconf -i
configure.ac:31: installing 'config/compile'
configure.ac:30: installing 'config/config.guess'
configure.ac:30: installing 'config/config.sub'
configure.ac:29: installing 'config/install-sh'
configure.ac:29: installing 'config/missing'
src/lua-lxc/Makefile.am: installing 'config/depcomp'
[staf@vicky lxc]$ 

Run configure

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
[staf@vicky lxc]$ ./configure 
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
<snip>
Documentation:
 - examples: yes
 - API documentation: no
 - user documentation: no

Debugging:
 - tests: no
 - mutex debugging: no

Paths:
 - Logs in configpath: no
[staf@vicky lxc]$ 

Copy the templates

Copy the newly created templates

1
2
3
4
5
6
7
8
9
[staf@vicky templates]$ shopt -s extglob
[staf@vicky templates]$ 
[staf@vicky templates]$ ls !(*\.in|Makefile*)
lxc-alpine     lxc-centos    lxc-fedora        lxc-oracle  lxc-ubuntu-cloud
lxc-altlinux   lxc-cirros    lxc-gentoo        lxc-plamo
lxc-archlinux  lxc-debian    lxc-openmandriva  lxc-sshd
lxc-busybox    lxc-download  lxc-opensuse      lxc-ubuntu
[staf@vicky templates]$ sudo cp !(*\.in|Makefile*)  /usr/share/lxc/templates[sudo] password for staf: 
[staf@vicky templates]$ 

Debian container second try…

And tried to create the debian container again.

1
2
3
4
5
6
7
8
9
10
11
[root@vicky ~]# lxc-ls --fancy
NAME      STATE    IPV4  IPV6  
-----------------------------
mydebian  STOPPED  -     -     
myfedora  STOPPED  -     -     
[root@vicky ~]# lxc-destroy -n mydebian
[root@vicky ~]# lxc-ls --fancy
NAME      STATE    IPV4  IPV6  
-----------------------------
myfedora  STOPPED  -     -     
[root@vicky ~]# 

Creating the container

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
[root@vicky ~]# lxc-create -n mydebian -t debian

lxc-create: No config file specified, using the default config /etc/lxc/default.conf
debootstrap is /sbin/debootstrap
Checking cache download in /usr/local/var/cache/lxc/debian/rootfs-wheezy-i386 ... 
Downloading debian minimal ...
W: Cannot check Release signature; keyring file not available /usr/share/keyrings/debian-archive-keyring.gpg
I: Retrieving Release 
I: Validating Packages 
I: Resolving dependencies of required packages...
I: Resolving dependencies of base packages...
I: Found additional required dependencies: insserv libbz2-1.0 libdb5.1 libsemanage-common libsemanage1 libslang2 libustr-1.0-1 
I: Found additional base dependencies: adduser debian-archive-keyring gnupg gpgv isc-dhcp-common libapt-pkg4.12 libbsd0 libclass-isa-perl libedit2 libgdbm3 libgssapi-krb5-2 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libncursesw5 libprocps0 libreadline6 libssl1.0.0 libstdc++6 libswitch-perl libusb-0.1-4 libwrap0 openssh-client perl perl-modules procps readline-common 
I: Checking component main on http://cdn.debian.net/debian...
I: Validating libacl1 2.2.51-8
I: Validating adduser 3.113+nmu3
<snip>
I: Unpacking debconf...
I: Unpacking debconf-i18n...
I: Unpacking debianutils...
I: Unpacking diffutils...
I: Unpacking dpkg...
I: Unpacking e2fslibs:i386...
<snip>
I: Configuring apt...
I: Configuring openssh-client...
I: Configuring openssh-server...
I: Configuring perl-modules...
I: Configuring libswitch-perl...
I: Configuring perl...
I: Configuring libui-dialog-perl...
I: Base system installed successfully.
Download complete.
Copying rootfs to /var/lib/lxc/mydebian/rootfs...Generating locales (this might take a while)...
  en_US.UTF-8... done
Generation complete.
update-rc.d: using dependency based boot sequencing
update-rc.d: using dependency based boot sequencing
update-rc.d: using dependency based boot sequencing
update-rc.d: using dependency based boot sequencing
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
Creating SSH2 ECDSA key; this may take some time ...
invoke-rc.d: policy-rc.d denied execution of restart.
Timezone in container is not configured. Adjust it manually.
Root password is 'root', please change !
'debian' template installed
'mydebian' created
[root@vicky ~]# 

Booting

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
[root@vicky ~]# lxc-start -n mydebian
INIT: version 2.88 booting
Using makefile-style concurrent boot in runlevel S.
Cleaning up temporary files... /tmp /run /run/lock /run/shm.
Mount point '/dev/mqueue' does not exist. Skipping mount. ... (warning).
Mount point '/dev/hugepages' does not exist. Skipping mount. ... (warning).
Mount point '/sys/fs/cgroup/systemd' does not exist. Skipping mount. ... (warning).
Mount point '/sys/fs/cgroup/cpuset' does not exist. Skipping mount. ... (warning).
Mount point '/sys/fs/cgroup/cpu,cpuacct' does not exist. Skipping mount. ... (warning).
Mount point '/sys/fs/cgroup/memory' does not exist. Skipping mount. ... (warning).
Mount point '/sys/fs/cgroup/devices' does not exist. Skipping mount. ... (warning).
Mount point '/sys/fs/cgroup/freezer' does not exist. Skipping mount. ... (warning).
Mount point '/sys/fs/cgroup/net_cls' does not exist. Skipping mount. ... (warning).
Mount point '/sys/fs/cgroup/blkio' does not exist. Skipping mount. ... (warning).
Mount point '/sys/fs/cgroup/perf_event' does not exist. Skipping mount. ... (warning).
Filesystem type 'fuse.gvfsd-fuse' is not supported. Skipping mount. ... (warning).
Mount point '/run/media/staf/VBOXADDITIONS_4.3.12_93733' does not exist. Skipping mount. ... (warning).
Mount point '/var/lib/nfs/rpc_pipefs' does not exist. Skipping mount. ... (warning).
Mount point '/usr/lib/lxc/rootfs' does not exist. Skipping mount. ... (warning).
Mount point '/usr/lib/lxc/rootfs' does not exist. Skipping mount. ... (warning).
Mount point '/dev/console' does not exist. Skipping mount. ... (warning).
Activating lvm and md swap...done.
Checking file systems...fsck from util-linux 2.20.1
done.
Mounting local filesystems...done.

Debian GNU/Linux 7 mydebian console

mydebian login: root
Password: 
Linux mydebian 3.14.8-200.fc20.i686 #1 SMP Mon Jun 21 09:36:56 UTC 2014 i686

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

Networking….

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
root@mydebian:~# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:16:3e:34:d3:02  
          inet addr:192.168.122.198  Bcast:192.168.122.255  Mask:255.255.255.0
          inet6 addr: fe80::216:3eff:fe34:d302/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:32 errors:0 dropped:0 overruns:0 frame:0
          TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3312 (3.2 KiB)  TX bytes:1806 (1.7 KiB)

root@mydebian:~# ping 8.8.8.8
-bash: ping: command not found
root@mydebian:~# apt-cache search ping | grep util
2ping - Ping utility to determine directional packet loss
galax-extra - XQuery implementation with static typing - utilities
inetutils-ping - ICMP echo tool
iputils-arping - Tool to send ICMP echo requests to an ARP address
iputils-ping - Tools to test the reachability of network hosts
libescape-ruby - HTML/URI/shell escaping utilities for Ruby
mapnik-utils - C++/Python toolkit for developing GIS applications (utilities)
ruby-escape-utils - Faster string escaping routines for your web apps
root@mydebian:~# apt-get install inetutils-ping
Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed:
  inetutils-ping
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 169 kB of archives.
After this operation, 273 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  inetutils-ping
Install these packages without verification [y/N]? y
Get:1 http://cdn.debian.net/debian/ wheezy/main inetutils-ping i386 2:1.9-2 [169 kB]
Fetched 169 kB in 6s (26.4 kB/s)                                               
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package inetutils-ping.
(Reading database ... 9387 files and directories currently installed.)
Unpacking inetutils-ping (from .../inetutils-ping_2%3a1.9-2_i386.deb) ...
Setting up inetutils-ping (2:1.9-2) ...
root@mydebian:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=49 time=172.105 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=49 time=111.011 ms
^C--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 111.011/141.558/172.105/30.547 ms
root@mydebian:~# 

Size Matters, but …

"dell2713" Size matters, but … resolution and image quality are as import.

Since I was diagnosed with diabetes I have eyes issues things are getting better recently but I still needs glasses for reading etc.

My “no smoking” Piggy Bank was fat enough for some “eye candy”. I bought a Dell UltraSharp U2713HM a 27 inch WQHD (2560x1440) IPS display.

Compared to the others screens I used to work with the image quality is amazing and the higher resolution give so much more space.

Dell 2713HM images

Zfs on Fedora 20

With Fedora 20 being released a few weeks ago and no official zfsonlinux support for Fedora 20. It time to get zfs on linux working on Fedora 20.

Zfs on linux 2.6.2 required a custom DKMS package. Lucky the patches that were required for zfs on linux are already integrated into Fedora: http://negativo17.org/dkms-patches-for-zfs-on-linux-merged/

So lets try to build the rpm packages for Fedora 20 from the source.

Solaris Portability Layer (SPL)

clone the spl git repository
1
2
3
4
5
6
7
8
9
[root@vicky ]# cd /usr/src/zfsfed20
[root@vicky zfsfed20]# git clone https://github.com/zfsonlinux/spl.git
Cloning into 'spl'...
remote: Reusing existing pack: 6430, done.
remote: Total 6430 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6430/6430), 3.65 MiB | 60.00 KiB/s, done.
Resolving deltas: 100% (3750/3750), done.
Checking connectivity... done
[root@vicky zfsfed20]# 
create the configure script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[root@vicky spl]# autoreconf -i
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `config'.
libtoolize: copying file `config/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `config'.
libtoolize: copying file `config/libtool.m4'
libtoolize: copying file `config/ltoptions.m4'
libtoolize: copying file `config/ltsugar.m4'
libtoolize: copying file `config/ltversion.m4'
libtoolize: copying file `config/lt~obsolete.m4'
configure.ac:35: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
configure.ac:35: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
configure.ac:32: installing 'config/config.guess'
configure.ac:32: installing 'config/config.sub'
configure.ac:35: installing 'config/install-sh'
configure.ac:35: installing 'config/missing'
cmd/Makefile.am: installing 'config/depcomp'
[root@vicky spl]# 
run configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[root@vicky spl]# ./configure 
checking for gawk... gawk
checking metadata... git describe
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... yes
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
config.status: executing depfiles commands

< snip >

config.status: executing libtool commands
[root@vicky spl]# 
build the packages
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
[root@vicky spl]# make rpm-utils rpm-dkms
make  pkg="spl" \
  def='--define "build_src_rpm 1" ' srpm-common
make[1]: Entering directory `/usr/src/zfsfed20/spl'
make  dist-gzip am__post_remove_distdir='@:'
make[2]: Entering directory `/usr/src/zfsfed20/spl'
if test -d "spl-0.6.2"; then find "spl-0.6.2" -type d ! -perm -200 -exec chmod u+w {} ';' && rm -rf "spl-0.6.2" || { sleep 5 && rm -rf "spl-0.6.2"; }; else :; fi
test -d "spl-0.6.2" || mkdir "spl-0.6.2"
 (cd include && make  top_distdir=../spl-0.6.2 distdir=../spl-0.6.2/include \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/usr/src/zfsfed20/spl/include'
 (cd fs && make  top_distdir=../../spl-0.6.2 distdir=../../spl-0.6.2/include/fs \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[4]: Entering directory `/usr/src/zfsfed20/spl/include/fs'
make[4]: Leaving directory `/usr/src/zfsfed20/spl/include/fs'

< snip >

+ umask 022
+ cd /tmp/spl-build-root-CJV0xR9u/BUILD
+ cd spl-0.6.2
+ '[' /tmp/spl-build-root-CJV0xR9u/BUILDROOT/spl-dkms-0.6.2-22_gd58a99a.fc20.x86_64 '!=' / ']'
+ rm -rf /tmp/spl-build-root-CJV0xR9u/BUILDROOT/spl-dkms-0.6.2-22_gd58a99a.fc20.x86_64
+ exit 0
Executing(--clean): /bin/sh -e /tmp/spl-build-root-CJV0xR9u/TMP/rpm-tmp.E1YvyO
+ umask 022
+ cd /tmp/spl-build-root-CJV0xR9u/BUILD
+ rm -rf spl-0.6.2
+ exit 0
make[1]: Leaving directory `/usr/src/zfsfed20/spl'
[root@vicky spl]# ls
aclocal.m4      config         copy-builtin  libtool      META             scripts                                spl_config.h.in                                  spl.release.in
AUTHORS         config.log     COPYING       Makefile     module           spl-0.6.2-22_gd58a99a.fc20.src.rpm     spl-debuginfo-0.6.2-22_gd58a99a.fc20.x86_64.rpm  stamp-h1
autogen.sh      config.status  DISCLAIMER    Makefile.am  patches          spl-0.6.2-22_gd58a99a.fc20.x86_64.rpm  spl-dkms-0.6.2-22_gd58a99a.fc20.noarch.rpm
autom4te.cache  configure      include       Makefile.in  README.markdown  spl-0.6.2.tar.gz                       spl-dkms-0.6.2-22_gd58a99a.fc20.src.rpm
cmd             configure.ac   lib           man          rpm              spl_config.h                           spl.release
[root@vicky spl]# 
install the packages
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[root@vicky spl]# rpm -Uvh spl-0.6.2-22_gd58a99a.fc20.x86_64.rpm spl-dkms-0.6.2-22_gd58a99a.fc20.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:spl-dkms-0.6.2-22_gd58a99a.fc20  ################################# [ 25%]
Removing old spl-0.6.2 DKMS files...

------------------------------
Deleting module version: 0.6.2
completely from the DKMS tree.
------------------------------
Done.
Loading new spl-0.6.2 DKMS files...
First Installation: checking all kernels...
Building only for 3.11.10-301.fc20.x86_64
Module build for the currently running kernel was skipped since the
kernel source for this kernel does not seem to be installed.
   2:spl-0.6.2-22_gd58a99a.fc20       ################################# [ 50%]
Cleaning up / removing...
   3:spl-0.6.2-1.el6                  ################################# [ 75%]

------------------------------
Deleting module version: 0.6.2
completely from the DKMS tree.
------------------------------
Done.
   4:spl-dkms-0.6.2-1.el6             ################################# [100%]
[root@vicky spl]# 

zfsonlinux

clone the zfs git repository
1
2
3
4
5
6
7
8
9
10
11
12
[root@vicky ]# cd /usr/src/zfsfed20
[root@vicky ~]# cd /usr/src/zfsfed20/
[root@vicky zfsfed20]# git clone https://github.com/zfsonlinux/zfs.git
Cloning into 'zfs'...
remote: Reusing existing pack: 80616, done.
remote: Counting objects: 47, done.
remote: Compressing objects: 100% (41/41), done.
remote: Total 80663 (delta 15), reused 20 (delta 6)
Receiving objects: 100% (80663/80663), 18.05 MiB | 105.00 KiB/s, done.
Resolving deltas: 100% (55857/55857), done.
Checking connectivity... done
[root@vicky zfsfed20]# 
create the configure script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[root@vicky zfs]# autoreconf -i
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `config'.
libtoolize: copying file `config/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `config'.
libtoolize: copying file `config/libtool.m4'
libtoolize: copying file `config/ltoptions.m4'
libtoolize: copying file `config/ltsugar.m4'
libtoolize: copying file `config/ltversion.m4'
libtoolize: copying file `config/lt~obsolete.m4'
configure.ac:41: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
configure.ac:41: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
configure.ac:38: installing 'config/config.guess'
configure.ac:38: installing 'config/config.sub'
configure.ac:41: installing 'config/install-sh'
configure.ac:41: installing 'config/missing'
cmd/mount_zfs/Makefile.am: installing 'config/depcomp'
[root@vicky zfs]# 
run configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
[root@vicky zfs]# ./configure 
checking for gawk... gawk
checking metadata... git describe
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... yes
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes

< snip >

config.status: creating rpm/generic/zfs-kmod.spec
config.status: creating rpm/generic/zfs-dkms.spec
config.status: creating zfs-script-config.sh
config.status: creating zfs.release
config.status: creating zfs_config.h
config.status: executing depfiles commands
config.status: executing libtool commands
[root@vicky zfs]# 
build the packages
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[root@vicky zfs]# make rpm-utils rpm-dkms
make  pkg="zfs" \
  def='--define "build_src_rpm 1" ' srpm-common
make[1]: Entering directory `/usr/src/zfsfed20/zfs'
make  dist-gzip am__post_remove_distdir='@:'
make[2]: Entering directory `/usr/src/zfsfed20/zfs'
if test -d "zfs-0.6.2"; then find "zfs-0.6.2" -type d ! -perm -200 -exec chmod u+w {} ';' && rm -rf "zfs-0.6.2" || { sleep 5 && rm -rf "zfs-0.6.2"; }; else :; fi
test -d "zfs-0.6.2" || mkdir "zfs-0.6.2"

< snip >

make[4]: Leaving directory `/usr/src/zfsfed20/zfs/udev/rules.d'
make[3]: Leaving directory `/usr/src/zfsfed20/zfs/udev'
+ exit 0
Executing(--clean): /bin/sh -e /tmp/zfs-build-root-pzSqKnEH/TMP/rpm-tmp.2uRZ1C
+ umask 022
+ cd /tmp/zfs-build-root-pzSqKnEH/BUILD
+ rm -rf zfs-0.6.2
+ exit 0
make[1]: Leaving directory `/usr/src/zfsfed20/zfs'
[root@vicky zfs]# 
install the packages
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
[root@vicky zfsfed20]# yum localinstall zfs-0.6.2-158_gcbe8e61.fc20.x86_64.rpm zfs-dkms-0.6.2-158_gcbe8e61.fc20.noarch.rpm zfs-dracut-0.6.2-158_gcbe8e61.fc20.x86_64.rpm
Loaded plugins: langpacks, priorities, refresh-packagekit
Repository google-chrome is listed more than once in the configuration
Cannot open: zfs-0.6.2-158_gcbe8e61.fc20.x86_64.rpm. Skipping.
Cannot open: zfs-dkms-0.6.2-158_gcbe8e61.fc20.noarch.rpm. Skipping.
Cannot open: zfs-dracut-0.6.2-158_gcbe8e61.fc20.x86_64.rpm. Skipping.
Nothing to do
[root@vicky zfsfed20]# cd zfs
[root@vicky zfs]# yum localinstall zfs-0.6.2-158_gcbe8e61.fc20.x86_64.rpm zfs-dkms-0.6.2-158_gcbe8e61.fc20.noarch.rpm zfs-dracut-0.6.2-158_gcbe8e61.fc20.x86_64.rpm
Loaded plugins: langpacks, priorities, refresh-packagekit
Repository google-chrome is listed more than once in the configuration
Examining zfs-0.6.2-158_gcbe8e61.fc20.x86_64.rpm: zfs-0.6.2-158_gcbe8e61.fc20.x86_64
Marking zfs-0.6.2-158_gcbe8e61.fc20.x86_64.rpm to be installed
Examining zfs-dkms-0.6.2-158_gcbe8e61.fc20.noarch.rpm: zfs-dkms-0.6.2-158_gcbe8e61.fc20.noarch
Marking zfs-dkms-0.6.2-158_gcbe8e61.fc20.noarch.rpm to be installed
Examining zfs-dracut-0.6.2-158_gcbe8e61.fc20.x86_64.rpm: zfs-dracut-0.6.2-158_gcbe8e61.fc20.x86_64
Marking zfs-dracut-0.6.2-158_gcbe8e61.fc20.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package zfs.x86_64 0:0.6.2-158_gcbe8e61.fc20 will be installed
---> Package zfs-dkms.noarch 0:0.6.2-158_gcbe8e61.fc20 will be installed
---> Package zfs-dracut.x86_64 0:0.6.2-158_gcbe8e61.fc20 will be installed
--> Finished Dependency Resolution
http://negativo17.org/repos/HandBrake/epel-20/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.

Dependencies Resolved

===================================================================================================================================
 Package             Arch            Version                             Repository                                           Size
===================================================================================================================================
Installing:
 zfs                 x86_64          0.6.2-158_gcbe8e61.fc20             /zfs-0.6.2-158_gcbe8e61.fc20.x86_64                 2.2 M
 zfs-dkms            noarch          0.6.2-158_gcbe8e61.fc20             /zfs-dkms-0.6.2-158_gcbe8e61.fc20.noarch             11 M
 zfs-dracut          x86_64          0.6.2-158_gcbe8e61.fc20             /zfs-dracut-0.6.2-158_gcbe8e61.fc20.x86_64           13 k

Transaction Summary
===================================================================================================================================
Install  3 Packages

Total size: 13 M
Installed size: 13 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:
libvpx-1.2.0-2.git5e3439b.fc19.x86_64 is a duplicate with libvpx-1.2.0-2.fc20.i686
  Installing : zfs-dkms-0.6.2-158_gcbe8e61.fc20.noarch                                                                         1/3 
Loading new zfs-0.6.2 DKMS files...
First Installation: checking all kernels...
Building only for 3.12.7-300.fc20.x86_64
Building initial module for 3.12.7-300.fc20.x86_64
Done.

zavl:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.12.7-300.fc20.x86_64/extra/

znvpair.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.12.7-300.fc20.x86_64/extra/

zunicode.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.12.7-300.fc20.x86_64/extra/

zcommon.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.12.7-300.fc20.x86_64/extra/

zfs.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.12.7-300.fc20.x86_64/extra/

zpios.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.12.7-300.fc20.x86_64/extra/
Adding any weak-modules

Running the post_install script:

depmod...

DKMS: install completed.
  Installing : zfs-0.6.2-158_gcbe8e61.fc20.x86_64                                                                              2/3 
  Installing : zfs-dracut-0.6.2-158_gcbe8e61.fc20.x86_64                                                                       3/3 
  Verifying  : zfs-dracut-0.6.2-158_gcbe8e61.fc20.x86_64                                                                       1/3 
  Verifying  : zfs-0.6.2-158_gcbe8e61.fc20.x86_64                                                                              2/3 
  Verifying  : zfs-dkms-0.6.2-158_gcbe8e61.fc20.noarch                                                                         3/3 

Installed:
  zfs.x86_64 0:0.6.2-158_gcbe8e61.fc20   zfs-dkms.noarch 0:0.6.2-158_gcbe8e61.fc20   zfs-dracut.x86_64 0:0.6.2-158_gcbe8e61.fc20  

Complete!
[root@vicky zfs]# 

Enable zfs

1
2
3
4
5
[root@vicky zfs]# chkconfig zfs on
[root@vicky zfs]# systemctl zfs start
Unknown operation 'zfs'.
[root@vicky zfs]# systemctl start zfs
[root@vicky zfs]# 

Have fun…

Bash Saved My Day

I was creating an ugly quick-and-dirty script to setup the squid cache_dir automatically with puppet based on the diskspace and memory available.

When you are developing you sometimes forget to create backups and push it to git, and mistakes are around the corner.

Lucky bash saved my day!

1
2
3
$ ./create_cache_entries.sh  > create_cache_entries.sh 
-bash: ./create_cache_entries.sh: /bin/bash: bad interpreter: Text file busy
$ vi create_cache_entries.sh 

Yum Update on Fedora 19 and Zfs on Linux

"zfs on linux"

I use zfs on linux on fedora now.

The installation was pretty straightforward but after the installation of zfs yum update failed.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
[root@vicky etc]# yum update -y
Loaded plugins: langpacks, refresh-packagekit
Repository google-chrome is listed more than once in the configuration
fedora/19/x86_64/metalink                                                                                                                                                                   |  33 kB  00:00:00     
fedora                                                                                                                                                                                      | 4.2 kB  00:00:00     
fedora-chromium-stable                                                                                                                                                                      | 3.4 kB  00:00:00     
google-chrome                                                                                                                                                                               |  951 B  00:00:00     
rpmfusion-free                                                                                                                                                                              | 3.3 kB  00:00:00     
rpmfusion-free-updates                                                                                                                                                                      | 3.3 kB  00:00:00     
rpmfusion-nonfree                                                                                                                                                                           | 3.3 kB  00:00:00     
rpmfusion-nonfree-updates                                                                                                                                                                   | 3.3 kB  00:00:00     
updates/19/x86_64/metalink                                                                                                                                                                  |  30 kB  00:00:00     
updates                                                                                                                                                                                     | 4.4 kB  00:00:00     
zfs                                                                                                                                                                                         | 2.9 kB  00:00:00     
(1/6): fedora-chromium-stable/19/x86_64/primary_db                                                                                                                                          |  20 kB  00:00:00     
(2/6): zfs/19/x86_64/primary_db                                                                                                                                                             | 6.7 kB  00:00:00     
(3/6): updates/19/x86_64/group_gz                                                                                                                                                           | 385 kB  00:00:02     
(4/6): fedora/19/x86_64/group_gz                                                                                                                                                            | 384 kB  00:00:06     
(5/6): updates/19/x86_64/primary_db                                                                                                                                                         | 8.8 MB  00:01:53     
(6/6): fedora/19/x86_64/primary_db                                                                                                                                                          |  17 MB  00:03:34     
(1/10): google-chrome/primary                                                                                                                                                               | 1.9 kB  00:00:00     
(2/10): rpmfusion-free-updates/19/x86_64/primary_db                                                                                                                                         | 217 kB  00:00:01     
(3/10): rpmfusion-nonfree/19/x86_64/primary_db                                                                                                                                              | 149 kB  00:00:00     
(4/10): rpmfusion-free/19/x86_64/primary_db                                                                                                                                                 | 440 kB  00:00:03     
(5/10): rpmfusion-nonfree-updates/19/x86_64/primary_db                                                                              b                                                       |  97 kB  00:00:00     
(6/10): rpmfusion-nonfree-updates/19/x86_64/group_gz                                                                                                                                        |  990 B  00:00:05     
(7/10): rpmfusion-nonfree/19/x86_64/group_gz                                                                                                                                                |  993 B  00:00:07     
(8/10): rpmfusion-free/19/x86_64/group_gz                                                                                                                                                   | 1.6 kB  00:00:07     
(9/10): rpmfusion-free-updates/19/x86_64/group_gz                                                                                                                                           | 1.6 kB  00:00:07     
(10/10): updates/19/x86_64/updateinfo                                                                                                                                                       | 861 kB  00:00:09     
google-chrome                                                                                                                                                                                                  3/3
Resolving Dependencies
--> Running transaction check
---> Package dkms.noarch 0:2.2.0.3-14.zfs1.fc19 will be updated
--> Processing Dependency: dkms = 2.2.0.3-14.zfs1.fc19 for package: zfs-dkms-0.6.2-1.fc19.noarch
---> Package dkms.noarch 0:2.2.0.3-17.fc19 will be an update
--> Finished Dependency Resolution
Error: Package: zfs-dkms-0.6.2-1.fc19.noarch (@zfs)
           Requires: dkms = 2.2.0.3-14.zfs1.fc19
           Removing: dkms-2.2.0.3-14.zfs1.fc19.noarch (@zfs)
               dkms = 2.2.0.3-14.zfs1.fc19
           Updated By: dkms-2.2.0.3-17.fc19.noarch (updates)
               dkms = 2.2.0.3-17.fc19
           Available: dkms-2.2.0.3-5.fc19.noarch (fedora)
               dkms = 2.2.0.3-5.fc19
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
[root@vicky etc]# 

On another fedora system yum update worked fine, after reviewing the differences in the yum configuration it seems that yum-plugin-priorities wasn’t installed on my box. After installing yum-plugin-priorities

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
[root@vicky etc]# yum install yum-plugin-priorities
Loaded plugins: langpacks, refresh-packagekit
Repository google-chrome is listed more than once in the configuration
Resolving Dependencies
--> Running transaction check
---> Package yum-plugin-priorities.noarch 0:1.1.31-18.fc19 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================
 Package                                                     Arch                                         Version                                              Repository                                     Size
===================================================================================================================================================================================================================
Installing:
 yum-plugin-priorities                                       noarch                                       1.1.31-18.fc19                                       updates                                        22 k

Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package

Total download size: 22 k
Installed size: 28 k
Is this ok [y/d/N]: y
Downloading packages:
yum-plugin-priorities-1.1.31-18.fc19.noarch.rpm                                                                                                                                             |  22 kB  00:00:01     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : yum-plugin-priorities-1.1.31-18.fc19.noarch                                                                                                                                                     1/1 
  Verifying  : yum-plugin-priorities-1.1.31-18.fc19.noarch                                                                                                                                                     1/1 

Installed:
  yum-plugin-priorities.noarch 0:1.1.31-18.fc19                                                                                                                                                                    

Complete!
[root@vicky etc]# 

And make sure that the zfs has the priority

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[root@localhost etc]# cat yum.repos.d/zfs.repo
[zfs]
name=ZFS of Linux for Fedora $releasever
baseurl=http://archive.zfsonlinux.org/fedora/$releasever/$basearch/
enabled=1
priority=1
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-zfsonlinux
Requires:       yum-plugin-priorities

[zfs-source]
name=ZFS of Linux for Fedora $releasever - Source
baseurl=http://archive.zfsonlinux.org/fedora/$releasever/SRPMS/
enabled=0
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-zfsonlinux
[root@vicky etc]# 

yum update works again.

1
2
3
4
5
6
[root@vicky etc]# yum update -y
Loaded plugins: langpacks, priorities, refresh-packagekit
Repository google-chrome is listed more than once in the configuration
2 packages excluded due to repository priority protections
No packages marked for update
[root@vicky etc]# 

CGIpaf 1.3.4pre1 Released

This is the first pre-release of CGIpaf 1.3.4.

ChangeLog

CGIpaf 1.3.4pre1 (15 Sep 2013)
  • PAM is enabled on FreeBSD 7.3 or above
  • PAM is enabled on NetBSD 6.0 or above
  • xmalloc is updated to support systems with non GNU compatible malloc

CGIpaf 1.3.4pre1 is available at: http://www.wagemakers.be/english/programs/cgipaf

Download the tarball directly at: http://www.wagemakers.be/downloads/cgipaf/cgipaf-1.3.4pre1.tar.gz

Or at the the Git repository on github: https://github.com/stafwag/cgipaf

Running Kindle on GNU/Linux With Wine

"desktop"

I enjoy reading ebooks during my train trip to work on my nexus 7.

At home I prefer to read on my monitor since this is bigger.

Most of the time I use epub or pdf for reading, I bought a kindle version of a book from amazon assuming that I could read with amazon cloud reader at home.

Unfortunately this books is not compatible with cloud reader.

Proprietary_formats should be avoid, lesson learned (again).

To read my book at home I decided to give the windows version of kindle on wine a try

The installation was pretty straightforward on Fedora 19.

  • Install wine
1
2
[root@vicky ~]# yum install wine
Loaded plugins: langpacks, refresh-packagekit
  • Download Kindle for Window xp

Download it from: http://www.amazon.com/gp/feature.html/ref=kcp_pc_ln_ar?docId=1000426311

  • Run the installer
1
[swagemakers@vicky ~]$ wine ~/Downloads/KindleForPC-installer.exe 
  • Create kindle startup script
1
wine $HOME/.wine/drive_c/Program\ Files\ \(x86\)/Amazon/Kindle/Kindle.exe &

Happy reading

but

It’s better to only read ebooks in an open format