Struggling with mkfifo


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Struggling with mkfifo
# 8  
Old 04-15-2004
alan, I just tried this stuff on a 9000/800 running HP-UX 11.00.

As a non-root user, I do get "mknod: must be super-user" with the command "/usr/sbin/mknod bla". But that is an illegal command. When I run the same command as root as get "illegal argument count" and a usage statement.

"/usr/sbin/mknod bla p" works fine for all users.

When I try:
cat bla &
echo "hello world" > bla

it works fine for me. I cannot reproduce that error. Yes, your fifo looks like it has both read and write for you.

Try switching shells. Just type "sh" which will start up a posix shell. It's very close to ksh. Does thast work any better? When I type "what /usr/bin/ksh", I get:

$ Revision: 82.10 $
Version 11/16/88
# 9  
Old 04-15-2004
Question

Quote:
When I type "what /usr/bin/ksh", I get
$ Revision: 82.10 $
Version 11/16/88
When I type "what /usr/bin/ksh", I get this
/usr/bin/ksh:
$Revision: 82.10.1.61 $
Version 11/16/88
PATCH_11_00: arith.o blok.o ctype.o defs.o edit.o echo.o expand.o fault.o io.o string.o stak.o word.o emacs.o vi.o hpux_rel.o args.o builtin.o cmd.o main.o msg.o print.o xec.o name.o macro.o error.o service.o test.o jobs.o history.o 02/09/04


Quote:
Try switching shells. Just type "sh" which will start up a posix shell.
I try switching to "sh". Same thing:
[dev1@la]/home/dev1% sh
[dev1@la]/home/dev1% mkfifo bla
[dev1@la]/home/dev1% cat bla &
[1] 13618
[dev1@la]/home/dev1% echo "hello world" > bla
sh: bla: Cannot create the specified file.

[dev1@la]/home/dev1% ls -l bla
prw-rw-r-- 1 dev1 cadev 0 Apr 15 13:37 bla|
[dev1@la]/home/dev1%


I also tried "csh" (just in case).Same thing:
% csh
% mkfifo bla2
% cat bla2 &
[1] 14009
% echo "hello world" > bla2

bla2: Is a directory.Smilie
% ls -l bla2
prw-rw-r-- 1 dev1 cadev 0 Apr 15 13:55 bla2
%


I am stumped. Could all of this be due that my userid is forbidden to use shell commands such as these? If it is the case, wouldn't I be getting an "error" message like "You are not authorized to ... this command..."??
# 10  
Old 04-15-2004
This is an odd problem. What does "df -n ." and "bdf ." say? Also "cd /tmp" and repeat the mkfifo stuff.
# 11  
Old 04-15-2004
Quote:
Originally posted by Perderabo
What does "df -n ." and "bdf ." say?
"df -n" gives me (sorry, it's a lot of output)
/home/dev1 (cafs:/shared/homedirs/dev1) : nfs3
/users/oracle_backup (/dev/vgfc10/lvol1 ) : vxfs
/logs (/dev/vg00/lvol5 ) : vxfs
/opt (/dev/vg00/lvol6 ) : vxfs
/tmp (/dev/vg00/lvol4 ) : vxfs
/users/oracle (/dev/vgfc9/lvol1 ) : vxfs
/users/oracle_dump (/dev/vgfc8/lvol1 ) : vxfs
/users (/dev/vg00/lvol9 ) : vxfs
/usr (/dev/vg00/lvol7 ) : vxfs
/var (/dev/vg00/lvol8 ) : vxfs
/stand (/dev/vg00/lvol1 ) : hfs
/ (/dev/vg00/lvol3 ) : vxfs

"bdf" gives me (sorry, it's a lot of output too)
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 307200 74281 218393 25% /
/dev/vg00/lvol1 199381 43308 136134 24% /stand
/dev/vg00/lvol8 2048000 1408577 599802 70% /var
/dev/vg00/lvol7 2048000 684491 1278326 35% /usr
/dev/vg00/lvol9 4517888 2896020 1520504 66% /users
/dev/vgfc8/lvol1 226443264 195601336 30601024 86% /users/oracle_dump
/dev/vgfc9/lvol1 20951040 17467736 3428880 84% /users/oracle
/dev/vg00/lvol4 409600 39856 347349 10% /tmp
/dev/vg00/lvol6 2048000 778280 1190425 40% /opt
/dev/vg00/lvol5 1048576 16444 967669 2% /logs
/dev/vgfc10/lvol1 492306432 348862320 142323464 71% /users/oracle_backup
cafs:/shared/homedirs/dev1
427924288 153771888 252415104 38% /home/dev1

Quote:
Originally posted by Perderabo Also "cd /tmp" and repeat the mkfifo stuff.
[dev1@la]/home/dev1% cd /tmp
[dev1@la]/tmp% mkfifo bla
[dev1@la]/tmp% cat bla &
[1] 14891
[dev1@la]/tmp% echo "this is a test" > bla
this is a test
[dev1@la]/tmp% ls -l bla
prw-rw-r-- 1 dev1 cadev 0 Apr 15 19:52 bla|
[1] + Done cat bla &
[dev1@la]/tmp%

IT WORKS??!! Can you please explain why it worked in /tmp but not in my /home directory??
# 12  
Old 04-15-2004
Driver, I'm thinking alan has an nfs mounted home directory with the nodevs option set. I would still expect fifos to work under that scenario, but I'm not totally sure.

alan, give Driver's program a try. Knowing which system call is failing with which error will help.
# 13  
Old 04-15-2004
Quote:
Originally posted by Perderabo
Driver, I'm thinking alan has an nfs mounted home directory with the nodevs option set. I would still expect fifos to work under that scenario, but I'm not totally sure.

alan, give Driver's program a try. Knowing which system call is failing with which error will help.
Okay...I need somebody to whack me on the head with a 2x4...DRIVER : you wrote "That should yield a more descriptive error message" when talking about this program. Are you saying it should return an error when I run it against my fifo? Because it does not...

(1)log in to my account:
[dev1@la]/home/dev1
(2)paste DRIVER's code vi new.c ...
(3) compile it: cc new.c -o new
(4)[dev1@la]/home/dev1% mkfifo bla
(5)[dev1@la]/home/dev1% cat bla &
[1] 15141
(6)[dev1@la]/home/dev1% ./new bla
x
[dev1@la]/home/dev1%

Looking at the output of bdf and df, it seems that indeed, the file system for my /home directory is NFS mounted while /TMP is on "vxfs". Why does it matter? Can somebody PLEASE enlighten me?
# 14  
Old 04-15-2004
Quote:
Originally posted by Driver
Interesting development...but try using ``>>'' with the shell to see whether there's a bit of truth in this:
Okay....using ">>" instead of ">" worked.

[dev1@la]/home/dev1% mkfifo bla
[dev1@la]/home/dev1% cat bla &
[1] 15586
[dev1@la]/home/dev1% echo "test" >> bla
test
[dev1@la]/home/dev1% ls -l bla
prw-rw-r-- 1 dev1 cadev 0 Apr 15 20:36 bla|
[1] + Done cat bla &
[dev1@la]/home/dev1%

It also worked successfully with MKNOD. It seems to confirm that the file system is the culprit, correct?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parsing file: struggling against sed command

Hello fellows, Sure you can help this poor guy that is struggling against sed command, being unable to tame it I have a lot of files like this: From this one, I need to obtain values highlighted in bold/red To do so, I am executing this piece of code inside a loop: ... (10 Replies)
Discussion started by: manolain
10 Replies

2. UNIX for Dummies Questions & Answers

Struggling to combine two Greps statements

Greetings! I have been tasked to create a report off files we receive from our hardware suppliers. I need to grep these files for two fields 'Test_Version' and 'Model-Manufacturer' ; for each field, I need to capture their corresponding values. When running each statement separately, I get... (4 Replies)
Discussion started by: alan
4 Replies

3. Homework & Coursework Questions

Help with Mkfifo and exec

Hello guys! I am doing a project for the university and I have to do that a process has to create several children through fork(). The father process sends a pathname to each one through exec and the children must send to the father a list with the files from each directory. The father... (1 Reply)
Discussion started by: dano88
1 Replies

4. Programming

Help with Mkfifo and exec

Hello guys! I am doing a project for the university and I have to do that a process has to create several children through fork(). The father process sends a pathname to each one through exec and the children must send to the father a list with the files from each directory. The father is... (1 Reply)
Discussion started by: dano88
1 Replies

5. Shell Programming and Scripting

Struggling with AWK

I know this is an easy problem, but I've been struggling with it all morning and finally admit I need help. I have two files that I need to compare. After doing this the easy way (grep -F) I realize that there are other fields in file2 that match field1 in file1, so I turned to awk. I want to... (7 Replies)
Discussion started by: moldoverb
7 Replies

6. Shell Programming and Scripting

Struggling with arrays and delimited file

Hi, I am trying to use arrays in my script but can not seem to get it to work. I have a file called sections, this contains headers from a tripwire log file, separated by "@" but could be "," if easier The headers will be used to cut sections from the log file into another to be mailed. ... (5 Replies)
Discussion started by: pobman
5 Replies

7. Shell Programming and Scripting

struggling within awk

!#/bin/bash cat input.sh | awk ' { cur1=tolower($1) cur2=tolower($2) rsh $cur1 report | grep $cur2 # i just want to make the code line to work } ' the error which i get is .... ./madh1.sh: line 1: !#/bin/bash: No such file or directory awk: cmd. line:13: rsh $cur1 report |... (4 Replies)
Discussion started by: geeko
4 Replies

8. UNIX for Advanced & Expert Users

Help- Unix File Compare- Struggling

I had posted this earlier about 3 weeks ago and had recieved a response and I did sort both the files and the comm command is still not working. Can someone please assist me, I would really appreciate it. Below is what I am trying to do I need to compare File A with File B and create FILE C... (2 Replies)
Discussion started by: guiguy
2 Replies

9. Shell Programming and Scripting

Struggling with a text file

Hi, I am struggling with the following... I try to grep out information of a text file I got with lynx, a text browser. The text file I get from lynx with dump is attached in the bottom. What I would like to get is another file containing the astro-ph/98324 (number) and title and list of... (13 Replies)
Discussion started by: pau
13 Replies

10. UNIX for Dummies Questions & Answers

struggling with addusr ...

I'm completely new to UNIX, and having got the hang of directory navigation / creation (Just about), I think it is time to create an FTP account, so that I can upload a web site remotely. Herein lies the problem... 1: I cannot find a breakdown of addusr commands, so I cannot create a... (2 Replies)
Discussion started by: Dufty
2 Replies
Login or Register to Ask a Question