Linux

Linux stuff

Fedora 24 issues on VirtualBox

As of some recent upgrades to my F24 VM (running under VirtualBox), my system would not boot properly any more, getting errors like

NMI watchdog: BUG: soft lockup - CPU#0 stuck

 

I couldn't find any details as to why this was, other than someone having similar issues with a bad GPU card (not under a VM). I checked my display settings for the VM, which had the minimum recommended setting of 21MB. This ought to have been plenty, since I run my Linux system in a head-less mode (no display etc.). However, Linux must have changed something, cause this no longer worked, but bumping the GPU memory to 32MB seems to have fixed it. Bizarre.

Hacking: 

firewalld and network interfaces

I have to say, firewalld and firewalld-cmd really sucks. But, since it's the default on a bunch of installations I use, and I try to "drink the koolaid", I've had the misfortune to try to set it up. Now, it mostly works, except when it doesn't, and then it really fails hard. Case in point, I wanted to reassign some network interfaces to a different zone, and naïvely thought that e.g. this would work:

$ sudo firewall-cmd --permanent --zone=public --remove-interface=eth2
$ sudo firewall-cmd --permanent --zone=internal --add-interface=eth2

 

Yeah, not so much ... What does instead work is adding lines like this to /etc/sysconfig/network-scripts/ifcfg-eth2:

ZONE=internal

WTF?

Hacking: 

Clamav installation failing on Fedora Core 18

Someone majorly botched the clamav packages in Fedora 18, where the packages fail to create the appropriate user ID and group ID. The output from the yum install looks like

Running Transaction
  Installing : clamav-data-empty-0.97.8-1.fc18.noarch                       1/5 
  Installing : clamav-lib-0.97.8-1.fc18.x86_64                              2/5 
Usage: groupadd [options] GROUP

Options:
  -f, --force                   exit successfully if the group already exists,
                                and cancel -g if the GID is already used
  -g, --gid GID                 use GID for the new group
  -h, --help                    display this help message and exit
  -K, --key KEY=VALUE           override /etc/login.defs defaults
  -o, --non-unique              allow to create groups with duplicate
                                (non-unique) GID
  -p, --password PASSWORD       use this encrypted password for the new group
  -r, --system                  create a system account
  -R, --root CHROOT_DIR         directory to chroot into

useradd: group 'clamupdate' does not exist
  Installing : clamav-filesystem-0.97.8-1.fc18.noarch                       3/5 

This is reported in RedHat bug 963920. As commented on this bug, the work around is to assure these users are created before installing the clamav packages. E.g.

$ sudo yum remove clamav\*  # Be careful with this, make sure you are not losing anything you wish to keep
$ sudo groupadd -r clamupdate
$ sudo useradd -r -g clamupdate -d /var/lib/clamav -s /sbin/nologin -c "Clamav database update user" clamupdate
$ sudo yum install clamav-data clamav clamav-update clamav-milter

Hacking: 

xclip

I use more and more remote X11 applications now, and VNC, since I switched my desktop (and laptops) over to use OSX entirely. This works great. Sometimes, it can be a bit annoying to get the clipboards and selections to synchronize across windows, or even to just get a portion of a file from e.g. X11 into OSX. There's a very useful command for this, that can easily be scripted (and bound) to some key of your own preference. For example, to take the clipboard from an X11 app, and put it into the main selection buffer, you can do

$ xclip -o -selection clip | xclip -i

To put a portion of  a file into both the clipboard and the primary selection:

$ head -10 /etc/group | tee >(xclip) >(xclip -sel clip) > /dev/null

You can obviously make some convenience macros around this, or simple shell scripts.

Hacking: 

Missing emacs symlink on Fedora Core

I just finished installing Fedora Core 16 on a new router I'm planinng on installing up in our little cabin. Things went mostly well, except the symlink to Emacs was missing. The horror! The RPM was most certainly install, but no emacs in my path was to be found. Well, it turns out, for some reason (who knows why ...), the installer did not finish creating the Emacs symlink. It's quite possible it missed other links too, but Emacs was obviously the number one priority. Poking around a little, it was easy to restore life as we know it:

sudo alternatives --install /usr/bin/emacs emacs /usr/bin/emacs-23.3 10

Hacking: 

Ubuntu upgrades and BTRFS snapshots

One of my VMs is running Ubuntu with BTRFS on the boot disk. During an Ubuntu upgrade, I noticed a significant increase in disk space usage, and it turns out Ubuntu created a snapshot on my BTRFS volumes. Now, this is pretty neat, but once I verified everything was working fine, I wanted to delete the old snapshot. It turned out to be a bit more trickier than I though, but with some help from Sami Haahtinen, I got it to work. First, to list the sub volumes, I did

ubuntu-server (16:07) 3/0 $ sudo btrfs subvolume list /
ID 256 top level 5 path @
ID 257 top level 5 path @home
ID 258 top level 5 path @apt-snapshot-release-upgrade-oneiric-2011-10-13_12:41:44

The next step, which was crucial, is to "mount" the full disk BTRFS is using, without specifying a sub-volume:

ubuntu-server (16:09) 4/0 $ sudo mount /dev/mapper/ubuntu--server-slash /mnt

Your disk name will obviously differ (most likely), but after this, you can now delete this sub-volume:

ubuntu-server (16:09) 5/0 $ cd /mnt
ubuntu-server (16:10) 6/0 $ sudo btrfs subvolume delete '@apt-snapshot-release-upgrade-oneiric-2011-10-13_12:41:44'

Hacking: 

Upgrading Ubuntu from command line

Ubuntu 11.10 was just released, and I eagerly decided to upgrade my "server' VM to "Oneiric Ocelot". My installation has no GUI, so I could not use the normal tools I'd use to do the live upgrade. So instead, I had to figure out the command line tools to use. Now, this is well documented, but is still worthwhile to repeat.

$ sudo apt-get install update-manager-core
$ do-release-upgrade -d

That's pretty much it, just follow the destructions on the screen (oh, and recommended not to do this over an ssh session).

Hacking: 

yum failures with missing $releasever

During an upgrade (yum update) on a Fedora VM, something went horribly wrong, and it crashed in the middle of the update. After rebooting, and cleaning up the mess, yum still was very unhappy. Running an update would give me errors like

Could not parse metalink https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=x86_64 error was 
No repomd file
Error: Cannot retrieve repository metadata (repomd.xml) for repository: fedora. Please verify its path and try again

Very odd. It turns out, $releasever was not properly set, and I could not figure out why. Poking around, I realized that $reelasever is supposed to come from examining the version number of a particular RPM package, in my case fedora-release. Well, lo and behold, this package was no longer installed on my box, yum must have uninstalled it, but crashed before installing the new update (or something...). I mounted the Fedora Core DVD, and simple reinstalled the missing package, and things are happy joy joy again. Here's the command:

$ sudo rpm -i ./Packages/fedora-release-13-1.noarch.rpm

 

Hacking: 

Pages

Subscribe to RSS - Linux