Linux-Misc Digest #554, Volume #18               Sun, 10 Jan 99 16:13:11 EST

Contents:
  Linux Frequently Asked Questions with Answers (Part 4 of 6) ([EMAIL PROTECTED])
  Re: LINUS Can Suck My Hairy Cock .. or Newbie Needs Linux Help ... (Andy Wendel)

----------------------------------------------------------------------------

Crossposted-To: news.answers,comp.answers
Subject: Linux Frequently Asked Questions with Answers (Part 4 of 6)
From: [EMAIL PROTECTED] 
Date: Sun, 10 Jan 1999 21:07:30 GMT

newer linker, from ftp://tsx-11.mit.edu/pub/linux/packages/GCC/,
in the file binutils-2.8.1.0.1.bin.tar.gz.


5.11 How do I make a shared library?

For ELF,
gcc -fPIC -c *.c
gcc -shared -Wl,-soname,libfoo.so.1 -o libfoo.so.1.0 *.o

For a.out, get tools-n.nn.tar.gz from tsx-11.mit.edu, in
/pub/linux/packages/GCC/src/. It comes with documentation that will
tell you what to do. Note that a.out shared libraries are a very
tricky business. Consider upgrading your libraries to ELF shared
libraries. See the ELF HOWTO, at
sunsite.unc.edu/pub/Linux/docs/HOWTO/


5.12 My executables are (very) large.

With an ELF compiler ("What's all this about ELF?"), the most
common cause of large executables is the lack of an appropriate .so
library link for one of the libraries you're using. There should be a
link like libc.so for every library like libc.so.5.2.18.

With an a.out compiler the most common cause of large executables is
the -g linker (compiler) flag. This produces (as well as debugging
information in the output file) a program which is statically
linked--one which includes a copy of the C library instead of a
dynamically linked copy.

Other things worth investigating are -O and -O2, which enable
optimization (check the GCC documentation), and -s (or the strip
command) which strip the symbol information from the resulting binary
(making debugging totally impossible).

You may wish to use -N on very small executables (less than 8K with
the -N), but you shouldn't do this unless you understand its
performance implications, and definitely never with daemons.


5.13 Does Linux support threads or lightweight processes?

As well as the Unix multiprocessing model involving heavyweight
processes, which is of course part of the standard Linux kernel, there
are several implementations of lightweight processes or threads.
Recent kernels implement a thread model, kthreads. In addition, there
are the following packages available for Linux.
  * GNU glibc2 for Linux has optional support for threads. The archive
    is available from the same place as glibc2,
    ftp://ftp.gnu.org/pub/gnu
  * In sipb.mit.edu:/pub/pthread or
    ftp.ibp.fr:/pub/unix/threads/pthreads. Documentation isn't in the
    package, but is available on the World Wide Web at
    http://www.mit.edu:8001/people/proven/home_page.html. Newer Linux
    libc's contain the pthreads source. The GNU Ada compiler on
    sunsite.unc.edu in
    /pub/Linux/devel/lang/ada/gnat-3.01-linux+elf.tar.gz contains
    binaries made from that source code.
  * In ftp.cs.washington.edu:/pub/qt-001.tar.Z is QuickThreads. More
    information can be found in the technical report, available on the
    same site as /tr/1993/05/UW-CSE-93-05-06.PS.Z.
  * In gummo.doc.ic.ac.uk/rex/ is lwp, a very minimal implementation.
  * In ftp.cs.fsu.edu:/pub/PART/, an Ada implementation. This is
    useful mainly because it has a lot of Postscript papers that
    you'll find useful in learning more about threads. This is not
    directly usable under Linux.
    
Please contact the authors of the packages in question for details.


5.14 Where can I get `lint' for Linux?

Roughly equivalent functionality is built into GCC. Use the -Wall
option to turn on most of the useful extra warnings. See the GCC
manual for more details (type control-h followed by i in Emacs and
select the entry for GCC).

There is a freely available program called `lclint' that does much the
same thing as traditional lint. The announcement and source code are
available at on larch.lcs.mit.edu in /pub/Larch/lclint/; on the World
Wide Web, look at http://larch-www.lcs.mit.edu:8001/larch/lclint.html.


5.15 Where can I find kermit for Linux?

Kermit is distributed under a non-GPL copyright that makes its terms
of distribution somewhat different. The sources and some binaries are
available on kermit.columbia.edu.

The WWW Home Page of the Columbia University Kermit project is
http://www.columbia.edu/kermit/.



6. Solutions to common miscellaneous problems.


6.1 free dumps core.

In Linux 1.3.57 and later, the format of /proc/meminfo was changed in
a way that the implementation of free doesn't understand.

Get the latest version, from sunsite.unc.edu, in
/pub/Linux/system/Status/ps/procps-0.99.tgz.


6.2 My clock is very wrong.

There are two clocks in your computer. The hardware (CMOS) clock runs
even when the computer is turned off, and is used when the system
starts up and by DOS (if you use DOS). The ordinary system time, shown
and set by "date," is maintained by the kernel while Linux is
running.

You can display the CMOS clock time, or set either clock from the
other, with /sbin/clock program--see "man 8 clock."

There are various other programs that can correct either or both
clocks for system drift or transfer time across the network. Some of
them may already be installed on your system. Try looking for adjtimex
(corrects for drift), netdate, and getdate (get the time from the
network), or xntp (accurate, full-featured network time daemon).


6.3 Setuid scripts don't seem to work.

That's right. This feature has been disabled in the Linux kernel on
purpose, because setuid scripts are almost always a security hole.
Sudo and SuidPerl can provide more security that setuid scripts or
binaries, especially if execute permissions are limited to a certain
user ID or group ID.

If you want to know why setuid scripts are a security hole, read the
FAQ for comp.unix.questions.


6.4 Free memory as reported by free keeps shrinking.

The "free" figure printed by free doesn't include memory used as a
disk buffer cache--shown in the "buffers" column. If you want to
know how much memory is really free add the "buffers" amount to
"free"--newer versions of free print an extra line with this info.

The disk buffer cache tends to grow soon after starting Linux up. As
you load more programs and use more files, the contents get cached. It
will stabilize after a while.


6.5 When I add more memory, the system slows to a crawl.

This is a common symptom of a failure to cache the additional memory.
The exact problem depends on your motherboard.

Sometimes you have to enable caching of certain regions in your BIOS
setup. Look in the CMOS setup and see if there is an option to cache
the new memory area which is currently switched off. This is
apparently most common on a '486.

Sometimes the RAM has to be in certain sockets to be cached.

Sometimes you have to set jumpers to enable caching.

Some motherboards don't cache all of the RAM if you have more RAM per
amount of cache than the hardware expects. Usually a full 256K cache
will solve this problem.

If in doubt, check the manual. If you still can't fix it because the
documentation is inadequate, you might like to post a message to
comp.os.linux.hardware giving all of the details--make, model number,
date code, etc., so other Linux users can avoid it.


6.6 Some programs (e.g. xdm) won't let me log in.

You are probably using non-shadow password programs and are using
shadow passwords.

If so, you have to get or compile a shadow password version of the
programs in question. The shadow password suite can be found at
tsx-11.mit.edu:/pub/linux/sources/usr.bin/shadow/. This is the source
code. The binaries are probably in linux/binaries/usr.bin/.


6.7 Some programs let me log in with no password.

You probably have the same problem as in "Some programs (e.g.
xdm) won't let me log in.", with an added wrinkle.

If you are using shadow passwords, you should put a letter `x' or an
asterisk in the password field of /etc/passwd for each account, so
that if a program doesn't know about the shadow passwords it won't
think it's a passwordless account and let anyone in.


6.8 My machine runs very slowly when I run GCC / X / ...

You may have too little real memory. If you have less RAM than all the
programs you're running at once, Linux will swap to your hard disk
instead and thrash horribly. The solution in this case is to not run
so many things at once or buy more memory. You can also reclaim some
memory by compiling and using a kernel with less options configured.
See "How do I upgrade/recompile my kernel?".

You can tell how much memory and swap you're using with the free
command, or by typing:

cat /proc/meminfo

If your kernel is configured with a RAM disk, this is probably wasted
space and will cause things to go slowly. Use LILO or rdev to tell the
kernel not to allocate a RAM disk (see the LILO documentation or type
man rdev).


6.9 I can only log in as root.

You probably have some permission problems, or you have a file
/etc/nologin.

In the latter case, put rm -f /etc/nologin in your /etc/rc.local or
/etc/rc.d/* scripts.

Otherwise, check the permissions on your shell, and any file names
that appear in error messages, and also the directories that contain
these files, up to and including the root directory.


6.10 My screen is all full of weird characters instead of letters.

You probably sent some binary data to your screen by mistake. Type
echo '\033c' to fix it. Many Linux distributions have a command,
"reset," that does this.

If that doesn't help, try a direct screen escape command.
echo <Ctrl-V><Ctrl-O>

This resets the default font of a Linux console. Remember to hold down
the Control key and type the letter, instead of, for example,
`Ctrl-V'. The sequence

echo <Ctrl-V><Esc>c

causes a full screen reset. If there's data left on the shell command
line after typing a binary file, press Ctrl-C a few times to restore
the shell command line.

[Bernhard Gabler]


6.11 I have screwed up my system and can't log in to fix it.

Reboot from an emergency floppy or floppy pair. For example, the
Slackware boot and root disk pair in the install subdirectory of the
Slackware distribution.

There are also two, do-it-yourself rescue disk creation packages in
sunsite.unc.edu/pub/Linux/system/Recovery. These are better
because they have your own kernel on them, so you don't run the risk
of missing devices and file systems.

Get to a shell prompt and mount your hard disk with something like
mount -t ext2 /dev/hda1 /mnt

Then your file system is available under the directory /mnt and you
can fix the problem. Remember to unmount your hard disk before
rebooting (cd somewhere else first, or it will say it's busy).


6.12 I've discovered a huge security hole in rm!

No you haven't. You are obviously new to unices and need to read a
good book to find out how things work. Clue: the ability to delete
files depends on permission to write in that directory.


6.13 lpr(1) and/or lpd(8) don't work.

First make sure that your /dev/lp* port is correctly configured. Its
IRQ (if any) and port address need to match the settings on the
printer card. You should be able to dump a file directly to the
printer.

cat the_file >/dev/lp1

If lpr gives you a message like "myname@host: host not found," it
may mean that the TCP/IP loopback interface, lo, isn't working
properly. Loopback support is compiled into most distribution kernels.
Check that the interface is configured with the ifconfig command. By
Internet convention, the network number is 127.0.0.0, and the local
host address is 127.0.0.1. If everything is configured correctly, you
should be able to telnet to your own machine and get a login prompt.

Make sure that /etc/hosts.lpd contains the machine's host name.

If your machine has a network-aware lpd, like the one that comes with
LPRng, make sure that /etc/lpd.perms is configured correctly.

Also look at the Printing-HOWTO "Where can I get the HOWTO's
and other documentation?".


6.14 Timestamps on files on MS-DOS partitions are set incorrectly.

There is a bug in the program "clock" (often found in /sbin). It
miscounts a time zone offset, confusing seconds with minutes or
something like that. Get a recent version.


6.15 How do I get LILO to boot the vmlinux file?

>From kernel versions 1.1.80 on, the compressed kernel image, which is
what LILO needs to find, is in arch/i386/boot/zImage. The vmlinux file
in the root directory is the uncompressed kernel, and you shouldn't
try to boot it.

This was changed to make it easier to build kernel versions for
several different processors from one source tree.



7. How do I do this or find out that ... ?


7.1 How can I get scrollback in text mode?

With the default US keymap, you can use Shift with the PageUp and
PageDown keys. (The gray ones, not the ones on the numeric keypad.)
With other keymaps, look in /usr/lib/keytables. You can remap the
ScrollUp and ScrollDown keys to be whatever you like. For example, to
remap them to the keys on an 84-key, AT keyboard.

The "screen" program,
http://vector.co.jp/vpack/browse/person/an010455.html provides a
searchable scrollback buffer and the ability to take "snapshots" of
text-mode screens.

You can't increase the amount of scrollback, because it is implemented
using the video memory to store the scrollback text. You may be able
to get more scrollback in each virtual console by reducing the total
number of VC's. See linux/tty.h.


7.2 How do I switch virtual consoles? How do I enable them?

In text mode, press Left Alt-F1 to Alt-F12 to select the consoles tty1
to tty12; Right Alt-F1 gives tty13 and so on. To switch out of X you
must press Ctrl-Alt-F1, etc; Alt-F5 or whatever will switch back.

If you want to use a VC for ordinary login, it must be listed in
/etc/inittab, which controls which terminals and virtual consoles have
login prompts. The X Window System needs at least one free VC in order
to start.


7.3 How do I set the time zone?

Change directory to /usr/lib/zoneinfo/. Get the time zone package if
you don't have this directory. The source is available in
sunsite.unc.edu/pub/Linux/system/admin/time/.

Then make a symbolic link named localtime pointing to one of the files
in this directory (or a subdirectory), and one called posixrules
pointing to localtime. For example:

ln -sf US/Mountain localtime
ln -sf localtime posixrules

This change will take effect immediately--try date(1).

The manual page for tzset describes setting the time zone. Some
programs recognize the TZ environment variable, but this is not
POSIX-correct.

You should also make sure that your Linux kernel clock is set to the
correct GMT time--type date -u and check that the correct UTC time is
displayed. ("My clock is very wrong.")


7.4 What version of Linux and what machine name am I using?

Type:
uname -a


7.5 How can I enable or disable core dumps?

By using the ulimit command in bash, the limit command in tcsh, or the
rlimit command in ksh. See the appropriate manual page for details.

This setting affects all programs run from the shell (directly or
indirectly), not the whole system.

If you wish to enable or disable core dumping for all processes by
default, you can change the default setting in linux/sched.h--see the
definition of INIT_TASK, and look also in linux/resource.h.


7.6 How do I upgrade/recompile my kernel?

See the Kernel HOWTO or the README files which come with the kernel
release on ftp.cs.helsinki.fi, in /pub/Software/Linux/Kernel/ and
mirrors. (See "Where can I get Linux material by FTP?") You
may already have a version of the kernel source code installed on your
system, but if it is part of a standard distribution it is likely to
be somewhat out of date (this is not a problem if you only want a
custom configured kernel, but it probably is if you need to upgrade.)

With newer kernels you can (and should) make all of the following
targets. Don't forget that you can specify multiple targets with one
command.

make clean dep install modules modules_install

Also remember to update the module dependencies.
depmod -a

Remember that to make the new kernel boot you must run LILO after
copying the kernel into your root partition--the Makefile in recent
kernels has a special zlilo target for this; try:

make zlilo

Kernel version numbers with an odd minor version (ie, 1.1.x, 1.3.x)
are the testing releases; stable production kernels have even minor
versions (1.0.x, 1.2.x). If you want to try the testing kernels you
should probably subscribe to the linux-kernel mailing list. (See "
What mailing lists are there?.")


7.7 Can I have more than 3 serial ports by sharing interrupts?

Yes, but you won't be able to use simultaneously two ordinary ports
which share an interrupt (without some trickery). This is a limitation
of the ISA Bus architecture.

See the Serial HOWTO for information about possible solutions and
workarounds for this problem.


7.8 How do I make a bootable floppy?

Make a file system on it with bin, etc, lib and dev
directories--everything you need. Install a kernel on it and arrange
to have LILO boot it from the floppy (see the LILO documentation, in
lilo.u.*.ps).

If you build the kernel (or tell LILO to tell the kernel) to have a
RAM disk the same size as the floppy the RAM disk will be loaded at
boot time and mounted as root in place of the floppy.

See the Bootdisk HOWTO.


7.9 How do I remap my keyboard to UK, French, etc.?

For recent kernels, get /pub/Linux/system/Keyboards/kbd-0.90.tar.gz
from sunsite.unc.edu. Make sure you get the appropriate version; you
have to use the right keyboard mapping package for your kernel
version.

For older kernels you have to edit the top-level kernel Makefile, in
/usr/src/linux.

You may find more helpful information in The Linux Keyboard and
Console HOWTO, by Andries Brouwer, at
sunsite.unc.edu/pub/Linux/docs/HOWTO.


7.10 How do I get NUM LOCK to default to on?

Use the setleds program, for example (in /etc/rc.local or one of the
/etc/rc.d/* files):

for t in 1 2 3 4 5 6 7 8
do
 setleds +num < /dev/tty$t > /dev/null
done

Setleds is part of the kbd package ("How do I remap my keyboard
to UK, French, etc.?").

Alternatively, patch your kernel. You need to arrange for KBD_DEFLEDS
to be defined to (1 << VC_NUMLOCK) when compiling
drivers/char/keyboard.c.


7.11 How do I set (or reset) my initial terminal colors?

The following shell script should work for VGA consoles:
for n in 1 2 4 5 6 7 8; do
     setterm -fore yellow -bold on -back blue -store > /dev/tty$n
     done

Substitute your favorite colors, and use /dev/ttyS$n for serial
terminals.

To make sure they are reset when people log out (if they've been
changed):

Replace the references to "getty" (or "mingetty" or "uugetty" or
whatever) in /etc/inittab with references to "/sbin/mygetty."

#!/bin/sh
setterm -fore yellow -bold on -back blue -store > $1
exec /sbin/mingetty $@

[Jim Dennis]

7.12 How can I have more than 128Mb of swap?

Use several swap partitions or swap files--Linux supports up to 16
swap areas, each of up to 128Mb.

Very old kernels only supported swap partition sizes up to 16Mb.

Linux on machines with 8KB paging, like Alpha and Sparc64, support a
swap partition up to 512MB. The 128MB limitation comes from
PAGE_SIZE*BITSPERBYTE on machines with 4KB paging, but is 512KB on
machines with 8KB paging. The limit is due to the use of a single page
allocation map.

The file mm/swapfile.c has all of the gory details.

[Peter Moulder, Gordon Weast]



8. Miscellaneous information and questions answered.


8.1 How do I program XYZ under Linux?

Read the manuals, or a good book on Unix. Manual pages (type "man
man") are usually a good source of reference information on exactly
how to use a particular command or function.

There is also a lot of GNU Info documentation, which is often more
useful as a tutorial. Run Emacs and type C-h i, or type info info if
you don't have or don't like Emacs. Note that the Emacs libc node may
not exactly describe the latest Linux libc, or GNU glibc2. But the GNU
project and LDP are always looking for volunteers to upgrade their
library documentation.

Anyway, between the existing Texinfo documentation, and the manual
pages in sections 2 and 3, should provide enough information to get
started.

As with all free software, the best tutorial is the source code
itself.

The latest release of the Linux manual pages, a collection of useful
GNU Info documentation, and various other information related to
programming Linux, can be found on sunsite.unc.edu in
/pub/Linux/docs/man-pages.


8.2 What's all this about ELF?

See the ELF HOWTO by Daniel Barlow--note, this is not the file
move-to-elf, which is a blow-by-blow account of how to upgrade to ELF
manually.

-- 

Robert Kiesling
[EMAIL PROTECTED]


------------------------------

From: [EMAIL PROTECTED] (Andy Wendel)
Crossposted-To: alt.linux,alt.os.linux,comp.os.linux,comp.os.linux.setup
Subject: Re: LINUS Can Suck My Hairy Cock .. or Newbie Needs Linux Help ...
Date: Sun, 10 Jan 1999 21:03:37 GMT

On Sun, 10 Jan 1999 14:23:06 +0000, Jeff Kay
<[EMAIL PROTECTED]> wrote:

>Since the original intent of this was only ment to inflame linux users or
>advocates and in no way put forth any constructive critisism I'll ignore
>most of what was said....
>
>I do however find it ironic ( humorous even ) that the original poster put
>"Please dont flame me its only an Opinion"? What would this person expect
>from such a comment....
>
>Now to the heart of what I wished to say before HOPEFULLY we can put this
>thread to sleep -- for good...
>
>I fail to understand why either of you would bother to use linux if you
>weren't willing to put in even the slightest effort..... The second
>commentor here mentions that he doesn't know how to copy a file like he did
>on dos/win ( though he points out he's used dos for since 1986 ), yet
>further down he he says he'll go back to using NT and programming c++
>there...... Somehow I doubt your programming capabilities, if you cant
>figure out how to copy a file....really how difficult is it to a) look it
>up in the man pages b) borrow a unix book from the library and learn c)
>search the net or d) ask a newsgroup ?
>
>How did you learn how to copy a file in dos .... I'm mean you did have to
>LEARN didn't you.... this wasn't an ingrained DNA encoded instinct with you
>was it? You just naturally knew... how about dir...surely thats not common
>sense ( since list would make more ) and yet I'm sure you can do that
>too...how? maybe you learned how to do it....  That you were unwilling to
>put forth the effort to even try to learn is a comment about you NOT about
>Linux...
>
>So you get windows for free..... the difference is I can never be charged
>for using linux without paying.... maybe someone will cc your message off
>to MS and they come hunting you down...sure they have better things to do
>but they sure would like making a point too and hey they got the spare cash
>to do it...
>
>While in your eyes learning linux may be like learning chinese a) over a
>billion people have done it ( not linux, chinese ) and b) at least at the
>end you would have had the satitsfaction of having accomplished something
>you consider difficult....  That you would ever attempt to use linux
>without learning it is laughable.... I wonder how succesful a tirp to china
>would be if you didn't know even so rudimentary chinese or something of the
>place you were about to visit..... You cant blame your ignorance on Linux
>or the thousands of people who have developed it, though you may try.
>
>As for the original poster, why... why bother with such a comment.... DON't
>ANSWER BACK .. its rehtorical.... That you make comments such as "MS will
>own linux" or "that bill owns us" or "that your vcr has a better gui and
>that you could program a better OS" Really? Haven't done it have you? Its
>great you can shout your mouth off but where's the proof.... If you're so
>great then you could have joined the OSS community and help to make linux
>more user friendly for the layperson...alas I doubt you've even used it,
>based on your comments..... sure you may have listened to a few newsgroups
>even read an article about it, but that is the extent of your knowledge and
>experience I'm sure.....  A second comment would be if vcr's are so user
>friendly how come most people's still flash 12:00?
>
>Funny thing too...My dad who doesn't know dos and barely understands
>computers was able to sit down a the computer last night ( which happened
>to be in linux mode ) and find mahjongg on it..start it and play it no
>questions asked.... guess linux cant be that difficult...:-)
>
>jeff
>
>> _________________________

Some of the kiddies don't seem to know what hardware they have in that
little box on their desk.... I guess it can be frustrating when you
don't know pci from isa...

Oh boys, if you were such DOS wizards, then you SHOULD know the old
LONG commands, such as rmdir, mkdir, etc... amazing... they are the
same as Linux....

Considering DOS is the poor bastard stepchild of Unix to begin with.

Is Linux perfect? Not by a long shot.  But I have yet to make it
crash.  If this were a perfect world, I would not have to waste my
bandwidth on dweebs like you trolls...

If Linux sucks, you guys must be the backwash....

------------------------------


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list (and comp.os.linux.misc) via:

    Internet: [EMAIL PROTECTED]

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Misc Digest
******************************

Reply via email to