[still in the process of updating this. -- rgr, 19-Dec-04.]
Home : Linux resources : "Howto"
This page contains "howto" information for random bits of hardware and software. Some of it is general, but some is very specific to my configuration, so it may break for yours; use caution when trying any of this stuff.
Contents of this page:
Networking
See also the SSH: Secure Shell
and Linux firewall script
pages.
Ethernet
See my Ethernet Cheat Sheet for Ethernet
pinouts and wire color code conventions. (This is on a page of its own
for easy printing.)
See also /usr/doc/HOWTO/Ethernet-HOWTO,
comp.dcom.lans.ethernet_FAQ and
http://www.scyld.com/network/eepro100.html. The
/sbin/mii-diag and /sbin/eepro-diag commands
(downloaded from the latter) report on detailed Ethernet NIC status.
Reverse DNS in perl:
The various servers I run keep their log files in the following
places:
[for suse 8.1, log rotation is now controlled (mostly) by
/etc/logrotate.d/syslog, which requires tweaking. -- rgr,
13-May-03.] [squid log rotation is controlled by
/etc/logrotate.d/squid, instead of doing
"squid -k rotate"; this also needed tweaking. --
rgr, 29-Jun-03.] [need to write up tweaking notes, describe the
logrotate package in outline. -- rgr, 5-Jun-04.]
Other resources:
In order to get Samba up and running at my site, I found the
following resources helpful:
RPM links:
The "DontZap" option in the "ServerFlags" section
of the
/etc/X11/XF86Config file disables the
Crtl-Alt-Backspace server abort sequence, letting it through to
clients. This option is essential for keeping us Zmacs alumni (who
expect C-M-DEL to be bound to backward-kill-sexp) from
going postal. -- rgr, 19-Mar-00.
If /var/log/messages says
You can add the "-c" option to check for bad blocks,
but I haven't found a bad block yet, and this is what takes most
of the time (about 4.5 minutes), as it has to read the entire
drive. (My guess is that bad blocks are detected and "repaired"
by the drive, so it's no surprise that I never found one. --
rgr, 7-Aug-01.)
Note the existence of the mzip command.
[The "Zip drive backup" section that was here has been renamed and
given its own page. -- rgr, 7-Aug-01.]
General IP networking
If the network doesn't come up after booting
Sometimes the external network configuration fails when booting,
possibly due to slow DHCP server response. When that happens, there is
no connectivity to the outside world, and a number of bad consequences
follow:
So to fix all of this, the following things must be done, in this order:
# ifup eth0
as root, of course. This may take a while, and it may
fail again, especially if a power outage just ended and the DHCP
server is swamped with requests (and may still be booting up
itself). Do "ifconfig eth0" to verify that
eth0 really has an IP address.
# /etc/init.d/firewall
# /etc/init.d/xntpd restart
The system clock will get reset almost immediately, which may
make the screen go blank, if it moves further ahead than your
screen saver delay interval (mine is 10 minutes).
# /etc/init.d/squid start
# /etc/init.d/apache2 start
DNS tricks using perl
rgr> perl -e 'use Socket; $iaddr = inet_aton("128.197.54.20"); print join(" ", gethostbyaddr($iaddr, AF_INET)), "\n";'
DARWIN.BU.EDU 2 4 \200Å6^T
rgr>
Reverse DNS from a shell (using perl to trim just the host name out of
the nslookup output):
% nslookup -q=PTR 19.200.128.24.in-addr.arpa | perl -ne 'print "$1\n" if /in-addr.arpa\s+name = (.*)$/;'
h0050da615e79.ne.mediaone.net
%
Servers
Use the links in the next section for server-specific pages.
Server logs
What Where
NIS
Uses syslog (/var/log/messages).
SSH
Uses syslog (/var/log/messages).
dhcpd
Uses syslog (/var/log/messages).
qmail
Uses syslog (/var/log/mail, and /var/log/messages
to a lesser extent), at least when configured without
multilog.
ezmlm
Each mailing list gets its own log, in the Log file
immediately under the list directory. Only such things as
subscribe/unsubscribe events are logged.
xntpd
Writes to /var/log/ntp via syslog in the default
configuration supplied by SuSE, but this is controlled by the
"logfile" directive in /etc/ntpd.conf. (The default
tarball installation uses /var/log/messages).
Apache
Under SuSE, the Apache log files are under
/var/log/apache2 (or /var/log/httpd if you
are running Apache 1.3). These are called access_log
and error_log. If you run an HTTPS server, there will
also be an ssl_request_log file.
Subversion
Subversion runs within Apache, so will need to look in your
Apache logs (particularly ssl_request_log).
Squid
cache.log, access.log, and store.log
in /var/log/squid/. More about these log files on my
Squid page.
Samba
/var/log/samba/log.nmb and
/var/log/samba/log.smbd. Note that by default, SuSE
configures Samba to keep a separate log file for each client
machine.
The ezmlm mailing list manager
The ezmlm binaries are in /usr/bin/ezmlm/, which is
not on root's default path. The easiest way to get these commands is to
"su alias" as root.
$ ezmlm-make ~alias/linux/ ~alias/.qmail-linux linux rgrjr.dyndns.org
as the alias user, so alias became the list
owner. (If I had done this as rogers, the list name in
the third argument would have needed to be rogers-linux
instead of linux.)
$ ezmlm-sub ~alias/linux/ rogers@rgrjr.dyndns.org
as the list owner. Lists are identified by their top-level
directory, ~alias/linux/ in this case. Unsubscription
uses the ezmlm-unsub program.
netatalk
[I haven't actually run this for a while now. -- rgr, 28-Dec-06.]
Samba
Samba is configured on this machine,
but not started by default, since I don't often use my Windows machine
(at least not for Windows; it also runs SuSE Linux). To start it, I must do
"/etc/init.d/samba start" as root.
Linux guts
Memory management
Doing "cat /proc/meminfo" generates a report of current
usage. See "man vmstat" for a tool to keep an eye on
memory usage.
rpm and rpmfind
XFree86
Hardware
See also the Burning CD-R disks page.
Zip drive
mount: the kernel does not recognize /dev/sda4 as a block device
(maybe `insmod driver'?)
then this is probably because the machine was booted with the Zip
drive off. If that's the case, then
modprobe imm
will probably be sufficient to get /dev/sda4 recognized,
after which the drive can be power cycled without needing to
repeat the modprobe. (The boot-time modprobe
is done in the
/etc/rc.d/rc.modules script. -- rgr, 28-Dec-99.)
modprobe: can't locate module block-major-8
and lsmod shows imm already loaded, then do
rmmod imm; modprobe imm
to force reloading. -- rgr, 2-Jul-00.
EXT2-fs warning: maximal mount count reached, running e2fsck is recommended
To address this, before mounting the disk, do
e2fsck -f /dev/sda4
The "-f" option will "Force checking even if the file
system seems clean" (from the man page); without it,
e2fsck does a quick check, so "-f" is more
thorough. You can also add the "-c" option to request
bad block checking (but see the comment
under "Formatting" above).
badblocks -w /dev/sda4 98288
This takes a while, as it writes a number of patterns across the
whole disk, and then rereads them. Each read/write pass takes
about nine minutes; the whole process is more than half an hour.
Floppy disk
fdformat /dev/fd0H1440
Other densities use different magical device names.
mkfs.ext2 -c /dev/fd0H1440
dd if=/mnt/cdrom/images/boot.img of=/dev/fd0
bs=1440k
Bob Rogers
<rogers@rgrjr.dyndns.org>
$Id: howto.html 150 2007-09-03 15:59:17Z rogers $