Archive for the ‘Linux/Unix’ Category

Standard Linux/Unix error codes

Tuesday, October 27th, 2009

As a System Administrator I will often come across a system error code in a log file and need to look up what it means. I don’t know about you, but I don’t know that error 107 is “Transport endpoint is not connected” off the top of my head. My solution was a small Perl script that will print the error’s meaning or optionally all known error codes and their meaning. The perl code is below this listing of error codes.

001: Operation not permitted
002: No such file or directory
003: No such process
004: Interrupted system call
005: Input/output error
006: No such device or address
007: Argument list too long
008: Exec format error
009: Bad file descriptor
010: No child processes
011: Resource temporarily unavailable
012: Cannot allocate memory
013: Permission denied
014: Bad address
015: Block device required
016: Device or resource busy
017: File exists
018: Invalid cross-device link
019: No such device
020: Not a directory
021: Is a directory
022: Invalid argument
023: Too many open files in system
024: Too many open files
025: Inappropriate ioctl for device
026: Text file busy
027: File too large
028: No space left on device
029: Illegal seek
030: Read-only file system
031: Too many links
032: Broken pipe
033: Numerical argument out of domain
034: Numerical result out of range
035: Resource deadlock avoided
036: File name too long
037: No locks available
038: Function not implemented
039: Directory not empty
040: Too many levels of symbolic links
042: No message of desired type
043: Identifier removed
044: Channel number out of range
045: Level 2 not synchronized
046: Level 3 halted
047: Level 3 reset
048: Link number out of range
049: Protocol driver not attached
050: No CSI structure available
051: Level 2 halted
052: Invalid exchange
053: Invalid request descriptor
054: Exchange full
055: No anode
056: Invalid request code
057: Invalid slot
059: Bad font file format
060: Device not a stream
061: No data available
062: Timer expired
063: Out of streams resources
064: Machine is not on the network
065: Package not installed
066: Object is remote
067: Link has been severed
068: Advertise error
069: Srmount error
070: Communication error on send
071: Protocol error
072: Multihop attempted
073: RFS specific error
074: Bad message
075: Value too large for defined data type
076: Name not unique on network
077: File descriptor in bad state
078: Remote address changed
079: Can not access a needed shared library
080: Accessing a corrupted shared library
081: .lib section in a.out corrupted
082: Attempting to link in too many shared libraries
083: Cannot exec a shared library directly
084: Invalid or incomplete multibyte or wide character
085: Interrupted system call should be restarted
086: Streams pipe error
087: Too many users
088: Socket operation on non-socket
089: Destination address required
090: Message too long
091: Protocol wrong type for socket
092: Protocol not available
093: Protocol not supported
094: Socket type not supported
095: Operation not supported
096: Protocol family not supported
097: Address family not supported by protocol
098: Address already in use
099: Cannot assign requested address
100: Network is down
101: Network is unreachable
102: Network dropped connection on reset
103: Software caused connection abort
104: Connection reset by peer
105: No buffer space available
106: Transport endpoint is already connected
107: Transport endpoint is not connected
108: Cannot send after transport endpoint shutdown
109: Too many references: cannot splice
110: Connection timed out
111: Connection refused
112: Host is down
113: No route to host
114: Operation already in progress
115: Operation now in progress
116: Stale NFS file handle
117: Structure needs cleaning
118: Not a XENIX named type file
119: No XENIX semaphores available
120: Is a named type file
121: Remote I/O error
122: Disk quota exceeded
123: No medium found
124: Wrong medium type
125: Operation canceled

Code

#!/usr/bin/perl
#
# print out system error strings

use strict;
use warnings;

my $errText = "";

if(!defined($ARGV[0])) {
    for ($! = 1; $! <= 10000; $!++) {
        $errText = $!;
        chomp($errText);
        if(!($! =~ m/^unknown error/i)) {
            printf("%03d: %s\n", $!, $errText);
        }
    }
}
else {
    $! = $ARGV[0];
    $errText = $!;
    printf("%03d: %s\n", $!, $errText);
}


Gentoo – sys-libs/com_err blocking

Tuesday, November 18th, 2008

If you get errors about com_err blocking on your Gentoo system then you are probably experiencing a portage bug.

I was trying to install nfs-utils and received this error (shown in part):

[blocks B     ] <sys-fs/e2fsprogs-1.41 (is blocking sys-libs/e2fsprogs-libs-1.41.0)
[blocks B     ] sys-libs/ss (is blocking sys-libs/e2fsprogs-libs-1.41.0)
[blocks B     ] sys-libs/com_err (is blocking sys-libs/e2fsprogs-libs-1.41.0)

Some Google-ing led me to the following Gentoo bug and a solution. (See comment number 7)

http://bugs.gentoo.org/show_bug.cgi?id=234907#c7

Configuring Postfix to use SMTP authentication when sending mail

Sunday, November 9th, 2008

My ISP requires SMTP authentication before one can send email. I have reconfigured several instances of Postfix to use this method and am going to document the necessary changes here for my reference.

add the following two lines to /etc/postfix/main.cf

smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/smtp_auth

add the following lines to /etc/postfix/transport (replace “smtpauth.centurytel.net” with your ISPs smtp server)

localhost       local:
*                       smtp:smtpauth.centurytel.net:25

run “postmap /etc/postfix/transport”

add the following line to /etc/postfix/smtp_auth (replace USERNAME and PASSWORD with appropriate values)

smtpauth.centurytel.net         USERNAME:PASSWORD

run “postmap /etc/postfix/smtp_auth”

run “postfix reload”

MythTV in HD

Monday, October 20th, 2008

I finally broke down and bought an HD card. I settled on the HD-5500 from pcHDTV for several reasons. This card had good reviews, many success stories with MythTV and best of all, it is only supported on Linux. My current MythDora install was getting a little long in the tooth and I had little interest in keeping any of my current recorded programs so I decided to start over from scratch.

I replaced the ATI TV-wonder NTSC tuner with the HD-5500 and the ATI Radeon 9600 with an Nvidia Geforce4 (eBay: two cards and shipping for $26, woohoo). I have always been a fan of the way a Gentoo system is set up so I went the Gentoo route for my new MythTV install. The Gentoo wiki’s MythTV HOWTO (link currently dead due to datacenter issues) was a big help here.

The install was fairly painless and with judicious use of Google I was all set up and recording in HD. My aged system can play HDTV, but just barely. It is only watchable if nothing is being recorded, there is no other activity on the system and the OSD is not popped up. A CPU upgrade is in order, but that will have to wait for another day.

In case you are wondering what the minimum specs are to watch HD on MythTV, these specs are pretty close to bare bones.

  • AMD Athlon XP2600+
  • Asus A7N8X
  • 1024MB RAM
  • Nvidia Geforce4 MX with DVI out
  • pcHDTV HD-5500 ATSC/NTSC capture card
  • 300GB ATA133 Hard Drive