Category Archives: administration

Debian/Ubuntu system hanging on boot

Some time ago I rebooted my Ubuntu file server, and noticed that it was taking forever to reboot. It’s usually headless, so I hooked up a spare monitor and saw a message that I didn’t expect:

“A start job is running for Create Volatile Files and Directories”

So that’s one I’d never seen before, so went straight to the Googles, and found this lovely explanation:

So it turns out that a bug in “system-config-printer” of all things, causes extremely bloat in /tmp, causing a huge number of files to be created over time, and this essentially puts the system in a hung state.

The fix, as mentioned on the website above, is quite straightforward. Once you boot into single user mode (see the link for details), you can do the following:

rm -rf /tmp
mkdir /tmp
chmod 1777 /tmp

This resolved the issue for me immediately, and hopefully you too!

Debugging CSS with Firebug

I’m working on a project involving Django, and I wanted to use Bootstrap 3 to make it look all nice and professional-like. The issue I had was that the jQuery and underlying CSS is so obscure, it wasn’t really worth trying to troubleshoot.

Enter Firebug.

One of my issues was that I wasn’t even sure that my /static/ files (where you store files like CSS and Javascript on a Django Project) wasn’t even configured correctly. I did see in the “CSS” tab of Firebug that it listed my CSS file, so I could tell it was finding it.

The real solution was that the CSS section was throwing a 404 error, as could be seen by clicking on the CSS file on the list.. it said something to this effect:

/my/static/path/bootstrap3js/bootstrap.min.css not found

I instantly new the problem. This line in my

# The Bootstrap base URL
'base_url': '/static/bootstrap3',

Should have said this:

# The Bootstrap base URL
'base_url': '/static/bootstrap3/',

(Note the trailing slash). Once updating this, the page (and CSS) loaded perfectly. Even using the native Firefox debugging tools didn’t catch this. I’m definitely a convert now.

Resolving a Linux hang-on-boot Situation

For several distributions of Linux, including Fedora, Arch, and a couple others (all of which happen to use systemd — hmm…) I would consistently have problems booting. During the startup process, when all of the services are being started, it would always hang at the exact same point: right after the “Started udev device kernel manager” line. This prevented me from even attempting to install any of these distributions. I did notice that any distro that did not default to systemd (namely Ubuntu and Gentoo) installed with no issues.

I finally found a fix to this: blacklist the dw_dmac module in the kernel. In Arch at least, this is done at boot time by adding the following line to the kernel boot line in Grub:


Once I hit enter, it booted up without issue, and installation went flawlessly. Rather than keep this line in my grub kernel line, I’ll blacklist it permanently the proper way, but for now, this works.

Mounting LVM Volumes in Linux with Rescue/Live Disk

So lately I’ve been playing around with a single remote-mounted nfs home directory at home. I’ve used it at work for years, and it’s great having all of my stuff in one location no matter what system I’m logged into. The setup was quite straightforward, except I’m still troubleshooting why my system hangs shortly after I login. I even made sure to include the _netdev option in my fstab so that it wouldn’t get mounted until after the network/nfs services are started, but it’s still causing me an issue. Anyway, the temporary solution is one I use rarely enough that I wanted to document it here… mounting an LVM volume manually when LVM isn’t already started. This is because I booted from the Fedora 20 Live disk in order to edit my fstab so I could login.

Here’s what I had to do in order to get my root partition to mount:

vgscan         # you may have to run 'lvm vgscan', but the former worked for me
vgchange -ay   # again you may have to run 'lvm vgchange -ay'
mount /dev/rootdg/root /mnt   # your volume group and volume name may differ
vi /mnt/etc/fstab

Be sure to get the one in /mnt, not in /etc, because that’s  your Live Install fstab and it won’t persist nor have anything useful in it.

Once I’ve made my changes, I reboot. Viola, you’re saved!

Windows 7 – Unable to start or stop services

If you’ve read past posts, you know that I run Synergy to connect my Windows 7 desktop to my Linux desktop, with the Windows box being the Synergy server. Although previously I found a way to not make my entire game minimize when my mouse crosses systems, I still need to disable it from time to time, because especially in some FPS games, moving the mouse to the right will cause the cursor to move to my Linux system and then in the game I’m playing, my character freezes until I move it back. Effectively I’m unable to turn or sometimes look to the right.  To prevent this, I disable Synergy.  After a recent fresh reload of Windows 7, I attempted to disable or enable Synergy, and received the following message:


Now the first obvious question was “Is my account an Administrator?” and yes, it certainly was. After some unfruitful searching, I noticed another uncommon sight. On the “Processes” tab, the button that says “Show processes from all users” was available:


The shield icon told me that Administrator privileges were required. I clicked the button, which of course showed all processes, and then tried to disable Synergy again — and this time it worked! It turns out that clicking that button somehow authenticated my ID within the Task Manager application, so now I had enough access to start and stop all the services I want. For some reason, every time I open the Task Manager, I’m still presented with that button, and it must be clicked in order to accomplish my goals — why it doesn’t persist between invocations is still a mystery — that’s how my previous Windows 7 installation performed. Either way, it’s a quick fix to a big issue.



Managing Linux Screen Resolutions with xrandr

I’m making much more of an effort lately to spend more time at home in Linux. I still have a Windows 7 drive because of gaming and some photography related applications I use, but aside from that, there’s no reason why I can’t “come home” to my Linux installation.

One issue I always seem to have is the fact that my two monitor setup includes one widescreen monitor (1920×1080) and one non-widescreen monitor (1280×1024), so one resolution never cuts it. Most of the modern Linux distributions can handle this with either the proprietary video drivers (like Nvidia), but with the various built-in drivers, it seems to be a roll of the dice as to whether or not the resolutions will work. I should also mention that I use the Qtile Window Manager because I like tiling managers, plus this one is written in Python, a language I’m trying to gain a lot of experience with. Anyway, Qtile has a very simplistic design, and that design excludes the normal “Menu” bar that has Applications, Settings, etc., which also forces me to learn more how to do things manually via the command line (another perk). This time, it’s adjusting my resolution.

When I first set up qtile, the monitors were in the wrong order — the left monitor was displayed as the right, and vice versa, so I’d have to move the mouse in the opposite direction to get the cursor to the other screen. Normally this isn’t an issue, I’d open the Gnome settings and switch them, but this time I got an error (perhaps due to my window manager and that I didn’t install Gnome, just pieces of it) so I had to find an alternate method. Enter xrandr. It was relatively quick to Google the correct command to switch my displays:

#This shows the current configuration as seen by xrandr:
xrandr --current

This showed me the following (unimportant content truncated):

DVI-I-1 connected primary 1920x1080+1280+0
DVI-I-2 connected 1280x1024+0+0

So  now I knew the tags for each of my monitors — the widescreen was DVI-I-1, and the other was DVI-I-2.

A glance at the usage (xrandr –help) showed me that there are some very intuitive parameters that can be passed, namely –right-of and –left-of. The following command switched my monitors as I desired:

xrandr --output DVI-I-1 --right-of DVI-I-2

So I added that to /etc/profile and restarted X to test (Control-Alt-Backspace) and it worked like a charm. There was one hitch though. Both monitors were using the resolution of the smaller one, and my 1920×1080 monitor was stretched and looked awful. Enter xrandr again. Making one minor edit to this command fixed me up for good!

xrandr --output DVI-I-1 --right-of DVI-I-2 --mode 1920x1080

So restarting X again showed me exactly what I was hoping for — proper resolution for each monitor. Chalk up another victory for Linux command line!



Who uses Caps Lock anymore? More Control!

When I started using emacs again some time ago, I noticed quickly that it was very uncomfortable to move my little finger down to the left control key in order to do the many emacs control sequences. I wanted something much easier to use, or else emacs likely wouldn’t last. I recalled a while back remapping my caps lock key to another control key, so I looked into it. Not only is this good in Linux, but I was able to do it in Windows 7 as well, with a registry entry.

Here is a link to my github page with the required Windows registry update. Note that this has been tested on Windows 7 only. If you try it out with other versions, let me know if it works so I can update the post!

For Linux, three lines added to ~/.bash_profile or ~/.bashrc would do the trick:

xmodmap -e 'keycode 66 = Control_L'
xmodmap -e 'clear Lock'
xmodmap -e 'add Control = Control_L’

Once that file was sourced or you relog, it takes effect and you have a much more comfortable control key on your hands!

Update 10/15/2014:

You can also achieve the same results with a single command:

setxkbmap -option ctrl:nocaps

This of course uses a different command, so you have another option if you prefer to not use xmodmap, or if it’s not available for some reason.

Laptop ACPI Issues

So recently I installed Ubuntu 14.04 LTS on a laptop. This laptop is new enough to use UEFI boot, however I was able to disable that in the BIOS. I read many people had issues getting Linux in general to work with UEFI, so I was fine with using the legacy system.

One issue that I did have was that on shutdown, Ubuntu was hanging. I’d have to manually power it off, and that was not something I was comfortable doing. First thing I did, edit /etc/default/grub and change




On the line “GRUB_CMDLINE_LINUX_DEFAULT”. This way I could see what was happening and wouldn’t get a blank screen while the system was shutting down all of it’s services. I ended up seeing the following message:

* Will now restart

So that tells me that the process responsible for sending the power cycle message to the hardware (ACPI) was not functioning, although the operating system was ready for the poweroff/reboot to occur.

The easy fix: editing the above file again, and now it looks like this:

GRUB_CMDLINE_LINUX_DEFAULT="nosplash acpi=off"

Now I can safely boot, reboot, and shutdown the system without the operation hanging. I lose some ability to control the system power, but since that mainly includes system hibernation or suspend, I’m fine with it. I never use those functions anyway, and disable them shortly after the initial operating system load.


Errors with gpg –gen-key over SSH

This issue plagued me for some time… I was attempting to create a gpg key, add it to my keychain, and then gpg encrypt a netrc file to use in Emacs. It kept failing just before it would create the actual key, and was giving strange X-related errors. I should note that the “over SSH” part of this title means that I was connected via ssh on the server I was attempting to create the gpg key on.

One of the many error messages was that I did not have the “pinentry” package installed, but I verified multiple times that it was there, and even reinstalled it several times.It finally dawned on me that the reason it was looking for pinentry-gtk or pinentry-qt (both X-windows libraries) was that it thought I was locally logged into that server, and could see the desktop. This made me realize that it was trying to display the graphical interface for the passphrase, which could not be displayed because I was connecting via ssh. A quick echo $DISPLAY showed me that my ssh was attempting to forward the X connection to my local host, however the DISPLAY was not working because my local system did not have those packages installed. Once I issued unset DISPLAY my key was able to generate just fine, because it used the non-X version of the routine that asked me for my passphrase.

Another seemingly difficult problem solved by thinking things through!

VirtualBox 4.3.14 and Antivirus Programs

This evening I wanted to delve into some different distributions of Linux that I’ve never really given much time. The first one that came to mine was Gentoo. I’ve read that “If you use any Linux distro, you learn that distro, but if you use Gentoo, you learn Linux.”  It’s quite a bold statement, and quite frankly I wanted to see for myself. Another popular one I heard great things about is Arch. I wanted to give both of them a try tonight.

I downloaded the most recent basic images of both, and realized that since my latest PC reload, I never reinstalled VirtualBox — an important tool for testing out various operating systems. It seems foolish to destroy a working system to test something out that you may absolutely hate, so VirtualBox has always been my first step in trying a new one. The latest version of VirtualBox as of this post is 4.3.14. I installed it, rebooted just in case (since it adds a network device and likely loads some kernel modules), and attached my Gentoo ISO to the virtual cdrom, and clicked ‘Start’. This was the lovely message I received: (Note, this is from my Arch attempt, but the message was the same)

VirtualBox Error

Having never seen this before for any thing, I quickly hit Google, only to find a few others have had this in the past, and nobody was quite sure what the fix was. Some were searching and deleting Windows registry keys (which I had none that matched), and various other things. Wanting to quickly see if it was the ISO or my VirtualBox installation, I tried Arch, and got the same message.

I did a bit more searching, and found that people were having moderate success in removing their “Avast” anti-virus, so I thought I’d give that a try. Rather than remove it, my AVG installation has an option to “Temporarily Disable AVG Protection”. I checked the “10 minutes” option, and viola! The ISO booted just fine. Once it was running, I’m sure the 10 minutes expired, and the guest is still up and running, but I suspect any time I want to boot this (until the bug in VirtualBox is resolved) I’ll need to temporarily turn off the anti-virus.