Tuesday, April 22, 2008

Samba - smbd: Unable to open printcap file /etc/printcap for read!

To stop samba from filling the log with entries like those:

Apr 22 13:34:30 unnamedsrv smbd[868]: [2008/04/22 13:34:30, 0] printing/pcap.c:pcap_cache_reload(159)
Apr 22 13:34:30 unnamedsrv smbd[868]: Unable to open printcap file /etc/printcap for read!

add following lines to your samba configuration file “/etc/samba/smb.conf”:

load printers = no
printcap name = /dev/null

You don’t have to restart your samba server, it re-reads the configuration by itself.

Information Source: http://ubuntuforums.org/showthread.php?t=232144

Posted by schmidi2 at 13:05:45 | Permalink | No Comments »

Sunday, September 30, 2007

ping: icmp open socket: Operation not permitted on ubuntu

Since an update the ping command stopped working on my ubuntu system. I always get to error “ping: icmp open socket: Operation not permitted”. Because I don’t wan’t to always use sudo with ping, I did following change on my system:

$ ls -al /bin/ping
-rwxr-xr-x 1 root root 27140 2006-12-19 21:35 /bin/ping

is WRONG. ping must have the SUID-flag!

$ sudo chmod u+s /bin/ping

$ ls -al /bin/ping
-rwsr-xr-x 1 root root 27140 2006-12-19 21:35 /bin/ping

Now it works again

Posted by schmidi2 at 16:13:59 | Permalink | No Comments »

su: Authentication failure on ubuntu

Since an update the su command stopped working on my ubuntu system. I always get to error “su: Authentication failure” when typing the right password. Because I need this command, I did following change on my system:

$ ls -al /bin/su
-rwxr-xr-x 1 root root 27140 2006-12-19 21:35 /bin/su

is WRONG. su must have the SUID-flag!

$ sudo chmod u+s /bin/su

$ ls -al /bin/su
-rwsr-xr-x 1 root root 27140 2006-12-19 21:35 /bin/su

 

Yea I know there is sudo. But nobody has the right to forbid me using su if I want to.

Posted by schmidi2 at 16:07:57 | Permalink | No Comments »

Tuesday, September 18, 2007

configure: error: compiler cannot create executables

The error message “checking for C compiler default output file name… configure: error: C compiler cannot create executables” did I get today when trying to configure maildrop (v. 2.0.4).

/usr/src/maildrop/maildrop-2.0.4$ ./configure
checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for gawk… no
checking for mawk… mawk
checking whether make sets $(MAKE)… no
checking for gcc… gcc
checking for C compiler default output file name… configure: error: C compiler cannot create executables
See `config.log’ for more details.

In the file “config.log” you find these lines:


configure:2326: checking for C compiler default output file name
configure:2329: gcc    conftest.c  >&5
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
configure:2332: $? = 1
configure: failed program was:
| /* confdefs.h.  */
|
| #define PACKAGE_NAME “maildrop”

configure:2371: error: C compiler cannot create executables
See `config.log’ for more details.

configure: exit 77

So the file “crt1.o” is missing. Year, the package libc6-dev isn’t installed:

$ sudo apt-get install libc6-dev

Now it works! 

Posted by schmidi2 at 15:24:30 | Permalink | No Comments »

Wednesday, August 15, 2007

Two instances of dovecot: pop3 and imap separated

On my mailserver runs postfix with dovecot. All authentication-data is stored in a mysql-table.

To be able to separate pop3-users from imap-users, respectively disable pop3/imap for specific accounts I had to create two dovecot instances. Please note that I don’t use the LDA from dovecot but maildrop otherwise it could become a little bit complicated.

HowTo install and run two separate dovecot instances 

First there must be two config-directories: “/etc/dovecot-pop3d/” and “/etc/dovecot-imapd/” (make copies from “/etc/dovecot/”). The same steps you have to do in “/var/run/” too (here make copies from “/var/run/dovecot/” of corse).

Below is the my configuration file of the imapd-dovecot (/etc/dovecot-imapd/dovecot.conf). To get the pop3d-version you have to edit the lines 1, 2, 22, 25 and 32.

protocols = imap
base_dir = /var/run/dovecot-imapd/
mail_location = maildir:/var/vmail/%d/%u
mail_extra_groups = mail
# Required: Must have UID of vmail
first_valid_uid = 107
last_valid_uid = 107
pop3_uidl_format = %08Xu%08Xv
maildir_copy_with_hardlinks = yes
disable_plaintext_auth = no
protocol imap {
        mail_plugins = quota imap_quota
        imap_client_workarounds = outlook-idle delay-newmail
}
protocol lda {
        postmaster_address = noaccount@t-p.com
        mail_plugins = quota
}
auth default {
        mechanisms = plain
        passdb sql {
                args = /etc/dovecot-imapd/dovecot-sql.conf
        }
        userdb sql {
                args = /etc/dovecot-imapd/dovecot-sql.conf
        }
        userdb prefetch {
        }
        user = nobody
        socket listen {
                master {
                        path = /var/run/dovecot-imapd/auth-master
                        mode = 0660
                        user = vmail
                        group = mail
                }
        }
}
dict {
}
plugin {
        quota = maildir:storage=10240
}

Also create your own “/etc/dovecot-imapd/dovecot-sql.conf”-file (example).

Now you to create some start/stop-scripts. To do that make two copies of “/etc/init.d/dovecot” named “dovecot-imapd” and “dovecot-pop3d” and change it this way:

$ diff /etc/init.d/dovecot /etc/init.d/dovecot-imapd
23c23,24
< NAME=dovecot

> DAEMON_OPTS=”-c /etc/dovecot-imapd/dovecot.conf”
> NAME=dovecot-imapd
35c36
<     /etc/dovecot/dovecot.conf`

>     /etc/dovecot-imapd/dovecot.conf`
45c46
<     if grep protocols /etc/dovecot/dovecot.conf | sed ’s/#.*$//’ | tr -d ‘”‘ | \

>     if grep protocols /etc/dovecot-imapd/dovecot.conf | sed ’s/#.*$//’ | tr -d ‘”‘ | \
52c53
<         start-stop-daemon –start –quiet –oknodo –exec $DAEMON

>         start-stop-daemon –start –quiet –oknodo –name $NAME –exec $DAEMON — $DAEMON_OPTS
59c60
<     start-stop-daemon –stop –quiet –oknodo –exec $DAEMON

>     start-stop-daemon –stop –quiet –oknodo –pidfile /var/run/dovecot-imapd/master.pid
82c83
<     start-stop-daemon –stop –quiet –oknodo –exec $DAEMON

>     start-stop-daemon –stop –quiet –oknodo –pidfile /var/run/dovecot-imapd/master.pid
84c85
<     start-stop-daemon –start –quiet –oknodo –exec $DAEMON

>     start-stop-daemon –start –quiet –oknodo –name $NAME –exec $DAEMON

This is again only for imapd, you can create by yourself the pop3d-version. Now make suitable symlinks in “/etc/rc?.d/” (I created them manually) to start/stop these daemons automatically. At the end remove the old script “/etc/init.d/dovecot” and all its links in “/etc/rc?.d/”.

Maybe there will be a own package for this someday.  

Source:
www.dovecot.org
http://wiki.dovecot.org/AuthDatabase/SQL

 

Posted by schmidi2 at 11:14:33 | Permalink | No Comments »

Tuesday, August 14, 2007

VMware eth0: ERROR while getting interface flags: No such device

When you first start a virtual machine (with a linux system) after moving, copying or downloading it from the internet, you will be prompted with the question whether you want to create a new identifier or not. If you click “Create”, you will probably don’t have network connection anymore in your virtual machine. This is because vmware changes the MAC-address of all ethernet-cards and linux detects a new but currently unconfigured network device.

$ sudo /etc/init.d/networking start
SIOCSIFADDR: No such device
eth0: ERROR while getting interface flags: No such device
SIOCSIFNETMASK: No such device
eth0: ERROR while getting interface flags: No such device
Failed to bring up eth0.

There are three ways to solve this problem:

Prevent
Click on the button “Keep” of the dialog prompted at the first start of the virtual machine after its store-position has changed (moving the directory of the virtual machine to a new location causes vmware to reshow this dialog).

Solve the right way
Edit the file “/etc/udev/rules.d/z25_persistent-net.rules”. You know by yourself what you have to do. If the file doesn’t exist,  go to “Solve the right way 2″. Else restart now udev with the command “/etc/init.d/udev restart” or reboot your system.

Solve the right way 2
Create the file “/etc/udev/rules.d/10_local.rules” and insert
KERNEL="eth*", SYSFS{address}="00:X0:18:ea:18:40", NAME="ethunten"
Don’t forget to replace the MAC-addres. Execute “udevtest /sys/class/net/eth0 net” and reboot your system.

Get backup
Replace the changed vmx-file with a backup (but I don’t belive you made one).

Live with it
When executing “ifconfig -a” you see the new network device (its probably called eth1, if you only have one network device).

 

Source:
http://www.debianhelp.co.uk/udev.htm
http://sicherheitsschwankung.de/post/jan/2005-10-13/renaming-network-devices-udev

 

Posted by schmidi2 at 18:10:14 | Permalink | No Comments »

Monday, July 2, 2007

Unable to install vmware-player

Today I get the job to become acquainted with our .net projects (I dislike .net from microsoft because it’s a poor clone of java). First I had to install the vmware player to be able to run a windows system on my linux host and then install the visual studio stuff.

Sounds simple, but it was first impossible to compile runnable kernel modules required by vmware. And after I managed that with many dirty workarounds, vmplayer didn’t even start.

My workarounds:
I had to manually download and install the stable version (downgrade) of the packages cpp, gcc-4.1, gcc-4.1-base, libssp0 and module-init-tools. Now I have unmet dependencies (but I will upgrade them again immediately after successfully compiling the modules).

cpp-4.1_4.1.1-21_i386.deb
gcc-4.1_4.1.1-21_i386.deb
gcc-4.1-base_4.1.1-21_i386.deb
libssp0_4.1.1-21_i386.deb
module-init-tools_3.3-pre4-2_i386.deb

 

At least, trying to start vmplayer caused this error:

$ vmplayer
/usr/lib/vmware/bin/vmplayer: symbol lookup error: /usr/lib/vmware/lib/libvmwareui.so.0/libvmwareui.so.0: undefined symbol: _ZN3Gtk13RecentManager11get_defaultEv

I have already used too much time trying to solve this problem, I had to stop at this point.

Solution: Wait with upgrading your debian testing-system, if you wan’t a working vmware-environment. How long? Don’t know. I am sure the problem is because of one or more (many?) bug(s) in the current testing package-repository of debian.

Source:
http://www.vmware.com/community/thread.jspa?threadID=85481
http://www.vmware.com/community/thread.jspa?threadID=85612
http://www.vmware.com/community/thread.jspa?messageID=684669

 

Posted by schmidi2 at 18:23:32 | Permalink | No Comments »

Upgrade of my debian workstation

Yesterday evening I upgraded my linux system (Debian testing). 

$ sudo apt-get update
$ sudo apt-get upgrade

After downloading and installing the new packages, I checked again with “$ sudo apt-get upgrade” if really all packages are now up to date: No! I got this output:


0 upgraded, 0 newly installed, 0 to remove and 250 not upgraded.

 

Solution:
If you have a debian testing-system, always upgrade your software with:

$ sudo apt-get update
$ sudo apt-get dist-upgrade

Posted by schmidi2 at 18:02:28 | Permalink | No Comments »

Sunday, July 1, 2007

VMachine-Host:: rtc: lost some interrupts at 512Hz.

For our VMachine-Hosts I used Debian Etch (as usual for linux systems). Linux kernel: 2.6.18-4-686

Quit fast I run into some problems with the rtc-interrupt. My syslog-file did contain nearly only these messages:

Jun 30 06:17:01 fakename kernel: rtc: lost some interrupts at 512Hz.
Jun 30 06:17:32 fakename last message repeated 1513 times

Also the hole screen was filled with the message “rtc: lost some interrupts at 512Hz”.

Well, actually I could ignore these messages because the VMachines run without problems. Except that the time ticked too slow (Daily ntp update, at midday the clock was about an hour behind the real time). But this could be fixed with hourly ntp updates. This was my temporary solution.

I found the final solution rather by the way (the first VMachine-Host was installed by my boss and he installed Sidux (after knoppix, kanotix, pclinux he prefers now sidux), there didn’t occour a problem like that). It seems that those two kernel images/modules are a little bit different (not only the version).

Solution: Get the newest sidux kernel (I use 2.6.20.1-slh-smp-2), the modules and headers.

 

Source:
www.sidux.com
www.vmware.com

Posted by schmidi2 at 18:55:34 | Permalink | Comments (2)