2015년 3월 22일 일요일

Archlinux: Temporary workaround for xinit failure after upgrading to xorg-xinit 1.3.4-2

After updating my Archlinux system running kernel 3.19.2-1 with pacman -Syyu X windows' xinit refuses to start with the error "/dev/tty0 does not exist". Instead of startx, I invoke XFCE4 DE from the CLI with startxfce4. On Arch, you can browse recently-installed packages with the following:

tac /var/log/pacman.log | less

Among the xorg-related packages, I noticed xorg-xinit (1.3.4-1 -> 1.3.4-2) and xorg-fonts-misc (1.0.3-2 -> 1.0.3-3) had been upgraded in the most recent update. The fonts package probably isn't the cause of X refusing to start, so I tried downgrading xorg-xinit to 1.3.4-1 (first cd to the pacman package cache folder at /var/cache/pacman/pkg and then manually install the previous package version with pacman -U pkgName):

sudo pacman -U xorg-xinit-1.3.4-1-x86_64.pkg.tar.xz

With the previous xorg-xinit version, X Windows starts just fine. I haven't filed a bug report (to the Archlinux bug tracker or upstream) yet, but if the issue persists I will probably do so.

Postscript 2015-03-25:
Since I use the xfce4 Desktop Environment, xfce4-session must be upgraded to 4.12.1-2 in order for xorg-xinit 1.3.4-2 to work. The issue is now solved!

2015년 3월 19일 목요일

Review of LFCS Ubuntu exam taken on Feb. 28 2015 (Fri)



I am proud to announce that I am now a Linux Foundation Certified Sysadmin (LFCS-1500-0222-0100, last name Koh) . I took the exam on a VM with Ubuntu 14.04 installed and passed with a score of 86/100. Before March 1, 2015 the passing score was 65%, but after this date test takers need a score of 74% or better to achieve certification.

Below is a link to a gist containing an Emacs org-mode text file which I used to prepare for the exam:


Testing dates and times are quite convenient and numerous, but tests are not offered on the weekends (US Central Standard Time). I liked the fact that the current (as of March 2015) proctor Innovative Exams lists all testing dates in local time. I took the exam from the GMT + 9 time zone (Seoul / Tokyo), and the proctor scheduling system was able to take this into account.

Pre-test tasks

A few days before the exam, you will get an email from the proctor with a short confirmation code as well as basic info about the test. When you log into the exam site, you will be asked to provide this confirmation code by the human proctor.

Although the testing time itself is just 2 hours, it takes about 15~30 minutes for the proctor to verify your identity (you have to hold up official ID like a driver's license or passport in front of your webcam), make sure all plugins are installed in your browser, and check that screen sharing is working properly. Initially, screen sharing wasn't working, but after the proctor told me to reload the session, it worked just fine.

I took the test on a notebook with Archlinux installed (kernel 3.18.X) using XFCE4 desktop environment. I used the LF-recommended browser Chromium/Chrome. The proctor asked me to close all miscellaneous windows, close all browser tabs except for the exam session, and to also kill applets or programs running in the background such as dropbox and rescuetime. The proctor also asked me to show a list of running tasks, so I launched htop, which was fine. Finally, I was asked to use the webcam to pan around the room I was taking the test in. Because the proctor has access to your webcam and microphone, they can see and hear you for the duration of the test, but you are not supposed to talk to the proctor. You can only communicate through a chat window on the left side of the browser window.

Once the exam actually begins, the chat window gets minimized into a tab after 60 seconds of disuse allowing you to work in the VM full-screen. You will not be able to ALT-TAB out of the browser window.

The Exam

The test is divided into several sections, and a point value is indicated for each section as a whole. You aren't told, however, how many points each question within a section is worth. You can navigate between questions by clicking on special left and right arrows provided next to the VM window in the browser.

There weren't many surprises on the exam; if you diligently work through the topics provided in the syllabus for the LFCS exam (aka Overview of Domains and Competencies) and study a few of the topics in LFS 201 Essentials of Linux System Administration you should be able to pass the exam like I did. I also highly-recommend the free edX MOOC LFS101.2x Introduction to Linux for both those new to Linux and more experienced users/admins.

Although the final exam in LFS101.2x is much too easy, there is a lot of solid content that will help prepare you for the LFCS, in particular the material from chapters 8.4 backing up and compressing data10.2 Advanced editors vi and emacs, 13 Manipulating Text, 15 Bash Shell Scripting, 16 Advanced Bash Scripting.

I strongly recommend familiarizing yourself with vi/vim! Although I use Emacs as an IDE, terminal emulator, gpg frontend, irc client, etc., vi is almost always available when working on random servers in the field which is not true of Emacs. On the LFCS, knowing how to find/replace text within files is a must, and the commands for doing so are similar between sed and vi, so learning vi will also help you in other Linux/Unix utilities.

Make sure you know partition creation and LVM setup like the back of your hand using CLI-only tools. The VM you are provided with does not have X11 installed, so you have to do everything from the command-line so be prepared! You should know how to use fdisk, pvcreate, vgcreate, lvcreate, mkfs, etc. Before March 1, 2015 the LFCS also tested you on Linux SW RAID with mdadm, but now mdadm has been removed from the test.
Note -- you do NOT need to reboot the VM for it to detect newly-created LVM partitions. The relevant questions actually tell you to use the partprobe command to detect new volume groups and logical volumes without rebooting.

You should also be able to manage users and groups with usermod, groupadd, etc. and feel comfortable editing /etc/passwd

It is unnecessary for me to rehash the entire LFCS syllabus in this post, so just take a look at the LFCS syllabus for topics to review.

There were a few networking-related tasks that weren't on the syllabus that surprised me when they appeared on the exam. These questions were not difficult per se, and any sysadmin or engineer already working with Linux day-to-day should be able to solve them, but it might surprise test-takers with little-to-no experience of Linux networking commands.


Comparisons with RHCSA

As the LFCS is a lab practical-style exam similar to those from Red Hat, it is only natural to compare the two. One interesting thing to note is that at the end of February 2015, Red Hat discontinued RHCSA for RHEL 6.X (kernel 2.6.32...), so all tests are now based on RHEL 7.X (kernel 3.10...)

As some of you may already know, RHEL7/CentOS7 uses systemd instead of SysVinit and also has SELinux enabled by default. In contrast, as of the end of Feb 2015, the LFCS allows test takers the choice of getting certified on Ubuntu 14.04, CentOS 6.4, and OpenSUSE 13.1, but the first two don't use systemd and none has SELinux enabled by default. Of course, Ubuntu 15.04 and CentOS7 use systemd, so the LFCS will change in this respect as time goes on. 

The duration of both exams is similar, 2 hours for the actual exam, 30 minutes for pre-test setup. Red Hat certs are valid for 3 years, but the LF certs only last for 2. Also, there are pricing differentials by region. Here in South Korea, the RHCSA and RHCE exams cost 140,000 KRW (apprx $130) compared to $400 in the US, but the LFCS and LFCE cost $300 USD regardless of geographical location. These are just the superficial differences, however.

I am scheduled to take the RHCSA on March 27, 2015 after which I will post a detailed write-up of the differences I experienced between the LFCS and RHCSA.


Conclusion

In my opinion, the LFCS requires test takers to complete common tasks that would reasonably be expected of sysadmins. For those readers who currently work with Linux as sysadmins or system engineers, investing anywhere from 5~20 hours for review and preparation should be sufficient.

For those not using Linux in a professional capacity, I recommend taking edX LFS101.2x and scoring 100% on the final exam (I am not kidding; the exam is very easy and if you cannot get a perfect score on LFS101.2x you will have a hard time passing the LFCS exam) and perhaps taking LFS201 to fill in gaps in your knowledge. The Linux Foundation also offers shorter 1-day training courses such as LFS 202 LFCS Preparation which I reviewed in another post.

I think it's great that there now exists is a non-vendor-specific Linux certification modeled after Red Hat exams. Unless your company or clients use RHEL, you probably won't encounter SELinux, firewalld, etc. very often (in fact, most of the Korean telcos I work with disable SELinux on their development servers). Although I am more familiar with RHEL/CentOS than Ubuntu, I intentionally certified on Ubuntu 14.04 to familiarize myself with dpkg/apt package management and to prepare for the possibility that I might encounter Ubuntu servers in the field. 

Studying for the exam forced me to learn about a new distro and I hope that in time the Linux Foundation certs will become just as valued as those from Red Hat. If your company provides reimbursement for professional education and certification, I highly recommend getting LFCS/LFCE certified on Ubuntu or OpenSUSE to prove your knowledge of multiple Linux distros. If you want to test your CentOS knowledge, I think you should just take the RHCSA/RHCE.

2015년 3월 12일 목요일

mysql/mariadb supports utf-8 encoding within DB tables, but it doesn't support UTF-8 in /etc/my.cnf???

A few weeks ago, I installed RHEL 6.6 and MariaDB 10.X at a client site but had problems running a DB install script. The message I got was

found option without preceding group in config file /etc/my.cnf at line 1

A google search for this snippet turned up the following StackOverflow thread:

http://stackoverflow.com/questions/8020297/mysql-my-cnf-file-found-option-without-preceding-group

Apparently, the /etc/my.cnf config file for mysql/mariadb only supports ASCII! This was quite a shock, because I know UTF-8 support is now built-into both databases.

I verified that /etc/my.cnf was indeed encoded as UTF-8 text using the file utility:

$ file /etc/my.cnf
/etc/my.cnf: utf-8

To convert text within a file from one encoding to another, use the iconv utility:

iconv -c -f utf8 -t ascii /etc/my.cnf

Explanation of the option flags (from man iconv):
-c   silently discard chars that cannot be converted instead of terminating when encountering such chars

-f   from-encoding

-t   to-encoding

In 2015, virtually all POSIX programs get along just fine with UTF8, so why does mysql/mariadb have a problem with UTF8 in my.cnf? This bit of techno-trivia has now been added to my growing body Linux sysadmin lore, but this should issue should be fixed, in my opinion.

2015년 3월 2일 월요일

My first book translation is now in print! "Crossing Heaven's Border"

In Spring 2012, I was contacted by a South Korean newspaper reporter from The Chosun Ilbo about translating a book. As a freelance interpreter and translator from 2005-2014, I had done lots of one-off translations of thesis abstracts, short stories, ad copy, etc. but this was the first time I had the chance to translate a book.

The book's 1st edition title in Korean was "천국의 국경을 넘다" which became Crossing Heaven's Border in English. It was written by Hark Joon Lee, head of the Crossmedia Team at The Chosun Ilbo and also the director of a documentary about North Korean defectors. This book takes a closer look at events covered in the documentary and also follows up on the lives of North Korean refugees living in South Korea today.

I hear that the editing process in Korea and Japan is quite brief compared to that in the US and the UK; the Japanese edition of Crossing took less than 6 months to translate, edit and publish. For the US edition of Crossing..., however, contract negotiations, translation, editing and publishing took about 3 years. This is due to the fact that in Asia, editors basically just rubber-stamp the author's work, while in the US/UK, editors often revamp the entire book and go through the draft multiple times with a fine-toothed comb.

The editor for Crossing... was George Krompacky, Publications Manager of the Shorenstein Asia-Pacific Research Center at Stanford University. He did a great job of pointing out inconsistencies and errors in my translation drafts and his knowledge of Traditional Chinese was invaluable in deciphering the meaning of Sino-Korean words which I had mis-translated in places.

The author, Hark Joon Lee, was also very gracious in answering my questions about the original Korean text and answered my emails late at night and even on weekends. It seems like reporters check their email 24/7!

I enjoyed working on this book translation, and if I have the opportunity to do so, I hope to do more Korean to English book translations in the future.