devnull

Man of many talents. Server janitor, Chief Googler, Vice President of Pencil Sharpening, Director of Turning Things Off and On Again. Technology Plumber using Linux for stuff like Satellite STB, home CCTV system, kitchen sound bar, workstations, even car onboard computer. And servers, oh yeah - lots of them. I've been a Linux Mercenary for quite a while now, often using information posted by kind strangers on the Internet to solve problems during this journey. This blog is a humble attempt to give something back to the community.

May 242016
 

do_not_touchRight, so we got a bunch of those IGEL UD3-LX thinclients. They are pretty cool, even Youtube works over the remote connection to Thinlinc server!

Configuring them one by one would be a PITA but good guys at IGEL Technology are providing us with management utility, namely:

  • IGEL Universal Management Console and
  • IGEL Universal Management Server

And thumbs up for them for providing a Linux version as well! This is essentially Java application bundled with Tomcat + Java based client – perfect for deploying inside our Openstack private cloud if you ask me.

Manual says in Prerequisites “any common Linux distribution” but installation wasn’t flawless though, I tried first on Ubuntu 16 LTS but that was a bit too much, too new I guess. Then tried Centos 7 and that worked, after a few additional steps.

 

Lets get going:

setenforce 0

# otherwise installation will be suddenly interrupted, without any meaningful error

yum install libXext.i686 libXrender.i686 libXtst.i686 libgcc.i686 xorg-x11-xauth glibc.i686 -y
# yes, these i686 libraries are also required. Not mentioned in manual, sadly.

# alright, we are ready to roll. Download newest packages for Linux, execute and go with the flow:

bash setup-igel-ums-linux_5.02.100.bin

Once completed service should be running


systemctl status igelRMserver

igelRMserver.service - LSB: IGEL Universal Management Suite Server processes
Loaded: loaded (/etc/rc.d/init.d/igelRMserver)
Active: active (exited) since Tue 2016-05-24 09:19:58 BST; 55min ago
Docs: man:systemd-sysv-generator(8)

May 24 09:19:58 igel-mngm.mielnet.pl systemd[1]: Starting LSB: IGEL Universal Management Suite Server processes...
May 24 09:19:58 igel-mngm.mielnet.pl igelRMserver[18181]: Starting IGEL Universal Manager rmguiserver
May 24 09:19:58 igel-mngm.mielnet.pl systemd[1]: Started LSB: IGEL Universal Management Suite Server processes.

Any problems check if service is listening

netstat -nelp |grep 8443
tcp6 0 0 :::8443 :::* LISTEN 0 61997 21308/jsvc.exec

also check system logs and stuff under /opt/IGEL/RemoteManager/rmguiserver/logs/

If it’s looking good you can fire up console on the server:

[centos@igel-mngm ~]$ /opt/IGEL/RemoteManager/RemoteManager.sh &

and use it to connect to localhost port 8443. Assuming you have X forwarding enabled (“yum install xorg-x11-xauth -y” and ssh -X), you should see IGEL Universal Management Suite.

Alternatively, point web browser on your client to http://igel-mngm.mielnet.pl:9080/start_rm.html – requires a Java Web Start to be installed on your client.

Note, you probably want VM with at least 2GB RAM and 2x vCPUs. Despite manual saying that memory requirements are lower I’ve seen some “Out of memory” on VM with 1GB RAM.

As always, drop a comment if you find this useful. Just so I know it helped someone else – thanks!

Mar 042016
 

Installing on Centos 6

I need PostgreSQL 9.3 on my Centos 6 box

yum localinstall https://download.postgresql.org/pub/repos/yum/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-2.noarch.rpm

yum list postgres*
yum install postgresql93-server
service postgresql-9.3 initdb

chkconfig postgresql-9.3 
service postgresql-9.3 start
service postgresql-9.3 status

 

Login to database

sudo -i -u postgres
psql --username=postgres -l 
# list all databases on psql prompt
\list or \l
# list all tables in the current database
\dt

 

Enabling password auth

sudo vi /var/lib/pgsql/data/pg_hba.conf

Find the lines that looks like this, near the bottom of the file:

# pg_hba.conf excerpt (original)
host    all             all             127.0.0.1/32            ident
host    all             all             ::1/128                 ident

Then replace “ident” with “md5”, so they look like this:

# pg_hba.conf excerpt (updated)
host    all             all             127.0.0.1/32            md5
host    all             all             ::1/128                 md5

Save and exit. PostgreSQL is now configured to allow password authentication.

Extensions

IF you need extensions, like RegExp-optimized index extension pg_trgm, you are going to need postgresql-contrib package. Once you have it installed, run:

$ sudo -u postgres sh
$ psql puppetdb -c 'create extension pg_trgm'
$ exit

 

File based backup

service postgresql stop
tar -czf /backup/full_postgres_backup-`date +%Y%m%d`.tar.gz' /var/lib/pgsql/data
service postgresql start

Single DB dump, for example spacewalk database

su - postgres -c 'pg_dump rhnschema |gzip -c > /backup/rhnschema_postgres_backup-`date +%Y%m%d`.sql.gz'

Backing up from cron

Moar scripts here https://github.com/zmielna/backup_scripts

# crontab -l
01 3 * * * /root/bin/postgresql_dump.sh 2>&1 |logger

vim /root/bin/postgresql_dump.sh

#!/bin/bash
#############################################################################
# Simple script to create a snapshot of a PostgreSQL databases.
# Can be run from cron like that
# 01 3 * * * /root/bin/postgresql_dump.sh 2>&1 |logger
# 
# Send bugreports, fixes, enhancements, t-shirts, money, beer & pizza to [email protected]
#############################################################################

#------------ variables
# Directory to store backups in
DST=/backup/dbback_postgresql
# DATABASES="postgres rhnschema"
DATABASES=`su - postgres -c "psql --username=postgres -l -x"|grep Name|grep -v template|cut -d"|" -f2|xargs`

# Any backups older than this will be deleted first
KEEPDAYS=7
DATE=$(date  +%Y-%m-%d)
#------------ code
/bin/logger "Starting PostgreSQL Dump....."
# cd $DST
find ${DST} -type f -mtime +${KEEPDAYS} -exec rm -f {} \;
rmdir $DST/* 2>/dev/null
mkdir -p ${DST}/${DATE}
chown postgres. ${DST}/${DATE}
for db in $DATABASES ; do
        echo -n "Backing up ${db}... " | logger
	su - postgres -c  "pg_dump ${db} |gzip -c > ${DST}/${DATE}/${db}-`date +%Y%m%d`.sql.gz"
        echo -n "Done with $db." | logger
done
/bin/logger "OK, all PostgreSQL dumps done in $DST"