Pages

28 October 2014

599. Briefly: Suddenly bankid doesn't work/wont be recognised.

The system: firefox 31, nspluginwrapper 1.4.4, debian wheezy, amd64

I've used bankid with Swedish banks in the past. Right now I'm running into trouble though. When clicking on the login button on the bank website I'm taken to this page:
Starting firefox (v31, but the symlink is called firefox25) from the terminal to catch the error messages I get
(firefox25:5555): GLib-GObject-WARNING **: /tmp/buildd/glib2.0-2.33.12+really2.32.4/./gobject/gsignal.c:3397: signal name `load_complete' is invalid for instance `0x2b81340fc1f0' Gtk-Message: Failed to load module "atk-bridge" *** NSPlugin Viewer *** ERROR: NP_Initialize() get args: Message argument mismatch *** NSPlugin Viewer *** ERROR: rpc_end_sync called when not in sync! *** NSPlugin Wrapper *** ERROR: NP_Initialize() wait for reply: Connection closed Gtk-Message: Failed to load module "atk-bridge" *** NSPlugin Viewer *** ERROR: NP_Initialize() get args: Message argument mismatch *** NSPlugin Viewer *** ERROR: rpc_end_sync called when not in sync! *** NSPlugin Wrapper *** ERROR: NP_Initialize() wait for reply: Connection closed Gtk-Message: Failed to load module "atk-bridge" *** NSPlugin Viewer *** ERROR: NP_Initialize() get args: Message argument mismatch *** NSPlugin Viewer *** ERROR: rpc_end_sync called when not in sync! *** NSPlugin Wrapper *** ERROR: NP_Initialize() wait for reply: Connection closed Gtk-Message: Failed to load module "atk-bridge" *** NSPlugin Viewer *** ERROR: NP_Initialize() get args: Message argument mismatch *** NSPlugin Viewer *** ERROR: rpc_end_sync called when not in sync! *** NSPlugin Wrapper *** ERROR: NP_Initialize() wait for reply: Connection closed Gtk-Message: Failed to load module "atk-bridge" *** NSPlugin Viewer *** ERROR: NP_Initialize() get args: Message argument mismatch *** NSPlugin Viewer *** ERROR: rpc_end_sync called when not in sync! *** NSPlugin Wrapper *** ERROR: NP_Initialize() wait for reply: Connection closed Gtk-Message: Failed to load module "atk-bridge" *** NSPlugin Viewer *** ERROR: NP_Initialize() get args: Message argument mismatch *** NSPlugin Viewer *** ERROR: rpc_end_sync called when not in sync! *** NSPlugin Wrapper *** ERROR: NP_Initialize() wait for reply: Connection closed Gtk-Message: Failed to load module "atk-bridge" *** NSPlugin Viewer *** ERROR: NP_Initialize() get args: Message argument mismatch *** NSPlugin Viewer *** ERROR: rpc_end_sync called when not in sync! *** NSPlugin Wrapper *** ERROR: NP_Initialize() wait for reply: Connection closed (firefox25:5555): GLib-GObject-WARNING **: /tmp/buildd/glib2.0-2.33.12+really2.32.4/./gobject/gsignal.c:3397: signal name `load_complete' is invalid for instance `0x2b812a4f52e0'

The solution was to do
/usr/lib/nspluginwrapper/x86_64/linux/npconfig  -a -v -u
Auto-update plugins from /usr/lib/mozilla/plugins Looking for plugins in /usr/lib/mozilla/plugins Auto-update plugins from /home/me/.mozilla/plugins Looking for plugins in /home/me/.mozilla/plugins Update plugin /home/me/.mozilla/plugins/npwrapper.libplugins.so nspluginwrapper ident mismatch, reinstalling plugin Install plugin /usr/local/lib/personal/libplugins.so into /home/me/.mozilla/plugins/npwrapper.libplugins.so

as described by the nspluginwrapper maintainer (David) in a reply on http://www.geeklab.info/2011/11/reconfigure-nspluginwrapper/

24 October 2014

598. Move /var, /tmp, /opt to separate partitions

1. First create the partitions on a disk. In my case I created partitions on a different disk from the root partition.

2. Figure out the uuids:
ls /dev/disk/by-uuid -lah
lrwxrwxrwx 1 root root 10 Oct 22 14:02 28b59809-7dfb-4ce4-a4da-6f118171ea07 -> ../../sdb2 lrwxrwxrwx 1 root root 9 Oct 22 14:45 52f07f83-3a72-457c-b25f-7aa4f3e76461 -> ../../sdc lrwxrwxrwx 1 root root 10 Oct 7 14:42 8a5ca4ae-9963-47ea-99c3-2335c7dc8118 -> ../../sda6 lrwxrwxrwx 1 root root 10 Oct 7 14:42 9243ff6b-9834-4fa3-a93f-10a350f85687 -> ../../sda1 lrwxrwxrwx 1 root root 10 Oct 22 14:02 9f785dde-1d3a-4063-90e7-054f3d031e05 -> ../../sdb3 lrwxrwxrwx 1 root root 10 Oct 22 14:02 eacf2cad-d462-45b2-afeb-2c5ddf5669b8 -> ../../sdb4 lrwxrwxrwx 1 root root 10 Oct 7 14:42 f25a484c-e8e2-4ead-808b-96dd5e915020 -> ../../sda5 lrwxrwxrwx 1 root root 10 Oct 22 14:02 f4280c34-04d6-4def-963a-507e68dd483d -> ../../sdb1
I know that I'm looking for sbd2 (label: tmp), sdb3 (label: opt) and sdb4 (label: var). We'll use these uuids later for our /etc/fstab

3. Move /opt, as it's the easiest (should be reasonably static).

sudo udisks --mount /dev/sdb3
Mounted /org/freedesktop/UDisks/devices/sdb3 at /media/opt
sudo cp -ax /opt/* /media/opt

Edit /etc/fstab:
 
UUID=9f785dde-1d3a-4063-90e7-054f3d031e05 /opt ext4 defaults,user_xattr 0 2

Move the old /opt and mount the new one:
sudo mv /opt /opt.old
sudo mount /opt

And you should be good to go. Check with df -h:
[..] /dev/sdb3 72G 28G 41G 41% /opt

4. Move /var and /tmp

You can use init 1 according to http://unix.stackexchange.com/questions/131311/moving-var-home-to-separate-partition. Note that doing so will kill your graphical session and stop or restart most of the services i.e. close open documents before your continue. You'll then get dumped into a vty.

Open a terminal and type
 
init 1

which dumps you into a root terminal. Then, as root, do
 
mkdir /media/var
mount /dev/sdb4 /media/var
cp -ax /var/* /media/var
mkdir /media/tmp
mount /dev/sdb2 /media/tmp
cp -ax /tmp/* /media/tmp
mv /tmp /tmp.old
mv /var /var.old
mkdir /tmp
chmod 777 /tmp
mkdir /var
umount /media/var
umount /media/tmp

Changing the permissions for /tmp is important -- if they aren't generous enough it can cause all sorts of issues. In my case it was manifested by me being unable to log onto a GUI (e.g. gnome) from GDM3 -- I would get booted back to the login screen.

Edit /etc/fstab and add:
UUID=28b59809-7dfb-4ce4-a4da-6f118171ea07 /tmp ext4 defaults,user_xattr 0 2 UUID=eacf2cad-d462-45b2-afeb-2c5ddf5669b8 /var ext4 defaults,user_xattr 0 2
Note: I don't know what the best values for the attributes are. I just took what I used for /home, which is probably not optimal. You may want to do your own research into this. Then do

mount /tmp
mount /var
init 2

Once you've established that all is well you can delete /var.old and /tmp.old.
df -h shows
Filesystem Size Used Avail Use% Mounted on rootfs 92G 32G 56G 37% / udev 10M 0 10M 0% /dev tmpfs 798M 1.1M 797M 1% /run /dev/disk/by-uuid/9243ff6b-9834-4fa3-a93f-10a350f85687 92G 32G 56G 37% / tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 4.6G 88K 4.6G 1% /run/shm /dev/sda6 734G 555G 142G 80% /home /dev/sdb3 72G 28G 41G 41% /opt /dev/sdb2 72G 53M 69G 1% /tmp /dev/sdb4 48G 8.8G 37G 20% /var

597. Missing partition -- gparted shows unallocated space

The issue:
I'm low on space on my / partition since ECCE has a way of putting really large files in /tmp. Rather than trying to fix the behaviour of ECCE, I'm planning on moving /tmp to a separate disk that's dedicated to highio processes and where ECCE can't cause my / to fill up. I might move /opt as well, to free even more space. The first step in such a move is to create an additional partition on your target disk and for that gparted is good as it can move all the data before creating the new partition.

Imagine my surprise when I fired up gparted and saw:

Using Disk Utilities (palimpsest) it doesn't look too odd:

Using fdisk I see a complete lack of partitions:
sudo fdisk /dev/sdb
Command (m for help): p Disk /dev/sdb: 1000 GB, 1000202273280 bytes 255 heads, 63 sectors/track, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System Command (m for help):

This may be a job for testdisk. I fired it up with sudo, selected Intel type partition, and kept selecting the defaults -- eventually my partition showed up. I then did a deep search to make sure everything was ok.






I then check using palimpsest and gparted:





(I also screwed up, then fixed a disk with a different issue -- but because I'm not really sure what I did to fix it I'll make a separate post about that at a later date. Maybe.)

17 October 2014

596. Debian Jessie -- shutdown takes 'forever' (five minutes according to stopwatch!)

I've been annoyed for a couple of months now that shutting down my laptop, which has an SSD, takes up to five minutes. If I wanted that kind of shutdown times I could run Windows Vista...

Either way, it turns out that it's affecting certain systems with samba:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=762002

The issue is illustrated below, which showed that it took five minutes to shut down samba -- and that's what's preventing the system from shutting down:
 
sudo service samba stop
ps aux|grep sam && date
root 2765 0.0 0.0 65468 2100 pts/0 S+ 10:45 0:00 sudo service samba stop root 2766 0.0 0.0 26252 1172 pts/0 S+ 10:45 0:00 systemctl stop samba.service root 2785 0.0 0.0 4308 636 ? Ss 10:45 0:00 /bin/sh /etc/init.d/samba stop Sunday 12 October 10:49:28 AEDT 2014
The solution is pretty simple though -- remove a set of symlinks:

First establish that they are present:
me@oxygen:/etc$ find rc* -name "*samba*"|xargs -I {} ls {} -lah
lrwxrwxrwx 1 root root 15 Sep 16  2013 rc0.d/K01samba -> ../init.d/samba
lrwxrwxrwx 1 root root 21 Sep 15 10:46 rc0.d/K01samba-ad-dc -> ../init.d/samba-ad-dc
lrwxrwxrwx 1 root root 15 Sep 16  2013 rc1.d/K01samba -> ../init.d/samba
lrwxrwxrwx 1 root root 21 Sep 15 10:46 rc1.d/K01samba-ad-dc -> ../init.d/samba-ad-dc
lrwxrwxrwx 1 root root 15 Sep 16  2013 rc2.d/S01samba -> ../init.d/samba
lrwxrwxrwx 1 root root 21 Sep 15 10:46 rc2.d/S01samba-ad-dc -> ../init.d/samba-ad-dc
lrwxrwxrwx 1 root root 15 Sep 16  2013 rc3.d/S01samba -> ../init.d/samba
lrwxrwxrwx 1 root root 21 Sep 15 10:46 rc3.d/S01samba-ad-dc -> ../init.d/samba-ad-dc
lrwxrwxrwx 1 root root 15 Sep 16  2013 rc4.d/S01samba -> ../init.d/samba
lrwxrwxrwx 1 root root 21 Sep 15 10:46 rc4.d/S01samba-ad-dc -> ../init.d/samba-ad-dc
lrwxrwxrwx 1 root root 15 Sep 16  2013 rc5.d/S01samba -> ../init.d/samba
lrwxrwxrwx 1 root root 21 Sep 15 10:46 rc5.d/S01samba-ad-dc -> ../init.d/samba-ad-dc
lrwxrwxrwx 1 root root 15 Sep 16  2013 rc6.d/K01samba -> ../init.d/samba
lrwxrwxrwx 1 root root 21 Sep 15 10:46 rc6.d/K01samba-ad-dc -> ../init.d/samba-ad-dc

Then remove them:
me@oxygen:/etc$ sudo update-rc.d samba remove 
me@oxygen:/etc$ sudo update-rc.d smbd remove 
Done!

10 October 2014

595. Issue upgrading debian jessie -- stuck at systemd

Doing a dist-upgrade yesterday (9th of October 2014) it failed because of issues with configuring systemd. In the end my troubleshooting didn't help, but google did.

Dead-end troubleshooting:

Trying to work through it:
sudo apt-get dist-upgrade Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these. The following packages have unmet dependencies: systemd-sysv : Depends: systemd (= 208-8) but 215-5+b1 is installed E: Unmet dependencies. Try using -f.
Checking why systemd-sysv is mentioning 208-8 instead of 215-5:
apt-cache policy systemd-sysv systemd-sysv: Installed: 208-8 Candidate: 215-5+b1 Version table: 215-5+b1 0 500 http://ftp.iinet.net.au/debian/debian/ testing/main amd64 Packages *** 208-8 0 100 /var/lib/dpkg/status
Let's try forcing 215-5:
sudo apt-get install systemd-sysv=215-5+b1 Reading package lists... Done Building dependency tree Reading state information... Done [..] The following packages will be upgraded: systemd-sysv 1 upgraded, 0 newly installed, 0 to remove and 531 not upgraded. 422 not fully installed or removed. Need to get 0 B/29.1 kB of archives. After this operation, 3,072 B of additional disk space will be used. Retrieving bug reports... Done Parsing Found/Fixed information... Done Setting up systemd (215-5+b1) ... dpkg: error processing package systemd (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: systemd E: Sub-process /usr/bin/dpkg returned an error code (1)
OK, let's try working on systemd:
sudo dpkg -D2 --configure systemd Setting up systemd (215-5+b1) ... D000002: fork/exec /var/lib/dpkg/info/systemd.postinst ( configure 208-8 ) dpkg: error processing package systemd (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: systemd

Solving it:
No luck. Google wasn't too helpful initially, until I came across https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=762275
sudo delgroup systemd-journal Removing group `systemd-journal' ... Done.
Then tried
sudo dpkg -D2 --configure systemd Setting up systemd (215-5+b1) ... D000002: fork/exec /var/lib/dpkg/info/systemd.postinst ( configure 208-8 ) /var/lib/dpkg/info/systemd.postinst: 128: /var/lib/dpkg/info/systemd.postinst: cannot open /run/systemd/was-enabled: No such file
and
sudo apt-get install -f [..] Do you want to continue? [Y/n] Y Retrieving bug reports... Done Parsing Found/Fixed information... Done (Reading database ... 462023 files and directories currently installed.) Preparing to unpack .../systemd-sysv_215-5+b1_amd64.deb ... Unpacking systemd-sysv (215-5+b1) over (208-8) ... Processing triggers for man-db (2.6.7.1-1) ... Setting up systemd-sysv (215-5+b1) ... [..]
and then
sudo apt-get dist-upgrade
works again!

Many reasons to dislike systemd, although in this case I guess it's poor packaging.