Bembel-B Blog

2007/05/23

Some More Ubuntu Feisty Fixes and Findings

This is an update to my previous posting about Ubuntu Feisty Fawn problems. Most have been resolved, some only further analyzed.
Ubuntu Logo

Automount for smb shares (preferably with cifs)

Mounting of Windows XP and Fedora Samba (Browse and Domain Master and Wins Server) shares could finally be solved by using smbfs as filesystem type.
The strange thing is, when mounting via commandline neither specifying smbfs nor cifs did work correctly. But when leaving the filesystem option out, it worked and was mounted automatically as smbfs:

# mount //192.168.0.111/roms ~/mnt/roms -o username=usersmb,password=passsmb

The automount map provided with Ubuntu did not work (uses cifs). As I already had tried another map as described at HowtoForge, I used that one and simply set it to use smbfs instead of cifs. And voila, shares being correctly mounted!

This is my /etc/auto.master

#
# $Id: auto.master,v 1.4 2005/01/04 14:36:54 raven Exp $
#
# Sample auto.master file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).
#/misc  /etc/auto.misc --timeout=60
#/smb   /etc/auto.smb
#/misc  /etc/auto.misc
#/net   /etc/auto.net

/samba  /etc/auto.smbfs --timeout=300

And the working /etc/auto.smbfs

#!/bin/bash
# $Id$
# This file must be executable to work! chmod 755!
key="$1"
# Note: create a cred file for each windows/Samba-Server in your network
#       which requires password authentification.  The file should contain
#       exactly two lines:
#          username=user
#          password=*****
#       Please don't use blank spaces to separate the equal sign from the
#       user account name or password.
credfile="/etc/auto.smb.$key"
mountopts="-fstype=smbfs,file_mode=0644,dir_mode=0755,uid=scheff,gid=users"
smbclientopts=""
for P in /bin /sbin /usr/bin /usr/sbin
do
        if [ -x $P/smbclient ]
        then
                SMBCLIENT=$P/smbclient
                break
        fi
done
[ -x $SMBCLIENT ] || exit 1
if [ -e "$credfile" ]
then
        mountopts=$mountopts",credentials=$credfile"
        smbclientopts="-A "$credfile
else
        smbclientopts="-N"
fi
$SMBCLIENT $smbclientopts -gL $key 2>/dev/null \
   | awk -v key="$key" -v opts="$mountopts" -F'|' -- '
        BEGIN   { ORS=""; first=1 }
        /Disk/  { if (first) { print opts; first=0 }; 
                  sub(/ /, "\\ ", $2); 
                  print " \\\n\t /" $2, "://" key "/" $2 }
        END     { if (!first) print "\n"; else exit 1 }
        '

Note there’ll have to be credential files for each host named /etc/auto.smb.hostname and you’ll have to set the needed user/group in the mountopts variable above.

To have the other clients (than the Browse Master) mounted by host name and not IP address (i.e. /samba/someclient instead of /samba/192.168.0.123), I had to configure Samba on my Ubuntu box to use the Fedora machine as Wins Server. Not sure if that’s really necessary. Might be the Firewall blocking broadcasts, but on the other hand I had disabled the Firewall completely during tests IIRC.

I’m still wondering, why it didn’t work right out of the box. Other people don’t seem to have these problems. The error was quite strange. The mount command succeeded, but the shares only contained infinite empty folders like this:

ls /samba/host1
share1
share2
share3
ls /samba/host1/share1
share2
share3
ls /samba/host1/share1/share2
share1
share3

Kind of weird reciprocal directories.. :)

Improve keyboard configuration like inputrc, tab completition, vim as setup in Fedora

What’s still missing in my keyboard setup for the terminal is the possibility, to switch between insert and overwrite mode using the Ins key. Also the special character keys (like “ß” or “°”) using the normal text terminal (not via X) are not accessible. But scrolling to the first and last bash history entry with PageUp and PageDown does work now with the following changes.

diff /etc/inputrc.orig /etc/inputrc

12c12
< # set convert-meta off
---
> set convert-meta off
23a24,27
> # Completed names which are symbolic links to
> # directories have a slash appended.
> set mark-symlinked-directories on
> 
37,38c41,42
< # "\e[5~": beginning-of-history
< # "\e[6~": end-of-history
---
> "\e[5~": beginning-of-history
> "\e[6~": end-of-history

Other things still prevail, but I didn’t investigate yet. Whats annoying with the Tab Completition is, that it wouldn’t complete something like ~/*.txt. When there are possible alternations in the middle of a word/path, completition won’t work. But it was working under Fedora.

And regarding vim, whenever I’m in Insert Mode, using Ctrl+Left or Ctrl+Right results in a new line with some Escape Sequences garbage, instead of jumping to the previous/next word. There’s probably more differences, but I’ll simply have to compare my old Fedora vim config to the Ubuntu one.

A working ssh-agent and gpg-agent setup (preferably with Seahorse)

The integration of Seahorse (seahorse-1.0.1-0ubuntu1) seems to be in an early stage and buggy. I couldn’t manage to get it coexisting with gpg-agent and ssh-agent. The agent wouldn’t be found, would crash or stall, or simply won’t process the passwords I typed. The best thing would be, to drop Seahorse and simply use the two standard agents.

Crackling sound with Amarok and web streams (xine engine)

I found the noise to be coming from the ogg decoder plugin of xine (libxine1-1.1.4-2ubuntu3) and only for files with low sample frequency. When playing the same file or stream (used this for testing) with mplayer it sounded perfect. I played a little with the ~/.xine/config lowering the priority of the ogg plugin and also removed /usr/lib/xine/plugins/1.1.4/xineplug_dmx_ogg.so, but there’s no other plugin available for ogg decoding on my system (shouldn’t ffmpeg be able to do that?). Then I rebuilt the libxine1 packages, but sadly the sound was as bad as with the official build. So, I hope there’ll soon be a fixed libxine1 package or alternatively build my own with the needed modifications (new ogg/vorbis libs?).

ChangeLog

[070530 More details on xine ogg decoder noise. Fix markup of inputrc diff.]
[070923 Fix backslashes (”\\” markup was meanwhile rendered as “\\” and not “\” as before.]

Advertisements

Create a free website or blog at WordPress.com.