Warning personal rant follows.
Over the years I have used a number of different flavours of Unix/Linux. Unix flavour I have used include AIX (IBM), SunOS/Solaris (Was Sun, now Oracle), IRIX (SGI), HPUX (HP), Ultrix (DEC). Linux flavours include Suse, Mandrake, Mandriva, Redhat, Fedora, DSL, Puppy and many more.
When I first started with AIX, I had come from the world of the Apple Macintosh that was all nice a fluffy - you did most things point and click (except for development). The shock was large, I had to write some shell scripts and some C programs. vi was the most unpleasant piece of crap I had ever seen. So I took a couple of days out and compiled emacs on the AIX machine. For the next year or so was happy in the world of emacs.
That was of course until a machine had a major issue and I needed to start it in maintenance mode. Then you get a scaled back OS to fix the machine with, and you guessed it vi was the editor.
Over time I then had to administer other machines with other versions of Unix, some of these had emacs, but all had vi. It suddenly dawned on me I need to take the time to learn vi. From that point forward I have never looked back, I would struggle now to drive emacs.
The thing that has become clear to me in the world of computer administration is take the time to learn all the standard tools and the standard ways to do things - if you rely of having a customised environment you will spend a lot of time building the custom environment each time you have a new machine to look after, rather than getting on with the job at hand.
The world is different if your job is that of programmer and you spend all your time on one computer, customise your environment on the machine, to minimise the amount of time doing all the other activities that do not involve writing code.
I expect all aspiring linux/unix sysadmins to learn vi, sed, awk, shell scripting and even perl. The mark of a true sysadmin is when the GUI starts the first application they run is a terminal to get to the command line, and this is where they spend most their time. Otherwise you are just a hobbyist (there is nothing wrong with having a hobby), and the title System Administrator becomes devalued.
Also take the time to learn as many tools and technologies as you can. Each one you learn makes you more valuable to the world of IT, gives you more depth and once you move to jobs where you are given the task to architect a system you have a better understanding of more tools. Too many systems are built using the wrong tools just because they are the only ones people know.
Thursday, September 15, 2011
Sunday, September 11, 2011
After Update, FC15 does not start correctly
From time to time there are various problems after an update that result in the machine not getting all the way to the GUI prompt after an update. With a little bit of knowledge this becomes a less concerning issue, and can be quite easily fixed.
My most recent experiences of this were a few weeks ago, I ran a yum update - there was a new kernel package installed, but the graphics drivers from rpmfusion had not been released for the kernel. As a result the machine appear to hang during boot at the point when it should have started X11.
To help with these issues, the first thing I do when I install linux is edit the grub.conf file and change the timeout parameter from 0 to 3. This puts a 3 second pause in the startup, that allows you to press a key and get a boot menu up, that allows you to select an older kernel to boot. (You can also change the command line it uses to start the kernel). When you then have these problems you can simply use this menu to boot the previous kernel.
Even without this, you can switch to another terminal session on your console with CTRL-ALT-F2 (F3, F4...) CTRL-ALT-F1 will get you back. You can then log in and get a command line.
When things get really bad you will need to get out you linux install media and boot off that, to get a command line to perform the recovery.
No matter how you do it, once you have a command line you can fix your install.
Most often you can fix it by changing the default boot kernel to the previous one. Edit the /etc/grub.conf file - the line to edit the default=0, this is a reference to the first OS entry in the file, to boot using the second one change it to default=1.
Another technique is to use yum to roll back the changes, as described in yum - help I have broken my install
Another thing to consider if you are taking a lot of updates and often have problmes is to change the number of kernels that are allowed to be installed at one time. This is done in the /etc/yum.conf file, you can change the line installonly_limit=3 to a higher number. I usually set mine to 5 just to have a bit more buffer when things start to go wrong.
One of the realities of linux is that it is more stable a reliable on slightly older hardware that the drivers have had the bugs ironed out in them. When you are in the situation I have been lately where some of the hardware I have is only just supported in the latest release then this is when stability issues come to the fore.
My most recent experiences of this were a few weeks ago, I ran a yum update - there was a new kernel package installed, but the graphics drivers from rpmfusion had not been released for the kernel. As a result the machine appear to hang during boot at the point when it should have started X11.
To help with these issues, the first thing I do when I install linux is edit the grub.conf file and change the timeout parameter from 0 to 3. This puts a 3 second pause in the startup, that allows you to press a key and get a boot menu up, that allows you to select an older kernel to boot. (You can also change the command line it uses to start the kernel). When you then have these problems you can simply use this menu to boot the previous kernel.
Even without this, you can switch to another terminal session on your console with CTRL-ALT-F2 (F3, F4...) CTRL-ALT-F1 will get you back. You can then log in and get a command line.
When things get really bad you will need to get out you linux install media and boot off that, to get a command line to perform the recovery.
No matter how you do it, once you have a command line you can fix your install.
Most often you can fix it by changing the default boot kernel to the previous one. Edit the /etc/grub.conf file - the line to edit the default=0, this is a reference to the first OS entry in the file, to boot using the second one change it to default=1.
Another technique is to use yum to roll back the changes, as described in yum - help I have broken my install
Another thing to consider if you are taking a lot of updates and often have problmes is to change the number of kernels that are allowed to be installed at one time. This is done in the /etc/yum.conf file, you can change the line installonly_limit=3 to a higher number. I usually set mine to 5 just to have a bit more buffer when things start to go wrong.
One of the realities of linux is that it is more stable a reliable on slightly older hardware that the drivers have had the bugs ironed out in them. When you are in the situation I have been lately where some of the hardware I have is only just supported in the latest release then this is when stability issues come to the fore.
Sunday, July 24, 2011
yum - help I have broken my install
Yes it happens from time to time - you do a yum update to get the latest packages for the fedora distribution or you install a new package which breaks your system. The good news is that there is a record kept of what you have installed/updated.
You can look at the yum.log in /var/log/ which will show you what packages have been updated/erased with yum.
You can also use the yum history command to see what has been happening
ID | Login user | Date and time | Action(s) | Altered
-------------------------------------------------------------------------------
138 | <fred> | 2011-07-24 11:24 | Update | 25 EE
137 | root <root> | 2011-07-24 11:08 | Downgrade | 21 EE
136 | root <root> | 2011-07-24 11:04 | Downgrade | 4
135 | root <root> | 2011-07-24 10:36 | Update | 4
134 | <fred> | 2011-07-23 13:25 | Update | 55 EE
133 | <fred> | 2011-07-17 12:00 | I, U | 71
132 | <fred> | 2011-07-10 15:06 | Install | 1
131 | <fred> | 2011-07-10 15:06 | Install | 1
130 | <fred> | 2011-07-10 15:06 | Install | 2
You can then use yum history undo <number> to rollback any update.
You can see that step 136 and 137 are a result of this - I uninstalled the previous two upgrades when trying to debug a startup issue
Other handy commands
yum history info <nnn>
yum history redo <nnn>
You can look at the yum.log in /var/log/ which will show you what packages have been updated/erased with yum.
You can also use the yum history command to see what has been happening
yum history
Loaded plugins: langpacks, presto, refresh-packagekitID | Login user | Date and time | Action(s) | Altered
-------------------------------------------------------------------------------
138 | <fred> | 2011-07-24 11:24 | Update | 25 EE
137 | root <root> | 2011-07-24 11:08 | Downgrade | 21 EE
136 | root <root> | 2011-07-24 11:04 | Downgrade | 4
135 | root <root> | 2011-07-24 10:36 | Update | 4
134 | <fred> | 2011-07-23 13:25 | Update | 55 EE
133 | <fred> | 2011-07-17 12:00 | I, U | 71
132 | <fred> | 2011-07-10 15:06 | Install | 1
131 | <fred> | 2011-07-10 15:06 | Install | 1
130 | <fred> | 2011-07-10 15:06 | Install | 2
You can then use yum history undo <number> to rollback any update.
You can see that step 136 and 137 are a result of this - I uninstalled the previous two upgrades when trying to debug a startup issue
Other handy commands
yum history info <nnn>
yum history redo <nnn>
Sunday, June 26, 2011
Fedora Core 15 - Install - Continued
I have been experiencing a number of stability issues with FC15. Mostly to do with it not booting cleanly or firefox crashing frequently. But also with the most recent kernel updates the machine came up with a garbled screen. Today I have had a chance to have a closer look at it and work out what is wrong.
Firstly I noticed I am getting a number of errors from the nouveau drivers for the nvidia card I have so I decided to load kmod-nvidia from the rpmfusion repository.
I installed this, now hardware acceleration is functioning correctly and I am seeing the new gnome interface in its full glory. Proceeded to read some online documentation about this and found firefox is now crashing with increased frequency.
Had a look and /var/log/messages and each time it was crashing it was logging a message :
dbus-daemon: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.NetworkManager.service': Unit dbus-org.freedesktop.NetworkManager.service failed to load: No such file or directory. See system logs and 'systemctl status' for details.
Given that I had previously attempted to disable network manager this was a bit of a puzzle to me. After a bit of playing about with systemctl I decided to remove Network Manager with yum erase.
It appear that now firefox is much more stable.
To get the shutdown command back in FC15 I installed
gnome-shell-extensions-alternative-status-menu
And to make a few more tweaks to the interface I installed
gnome-tweak-tool
Hopefully this will give me a more stable system.
Firstly I noticed I am getting a number of errors from the nouveau drivers for the nvidia card I have so I decided to load kmod-nvidia from the rpmfusion repository.
I installed this, now hardware acceleration is functioning correctly and I am seeing the new gnome interface in its full glory. Proceeded to read some online documentation about this and found firefox is now crashing with increased frequency.
Had a look and /var/log/messages and each time it was crashing it was logging a message :
Given that I had previously attempted to disable network manager this was a bit of a puzzle to me. After a bit of playing about with systemctl I decided to remove Network Manager with yum erase.
It appear that now firefox is much more stable.
To get the shutdown command back in FC15 I installed
gnome-shell-extensions-alternative-status-menu
And to make a few more tweaks to the interface I installed
gnome-tweak-tool
Hopefully this will give me a more stable system.
Tuesday, June 7, 2011
Fedora Core 15 - Install
My FC14 started to act up, and FC15 is out, so I took the plunge and decided to install FC15.
I am a believer in fresh installs of the OS, rather than upgrades :-
I isolated the FC14 disk by removing the cable - this is to ensure, I get the right disk for the install and I get a boot loader on the disk I am installing to, otherwise I have suddenly become dependent on both disks, and I have not retained my FC14.
I did a vanilla install of FC15 x86_64 - then plugged back in the FC14 disk.
Once rebooted after install logged in
yum update
removed rhgb and added timeout of 3 (so I get a menu if I have problems with a kernel and I can see what is happening during boot)
Changed the configuration from Network-Manager to network to get networking working at boot - edited /etc/sysconfig/network-scripts/ifcfg-eth0 to achive the settings I desired.
yum install of
yum install of
mount /dev/mapper/<vgfilesystem> /mnt/home
copied the /home contents to new install
copied additional user information from /etc/passwd /etc/shadow /etc/group
edit /etc/selinux/config - change settings for selinux to preferred options
Set up printers - got brother drivers from brother website
Problems with brother driver crashing from qcad was traced to requiring a2ps - once this was installed it all worked.
Over time I will get the settings refined to what I desire - but now I have notes of the process I took I can refer to them when I do the FC16 upgrade. I suggest you try to keep notes of your build, even if it is just the packages you add as it saves a lot of time trying to figure out "What was that DVD burning software I was using?" e.t.c.
I am a believer in fresh installs of the OS, rather than upgrades :-
- You can retain the old install (disk) intact if you have problems you can go back to it.
- You get rid of any rubbish that may have been hanging about, that can have an impact on the reliability of the new install.
I isolated the FC14 disk by removing the cable - this is to ensure, I get the right disk for the install and I get a boot loader on the disk I am installing to, otherwise I have suddenly become dependent on both disks, and I have not retained my FC14.
I did a vanilla install of FC15 x86_64 - then plugged back in the FC14 disk.
Once rebooted after install logged in
yum update
vi /etc/grub.conf
removed rhgb and added timeout of 3 (so I get a menu if I have problems with a kernel and I can see what is happening during boot)
Changed the configuration from Network-Manager to network to get networking working at boot - edited /etc/sysconfig/network-scripts/ifcfg-eth0 to achive the settings I desired.
yum install of
- system-config-displaymanager
- system-config-displaymanager-gnome
- gconf-editor
- qcad
- scribus
- system-config-lvm
yum install of
- vlc
- devede
- inkscape
- thunderbird
- thunderbird-lightning
- pitivi
- agave
- fuse-encfs
mount /dev/mapper/<vgfilesystem> /mnt/home
copied the /home contents to new install
copied additional user information from /etc/passwd /etc/shadow /etc/group
edit /etc/selinux/config - change settings for selinux to preferred options
Set up printers - got brother drivers from brother website
Problems with brother driver crashing from qcad was traced to requiring a2ps - once this was installed it all worked.
Over time I will get the settings refined to what I desire - but now I have notes of the process I took I can refer to them when I do the FC16 upgrade. I suggest you try to keep notes of your build, even if it is just the packages you add as it saves a lot of time trying to figure out "What was that DVD burning software I was using?" e.t.c.
Thursday, April 7, 2011
AirPrint for iPad and FC14
I bought a new toy - an iPad 2.
Great toy - having a lot of fun with a device with a good size screen, but portable. Slowly working out the apps that I require to make it useful.
The other day I thought I should look into printing, and started reading about AirPrint and then I saw the list of AirPrint printers that are supported, the official list only had HP devices, although I have since heard that a number of brother devices also support AirPrint.
After looking around on the web, I found a number of references to setting up a linux machine as an Airprint Server.
Using http://www.micromux.com/2010/11/22/airprint-for-mac-on-linux/ and http://lists.fedoraproject.org/pipermail/users/2010-November/387560.html
I started to configure it.
To my surprise it took about 15 minutes, and I can print from my iPad through CUPS on Fedora 14 and out comes a print on my Brother MFC-7420.
I have managed to print images from the photo app, and also anything that I can view in Safari, so it does not seem to have the limitations that Steve found when he posted his information. So you don't have to race out and buy a new printer, unless of course you want a new printer.
I have now done the same with Fedora 15 - so simple
Time to get a new printer, need colour, did some research and price checks, remembered my views on brands just before purchase and go an HP Color LaserJet Pro MFP M281dfw
wifi, airprint.... printing from MacOS, IOS, Windows all works great.
Great toy - having a lot of fun with a device with a good size screen, but portable. Slowly working out the apps that I require to make it useful.
The other day I thought I should look into printing, and started reading about AirPrint and then I saw the list of AirPrint printers that are supported, the official list only had HP devices, although I have since heard that a number of brother devices also support AirPrint.
After looking around on the web, I found a number of references to setting up a linux machine as an Airprint Server.
Using http://www.micromux.com/2010/11/22/airprint-for-mac-on-linux/ and http://lists.fedoraproject.org/pipermail/users/2010-November/387560.html
I started to configure it.
To my surprise it took about 15 minutes, and I can print from my iPad through CUPS on Fedora 14 and out comes a print on my Brother MFC-7420.
I have managed to print images from the photo app, and also anything that I can view in Safari, so it does not seem to have the limitations that Steve found when he posted his information. So you don't have to race out and buy a new printer, unless of course you want a new printer.
I have now done the same with Fedora 15 - so simple
- Add ServerAlias * to the /etc/cups/cupsd.conf file
- Download airprint-generate.py from https://github.com/tjfontaine/airprint-generate
- Run airprint-generate.py
- Copy resulting files to/etc/avahi/services
- Restart cups and avahi-daemon
Time to get a new printer, need colour, did some research and price checks, remembered my views on brands just before purchase and go an HP Color LaserJet Pro MFP M281dfw
wifi, airprint.... printing from MacOS, IOS, Windows all works great.
Tuesday, March 22, 2011
Skype - Fedora 14
I have just installed Skype 2.1 Beta 2 on Fedora 14 x86_64.
To get it to work I had to install the following 32 bit packages -
You can check the objects you need using ldd to show you all the libraries you are missing.
The difficult part is finding which packages the libraries that are missing are in.
The best tool to learn to use for managing rpm packages on Fedora is yum.
yum install <packages> will install the package and all the dependencies get installed too (after prompting you with the total list)
You can find the package that provides a file with a command such as
If you want to update the packages on your system to the lastest for your version of Fedora then
To get it to work I had to install the following 32 bit packages -
yum install libX11.i686 yum install libv4l.i686 yum install alsa-plugins-pulseaudio.i686 yum install qt.i686 yum install libXScrnSaver.i686 yum install libXv.i686 yum install libQtGTL.i686
You can check the objects you need using ldd to show you all the libraries you are missing.
# ldd /usr/bin/skype linux-gate.so.1 => (0xf7798000) libasound.so.2 => /lib/libasound.so.2 (0xf7686000) libXv.so.1 => /usr/lib/libXv.so.1 (0xf7681000) libXss.so.1 => /usr/lib/libXss.so.1 (0xf767e000) librt.so.1 => /lib/librt.so.1 (0x46c69000) libQtDBus.so.4 => /usr/lib/libQtDBus.so.4 (0xf7605000) libQtGui.so.4 => /usr/lib/libQtGui.so.4 (0xf6b77000) libQtNetwork.so.4 => /usr/lib/libQtNetwork.so.4 (0xf6a60000) libQtCore.so.4 => /usr/lib/libQtCore.so.4 (0xf67cc000) libpthread.so.0 => /lib/libpthread.so.0 (0x46c38000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xf66df000) libm.so.6 => /lib/libm.so.6 (0x46df7000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x46ffc000) libc.so.6 => /lib/libc.so.6 (0x46aac000) libdl.so.2 => /lib/libdl.so.2 (0x46c55000) libX11.so.6 => /usr/lib/libX11.so.6 (0x4709e000) libXext.so.6 => /usr/lib/libXext.so.6 (0x472c2000) /lib/ld-linux.so.2 (0x46a8b000) ...
yum - Yellowdog Updater Modified
The difficult part is finding which packages the libraries that are missing are in.
The best tool to learn to use for managing rpm packages on Fedora is yum.
yum install <packages> will install the package and all the dependencies get installed too (after prompting you with the total list)
You can find the package that provides a file with a command such as
yum provides libX11.so.6
If you want to update the packages on your system to the lastest for your version of Fedora then
yum updateIf You just want to list them then
yum check-updateThe power of yum is great and I use it in preference to the PackageKit widget in Gnome as it gives me the control of when and what I download to my machine.
Tuesday, February 15, 2011
VirtualBox - a great way to keep your old PC image
I have an old Windows XP machine that the motherboard has failed on. It has a lot of data and programs on it that I use from time to time (it was my primary PC for 6 years). I have found that Oracle VirtualBox (from their purchase of Sun) can be very helpful in allowing me to have an image of my old machine running on my new machine as I transition. This has greatly reduced the pain of loosing the old machine.
I put the XP disk in a USB carrier and plugged it into my Linux machine. Using command like
I managed to image the disk to a file on the linux machine. I then started VirtualBox and created a virtual machine using the disk image.
On startup the machine blue screened, just like windows does from time to time. Not to worry, I got my original XP CD and told virtualbox it was in the cd drive. Then on booting the virtual machine I did a windows repair. Windows now booted and after a couple of windows updates I have my machine back in a virtual environment.
A couple of things I found along the way -
The VirtualBox that is distributed with Linux is the Open Source Edition and does not have the extensions to use USB - download the executable from http://www.virtualbox.org - They even have a fedora repo file so you can keep it up to date with yum.
Follow the instructions on getting the kernel extensions built - you will have to do this each time you update you linux kernel.
I had problems where after installing the VirtualBox extensions I could not get shared folders to work, it kept saying they do not appear to be installed. It turns out the Kaspersky Internet Security was blocking the install - disable it and try again, magically the install works. After doing this and rebooting it is working fine.
I put the XP disk in a USB carrier and plugged it into my Linux machine. Using command like
cat /dev/sdg | VBoxManage convertfromraw stdin OutPutFile.vdi NUMBEROFBYTES
I managed to image the disk to a file on the linux machine. I then started VirtualBox and created a virtual machine using the disk image.
On startup the machine blue screened, just like windows does from time to time. Not to worry, I got my original XP CD and told virtualbox it was in the cd drive. Then on booting the virtual machine I did a windows repair. Windows now booted and after a couple of windows updates I have my machine back in a virtual environment.
A couple of things I found along the way -
The VirtualBox that is distributed with Linux is the Open Source Edition and does not have the extensions to use USB - download the executable from http://www.virtualbox.org - They even have a fedora repo file so you can keep it up to date with yum.
Follow the instructions on getting the kernel extensions built - you will have to do this each time you update you linux kernel.
I had problems where after installing the VirtualBox extensions I could not get shared folders to work, it kept saying they do not appear to be installed. It turns out the Kaspersky Internet Security was blocking the install - disable it and try again, magically the install works. After doing this and rebooting it is working fine.
Sunday, February 13, 2011
Squid Proxy
Given my main home machine is now running Fedora 14 rather than windows I have decided to install the squid proxy to have a look at how this can help with caching web pages locally.
The install was very straight foward
yum install squid
vi /etc/squid/squid.conf
I then uncommented the squid_dir line in the file to allow it to write a disk cache and started the proxy with
Then configured the browser (firefox) to use the squid proxy on the default port 3128.
Thats it.
To look at the contents of the squid logs I installed calamaris
Further steps I will look at is allowing access from other machines on my home network - likely I will have to adjust the iptables firewall to allow them to connect, but this is something you should take the time to understand if you don't already. (you can always use the GUI tools to configure these things, but that does not help me long term when administering machines through terminal sessions, so I like to use the command line where possible)
The install was very straight foward
yum install squid
vi /etc/squid/squid.conf
I then uncommented the squid_dir line in the file to allow it to write a disk cache and started the proxy with
service squid start
Then configured the browser (firefox) to use the squid proxy on the default port 3128.
Thats it.
To look at the contents of the squid logs I installed calamaris
yum install calamaris
cd /var/log/squid
cat access.log | calamaris -a | moreFurther steps I will look at is allowing access from other machines on my home network - likely I will have to adjust the iptables firewall to allow them to connect, but this is something you should take the time to understand if you don't already. (you can always use the GUI tools to configure these things, but that does not help me long term when administering machines through terminal sessions, so I like to use the command line where possible)
Saturday, February 12, 2011
Welcome
Well this is the start of the ramblings of an IT professional that fills in his spare time turning wood. The main point of this blog is for me to store notes for myself about the attempt to use OpenSource software as much as possible and the tools I have found that help. There may also be a bit of woodturning sneak in for a peek from time to time.
I am a huge fan of Linux based systems, as my first jobs it IT were using AIX, Solaris and IRiX my experience of various Unix derivatives is extensive. Linux has presented a path where we can us commodity hardware and have a stable reliable server platform without the degree of investment that was required 20 year ago.
My Linux flavour of choice currently is Fedora for the cutting edge and Redhat Enterprise for the stable backend services. When it comes to commercial software on a Linux platform you are normally looking at full support on either Redhat of SuSe, and it just makes life easier if you work with a consistent platform rather than changing every time you install a new system.
I am a huge fan of Linux based systems, as my first jobs it IT were using AIX, Solaris and IRiX my experience of various Unix derivatives is extensive. Linux has presented a path where we can us commodity hardware and have a stable reliable server platform without the degree of investment that was required 20 year ago.
My Linux flavour of choice currently is Fedora for the cutting edge and Redhat Enterprise for the stable backend services. When it comes to commercial software on a Linux platform you are normally looking at full support on either Redhat of SuSe, and it just makes life easier if you work with a consistent platform rather than changing every time you install a new system.
Subscribe to:
Posts (Atom)