Tag Archives: software

Fedora 22 / CentOS 7 LXC fix systemd-journald process at 100%

Running a Fedora 21, Fedora 22 or a RHEL/CentOS 7 LXC container created by the lxc-create Fedora template can result in a 100% cpu loop for the systemd-journald process.

To fix this issue you must add lxc.kmsg = 0 to the container configuration. This can be done easily for all the Fedora templates in one shot:

echo "lxc.kmsg = 0" >> /usr/share/lxc/config/fedora.common.conf

See also:

Disable background updates on Fedora 21 / GNOME 3.14

If you use frequently a mobile internet connection with a monthly traffic limit, like me, you probably want control over automatic updates to avoid wasting traffic data.

GNOME 3.14 has a feature to automatically check for new updates using its gSoftware application. This feature can be disabled using the gsettings command line tool:

$ gsettings set org.gnome.software download-updates false

If you are not familiar with the terminal, also the graphical dconf-editor can be used.

First you need to install it:

$ sudo yum install dconf-editor

then, as normal user run it:

$ dconf-editor

now navigate to org.gnome.settings-daemon.software schema and un-tick the download-updates flag:

dconf-editor-updates

If you are using an older version of GNOME the schema is slight different. For Fedora 20/GNOME 3.10 you can take a look at this post http://worldofgnome.org/fedora-20-gnome-software-tips-and-tricks/.

HP MicroServer + RAC on Fedora 18

After upgrading my HP MicroServer with Remote Access Card from Fedora 17 to Fedora 18 (kernel-3.8.3-203.fc18) the RAC KVM console (remote and VGA) stopped to work with ‘out-of-range’ signal after:

[ 4.072580] [drm] Initialized drm 1.1.0 20060810
[ 4.104362] [drm] AST 1100 detected
[ 4.104500] [drm] dram 816000000 1 16 04000000
[ 4.104785] [TTM] Zone kernel: Available graphics memory: 2024944 kiB
[ 4.104913] [TTM] Initializing pool allocator
[ 4.105035] [TTM] Initializing DMA pool allocator
[ 10.522147] [sched_delayed] sched: RT throttling activated

The MicroServer RAC has an AST1100 video controller that currently doesn’t work very well with the Linux KMS (Kernel Mode Setting).

HP RAC KVM out of sync

 

So, to fix this issue you need to disable the KMS for the ast module:

  • Edit /etc/sysconfig/grub and at the end of the GRUB_CMDLINE_LINUX line add “ast.modeset=0 nomodeset
    GRUB_CMDLINE_LINUX="rd.md=0 rd.lvm=0 rd.dm=0 SYSFONT=latarcyrheb-sun16 rd.luks=0 KEYTABLE=it LANG=en_US.UTF-8 ast.modeset=0 nomodeset quiet"
  • Update the grub2 configuration
    grub2-mkconfig -o /boot/grub2/grub.cfg

OPTIONAL

  • Create /etc/modprobe.d/ast.conf with
    options ast modeset=0
  • Update the initramfs with dracut
    dracut --force

The bug has been reported at RedHat Bugzilla bug #926064.

References:
modinfo ast:

filename:       /lib/modules/3.8.3-203.fc18.x86_64/kernel/drivers/gpu/drm/ast/ast.ko
license:        GPL and additional rights
description:    AST
author:         Dave Airlie
alias:          pci:v00001A03d00002010sv*sd*bc03sc*i*
alias:          pci:v00001A03d00002000sv*sd*bc03sc*i*
depends:        drm,drm_kms_helper,ttm,i2c-core,i2c-algo-bit
intree:         Y
vermagic:       3.8.3-203.fc18.x86_64 SMP mod_unload
parm:           modeset:Disable/Enable modesetting (int)

SNMP hell (part 1): proxy to multiple devices

Last week I started working on the @GEMwrld HPC cluster at the Eidgenössische Technische Hochschule Zürich (ETH). The first task was to implement a kind of system monitoring and resource profiling. We already have a centralized graphical web console, built upon Observium, that collect resources statistics from all of our servers; usually we use SNMP v2c and, just for a few cases, the munin-node daemon (more on this will be in the part 2).

On the ETH cluster we have full access to every node, but the only incoming connections allowed by the ETH firewall are the SSH sessions (on port 22), so there’s a first problem: how can we transport SNMP data from the agent to the poller?

The answer is easy: SSH tunnel! But: usually SNMP uses UDP protocol; making an UDP SSH tunnel is a bit painful. To workaround this issue we had simply used the TCP protocol for SNMP.

First of all you need an SSH tunnel. In this case the tunnel is made by the monitoring server:

ssh -N monitoring@serverip -L 16000:localhost:161

The 161 is the remote TCP port to be forwarded and 16000 is the local port.

To use SNMP on TCP you have to modify the net-snmp daemon (snmpd) command line parameters (and not the snmpd config file); just edit /etc/default/snmpd (on ubuntu/debian, for RHEL the path is /etc/sysconfig/snmpd) as following:

SNMPDOPTS='-LF 6 /var/log/snmpd.log -u snmp -g snmp -I -smux -p /var/run/snmpd.pid TCP:161'

The important part is ‘TCP:161’. This will bind snmpd on every interface and on the TCP port 161 (the default SNMP port).
On the poller side you will need to configure your monitoring system to poll localhost:16000 with tcp protocol. For Observium you can add the host with:

./addhost.php localhost  community v2c 16000 tcp

Now there’s another problem. The Zurich GEM cluster is made by eight nodes and I do not want to start an SSH tunnel on every node. Then my idea was to use a kind of proxy on the control node:

eth_snmp

net-snmp helped me with the snmpd proxy capabilities: http://www.net-snmp.org/wiki/index.php/Snmpd_proxy

Continue reading

WordPress caching with nginx

As a part of my friend @zenkay post on his blog here it is a simple but efficient nginx configuration for proxying and caching an Apache + WordPress installation.

Assuming that:

  • nginx and Apache are on different nodes: if nginx and Apache are on the same machine is highly advised to serve static files directly from nginx;
  • static files expire header is managed by Apache (through mod_expires); if static stuff is served directly you need to specify the expire through nginx;
  • you have installed the WordPress Nginx proxy cache integrator;
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
server {
    # Listen IPv6 and IPv4 socket
    listen       [::]:80; #on Linux this means both IPv4 and IPv6
    # Name-based virtualhosts
    server_name  *.mydomain.com mydomain.com;
 
    # Add Cache-Status debug header on replies
    add_header X-Cache-Status $upstream_cache_status;
 
    # Set the vhost access-log
    access_log  /var/log/nginx/access-mydomain.log  main;
 
    location / {
 
        # Skip^1 caching variable init
        set $nocache 0;
        # Bypass^2 caching variable init
        set $purgecache 0;
 
        # Bypass^2 cache on no-cache (et al.) browser request
        if ($http_cache_control ~ "max-age=0")
            { set $purgecache 1; }
        if ($http_cache_control ~ "no-cache")
            { set $purgecache 1; }
        # Bypass^2 cache with custom header set on request
        if ($http_x_cache_purge ~* "true")
            { set $purgecache 1; }
        # Skip^1 caching when WordPress cookies are set
        if ($http_cookie ~* "comment_author_|wordpress_(?!test_cookie)|wp-postpass_" )
            { set $nocache 1; }
 
        # Cache pool
        proxy_cache             proxy-one;
        # Bypass^2 cache when $purgecache is set to 1.
        # Bypass means that content is served fresh and the cache is updated
        proxy_cache_bypass      $purgecache;
        # Skip^1 caching when $nocache is set to 1
        # Do not cache when browsing frontend as logged user
        proxy_no_cache          $nocache;
        # Define the cache resource identifier. Be careful to add $nocache
        proxy_cache_key         "$scheme$http_host$request_uri$args$nocache";
        proxy_connect_timeout   10;
        proxy_read_timeout      10;
        # use stale cache on backend fault
        proxy_cache_use_stale   error timeout invalid_header updating http_500 http_502 http_503 http_504;
        proxy_cache_valid       200 302 15m;
        proxy_cache_valid       404 1m;
        proxy_set_header        Host             $host;
        proxy_set_header        X-Real-IP        $remote_addr;
        proxy_set_header        X-Forwarded-For  $proxy_add_x_forwarded_for;
        proxy_pass              http://apache_remote_ip;
    }
 
    location ~* \/blog\/wp\-.*\.php|\/blog\/wp\-admin {
        proxy_cache             off;
        proxy_pass              http://apache_remote_ip;
    }
 
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
 
}

1^ see: http://wiki.nginx.org/HttpProxyModule#proxy_no_cache
2^ see: http://wiki.nginx.org/HttpProxyModule#proxy_cache_bypass

Installing ObsPy on Fedora 18

obspy-logo

ObsPy is an open-source project dedicated to provide a Python framework for processing seismological data. It provides parsers for common file formats, clients to access data centers and seismological signal processing routines which allow the manipulation of seismological time series (see Beyreuther et al. 2010, Megies et al. 2011).

The goal of the ObsPy project is to facilitate rapid application development for seismology.

https://github.com/obspy/obspy/wiki

ObsPy packages are available only for Debian/Ubuntu, however is possible to install it on Fedora via Python Package Index (PyPI). Not all deps are explained on ObsPy wiki pages so here is the complete procedure to install the software on Fedora 18:

First set up all the dependencies via yum

[root@sam ~]# yum install -y python-devel python-setuptools numpy scipy python-matplotlib python-matplotlib python-matplotlib gcc-gfortran python-suds python-sqlalchemy python-lxml

Now you can install ObsPy as explained in theirs wiki (https://github.com/obspy/obspy/wiki/Installation-on-Linux-via-PyPI)

[root@sam ~]# easy_install -U distribute; easy_install -N obspy

To test if the installation was successful use obspy-runtests

[daniele@sam ~]$ obspy-runtests
................................................................................................................................................................................................s.....................................................
[...]
----------------------------------------------------------------------
Ran 839 tests in 65.348s
 
OK

That’s all.

References:

 

 

Re-enable “Log out” in GNOME 3.6

user_menu

 

In GNOME 3.6, with a single user, the option “Log out” in user menu is no more available by default.

To re-enable it open a terminal and type:

gsettings set org.gnome.shell always-show-log-out true

Now restart the Shell by pressing Alt+F2 and typing r<return>

References:

https://wiki.archlinux.org/index.php/GNOME#Always_show_the_.22Log_Out.22_entry_in_the_user_menu

Install Arista Transcoder on Fedora 18

aristaArista Transcoder (http://www.transcoder.org/) is a useful transcoder tool build upon Python and GStreamer. It’s not available in Fedora yum repositories, but the installation from source is quite easy.

Let’s go.

First: download the sources from its website and untar them

[daniele@sam ~]wget http://programmer-art.org/media/releases/arista-transcoder/arista-0.9.7.tar.gz; tar xzvf arista-0.9.7.tar.gz

Second: install the dependencies required to build and install Arista and the extra GStreamer plugins (if not already installed) via yum

[daniele@sam ~]sudo yum -y install python3-devel gstreamer-ffmpeg gstreamer-plugins-good gstreamer-plugins-bad-free gstreamer-plugins-bad-nonfree gstreamer-plugins-ugly

Arista uses HAL which is deprecated since Fedora 15 and removed from Fedora 16, so to run Arista you also need to install python-gudev which uses udev instead of HAL.

[daniele@sam ~]sudo yum -y install python-gudev

Third: build and install the software and remove install sources

[daniele@sam ~]cd arista-0.9.7
[daniele@sam arista-0.9.7]$ python setup.py build
[daniele@sam arista-0.9.7]sudo python setup.py install
[daniele@sam arista-0.9.7]$ cd ~; rm -Rf arista-0.9.7

Fourth: run Arista from command line or from your application menu!

[daniele@sam ~]$ arista-gtk

arista-fedora18

Done!