Linux-Misc Digest #456, Volume #18 Sun, 3 Jan 99 19:13:10 EST
Contents:
Lexmark 5700 printer in Linux? (David Efflandt)
Re: WordPerfect 8 (Mike Werner)
help me choose Linux ... ("mc")
Re: Can grep work recursively? (Brian Hurt)
Linux Frequently Asked Questions with Answers (Part 4 of 6) ([EMAIL PROTECTED])
Easy(?) modules question (Jesse Hughes)
Re: Semaphores problem (Bruno Quesnel)
Re: CGI & Perl Problem (David Efflandt)
----------------------------------------------------------------------------
From: [EMAIL PROTECTED] (David Efflandt)
Crossposted-To: comp.periphs.printers
Subject: Lexmark 5700 printer in Linux?
Date: Sun, 03 Jan 1999 23:06:57 GMT
The manual says to use a PCL3 driver like HP500C or HP500 for this
printer in DOS, but I cannot get either print filter to do anything in
Linux RedHat 5.2. Plain text sent right to the port doesn't even
flicker the light. On closer examination I find that this printer
will NOT print from true DOS, only a DOS window (apparently
intercepted by the Lexmark Win driver).
My HP4L prints fine from either port in Linux, and the Lexmark prints
fine from Win95, so it is not a hardware problem (except for the brain
dead "Windows only" printer).
Has anyone found a Unix print filter that will allow the Lexmark 5700
to print from Linux?
David Efflandt/Elgin, IL USA
[EMAIL PROTECTED] http://www.xnet.com/~efflandt/
------------------------------
From: Mike Werner <[EMAIL PROTECTED]>
Subject: Re: WordPerfect 8
Date: Sun, 03 Jan 1999 16:03:29 -0500
David Goldstein wrote:
> Mike,
> I downloaded WP8 this morning and had to rename the file to
> GUILG00.tar. For some reason, it was not accepting the .gz ending. I will
Did you use Netscape in Linux to download it? If so, that may be why.
On an email listserv I'm on, it was pointed out to me that Netscape in
Linux automatically unzips downloaded files. Hence, the guilg00.tar has
already been unzipped, where on the server it is indeed a gzipped
tarball. So it actually depends on what you use to download the file.
> concur, though, that WP8 is really very good. I was putting it through
> some paces this morning and found it to be easy to install and use. It has
> a lot of features that those Winnuts like to see in a word processor
> (I doubt that I will ever use all of them) and runs very smoothly. The
I've not yet used it much. But this coming semester I'm sure it will
see quite a bit of use in my English class (second semester composition
and rhetoric). From my limited use of it so far, it does quite resemble
other GUI (i.e. Windoze) word processors I've used. The one brief test
I ran was to import a M$ Word 7.0 document. That import went
perfectly. It was a small text document with some colored text and
about half dozen fonts and font sizes. It looked exactly the same in M$
Word and in Word Perfect 8 on my linux box. As impressed as I am so
far, I will most likely purchase the personal edition on CDROM, if for
no other reason than to support Corel for doing this port.
> only problem that I have is trying to print documents. I am using a Canon
> BJC-4200 printer and cannot get it working under WP8. If anyone uses the
> same printer and WP8, please, let me know what you did to get it working :)
That one I can't help with yet, as I do not have a printer hooked to my
Linux box.
>
> Happy New Year!
>
> David Goldstein
Happy Holidays.
--
Mike Werner KA8YSD | "Where do you want to go today?"
ICQ# 12934898 | "As far from Redmond as possible!"
AIM Screen Name Reznaeous |
'91 GS500E |
Morgantown WV |
=====BEGIN GEEK CODE BLOCK=====
Version: 3.1
GU d-@ s:+ a- C++>$ UL++ P+ L+++ E W++ N++ !o w--- O- !M V-- PS+ PE+
Y+ R+ !tv b+++(++++) DI+ D--- G e*>++ h! r++ y++++
======END GEEK CODE BLOCK======
------------------------------
From: "mc" <[EMAIL PROTECTED]>
Subject: help me choose Linux ...
Date: Sun, 3 Jan 1999 17:34:15 -0600
What is the best "flavor" of Linux to install for a linux newbie? RedHat?
Suse? Slackware? BSD? ???
Matt
------------------------------
Crossposted-To: comp.os.linux.advocacy
Subject: Re: Can grep work recursively?
From: [EMAIL PROTECTED] (Brian Hurt)
Date: Sun, 03 Jan 1999 23:26:55 GMT
[EMAIL PROTECTED] writes:
>I was wondering if it was possible to make grep work recursively in folders.
>Is this possible?
By itself- no. But string it together with a few other commands-
specifically 'find' and 'xargs', and it can. Something I do a lot:
find /usr/include -name '*.h' -print | xargs grep somefunction
Lots of usefull variations on this. There's nothing quite like:
find / -type f -print | xargs grep -l something
Brian
------------------------------
Crossposted-To: news.answers,comp.answers
Subject: Linux Frequently Asked Questions with Answers (Part 4 of 6)
From: [EMAIL PROTECTED]
Date: Sun, 03 Jan 1999 21:37:20 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: Jesse Hughes <[EMAIL PROTECTED]>
Subject: Easy(?) modules question
Date: 03 Jan 1999 17:53:31 -0500
Hey ho.
Here's the output from modprobe dummy:
gcc2_compiled. undefined
Failed to load module! The symbols from kernel 2.0.36 don't match 2.0.36
(I get similar output from any other modules).
The module was compiled at the same time as the kernel. Any ideas?
Please email a courtesy copy of any replies. Thanks.
--
Jesse Hughes [EMAIL PROTECTED]
http://www.contrib.andrew.cmu.edu/user/jesse/jesse.html
------------------------------
From: Bruno Quesnel <[EMAIL PROTECTED]>
Crossposted-To: comp.unix.programmer,comp.os.linux.networking
Subject: Re: Semaphores problem
Date: Sun, 03 Jan 1999 22:42:59 +0000
Reply-To: [EMAIL PROTECTED]
I found the problem. Was doing a wait on the ressource that was already in
the proper state. Normally the wait puts the sempahore in a 0 value
state. But if the operation is done more then once without the value being
to 1 between the two calls, the wait call will return an error.
Thanks anyway
Bruno Quesnel wrote:
> I use Linux Redhat 5.2 with kernel 2.0.36.
>
> For one of my application, I need to create two semaphores, one for
> clients applications, and another for the server process. The creation
> works fine. If I do an ipcs command, I see the two semaphores.
>
> I can also see the values of each semaphores. My problem arise when I
> want to signal one of the semaphores, so that the process can treat
> acordingly (either that the server receive's data from the client, or
> vice versa throught shared memory).
>
> When I want to signal, I call the proper function and the proper
> semaphore ID. The other end is in waiting mode. The operation "works"
> in the respect that the signaling process exits with and error message :
>
> invalid argument
>
> The receiving process receives the proper info but the signaling exits.
>
> Here is the code For the signaling and waiting function :
>
> int waitsem(int semid) /* wait on a semaphore */
> {
> struct sembuf p_buf;
>
> p_buf.sem_num = 0;
> p_buf.sem_op = -1;
> p_buf.sem_flg = SEM_UNDO;
>
> if (semop(semid, &p_buf, 1) == -1) {
> perror("waitsem() failed");
> exit(1);
> } else
> return (0);
> }
>
> int postsem(int semid) /* post to a semaphore */
> {
> struct sembuf v_buf;
>
> v_buf.sem_num = 0;
> v_buf.sem_op = 1;
> v_buf.sem_flg = SEM_UNDO;
>
> if (semop(semid, &v_buf, 1) == -1) {
> perror("postsem()
> failed"); Line that
> gives error on signal
> exit(1);
> } else
> return (0);
> }
>
> Only one semaphore is created in the creation. In the creation routine,
> it verifies that the semaphore exist, else it creates it.
>
> --
> Bruno Quesnel [EMAIL PROTECTED]
> Genie Electrique [EMAIL PROTECTED]
> Electrical Engeneering [EMAIL PROTECTED]
> Ecole de Technologies Superieure VA2 BMG
--
Bruno Quesnel [EMAIL PROTECTED]
Genie Electrique [EMAIL PROTECTED]
Electrical Engeneering [EMAIL PROTECTED]
Ecole de Technologies Superieure VA2 BMG
------------------------------
From: [EMAIL PROTECTED] (David Efflandt)
Subject: Re: CGI & Perl Problem
Date: Sun, 03 Jan 1999 22:46:42 GMT
Andy Birkett <[EMAIL PROTECTED]> wrote:
>Hi
>
>I am running RH5.1 and Apache 1.2 and I am having problems with my CGI
>Perl scripts. I cannot get my scripts to read or create a file located
>on the web server, yet when I run the same scripts from a shell, the
>files are read/created fine.
>
>I haven't changed any settings in the Apache conf files, do I need to
>allow CGI scripts to access the files stored in the HTML directory of
>the web server. Or is it a file system problem? I have given write
>access to the directory I want to create my log files in, and Navigator
>can read the HTML OK, so why can't my CGI scripts?
>
>Hope you can help
Normally CGI scripts can only write to files that already exist with
666 permission. Although, they should be able to read from files with
644 permission (like web pages). In order to create files, the
directory needs 777 permission. Although, the group permission is not
critical (and different on RedHat), so 'group' permissions could be
more restricted if you move them to an ISP.
An alternative is apache's 'suexec' option. In that case CGI runs as
the user, so you can freely create files, but comes with certain
restrictions for security reasons (like symlinks to CGI scripts do not
work).
I think root CGI scripts have additional limitations, for good reason.
David Efflandt/Elgin, IL USA
[EMAIL PROTECTED] http://www.xnet.com/~efflandt/
------------------------------
** 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
******************************