Piping to user application sometimes fail


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Piping to user application sometimes fail
# 1  
Old 10-07-2015
Piping to user application sometimes fail

Hi,

currently, I have a problem in a stress test bash script.

i´m using the following command:

Code:
while true; do echo $"command" | ./myprogram; sleep 0.4; done

--> myprogram is watching for stdin via select

The problem is that it will work a couple of times. After that, the stdin fd from the application is going crazy and fires all the time with 100% cpu utilization because there is no valid stdin anymore.

I figured out to use "unbuffer" for this case but it doesn´t solve the problem but it makes is far better (much more tries before error on stdin).
# 2  
Old 10-07-2015
You may want to do "man mkfifo" and write to that and read from that.

See if that makes a difference.
# 3  
Old 10-07-2015
I can't see anything that would explain what you describe. Is it possible the reason lies in your ./myprogram? Does the same behaviour occur if you put cat in its place?

Aside, watch you quoting.
# 4  
Old 10-07-2015
Quote:
Originally Posted by bertl100
The problem is that it will work a couple of times. After that, the stdin fd from the application is going crazy and fires all the time with 100% cpu utilization because there is no valid stdin anymore.
That's not an "error" -- that's just the way it is. Once it's read all the text there is to read, stdin hits EOF, and your program needs to be able to catch that.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Secure application user.

Gents I want command to export password of appuser to /opt/appuser.out user password will be changed by Access Management System from time to time. Application need this password to stay running otherwise will be impacted. Application will keep reading this file /opt/appuser.out to get... (3 Replies)
Discussion started by: AbuAliiiiiiiiii
3 Replies

2. Shell Programming and Scripting

Management application user rights on the files in a Unix / Linux

good evening .. I have a plea, who I can help me with a management application user rights on the files in a Unix / Linux I need for college .. .. and not told us no clue .. thank you (1 Reply)
Discussion started by: alex90
1 Replies

3. Solaris

New user: lost application manager

Dear all, I am a beginner with Solaris. I unfortunately remove the Application Manager from the Front Panel, and I really don't know how to put it again, or from where launch it... Could anyone help me? (1 Reply)
Discussion started by: avr
1 Replies

4. Programming

Questions about user authentication in my application

Hi, all, I am a newbie to linux authentication part. Questions below really puzzle me: How to authenticate users from local storage(passwd shadow) and nis server? (Without PAM) getpwnam_r() will return a '*' in the pw_passwd field of "struct passwd". I can parse /etc/shadow. But how... (1 Reply)
Discussion started by: mythmgn
1 Replies

5. UNIX for Advanced & Expert Users

Remote commands fail for tcsh user

I'm more familiar with bash/ksh that csh/tcsh. With that said, I recently ran across a problem with tcsh. Our system admin recently installed purify on our solaris 8 system. In order to use purify you have to execute a Rational script in order to setup the paths and some environment variables... (3 Replies)
Discussion started by: sszd
3 Replies

6. Linux

Launch application in gnome session of another user.

A gnome session is launched by UserA of System A, I am connected to userB of System B(or A) through PUTTY. I want to launch an application for eg: gedit through Putty in the display of system A. how can I achieve this. for eg:- root is logged in to System A, with gdm. DISPLAY=0.0, ip =... (4 Replies)
Discussion started by: Sivaswami
4 Replies

7. UNIX and Linux Applications

How to delete a user account in linux bases application.

Hi, Can anyone please guide me how can I remove/block a user from a server access. /usr/sbin/adduser -d /home/john john echo ****** | passwd --stdin john I used the above command to add a user "john". How do I delete and block john. Appreciate your responses.... (2 Replies)
Discussion started by: sureshcisco
2 Replies

8. Linux

How to delete a user account in linux bases application.

Hi, Can anyone please guide me how can I remove/block a user from a server access. /usr/sbin/adduser -d /home/john john echo ****** | passwd --stdin john I used the above command to add a user "john". How do I delete and block john. Appreciate your responses. (1 Reply)
Discussion started by: sureshcisco
1 Replies

9. UNIX for Advanced & Expert Users

any reason for a user without a homedir - security/config/application?

Hi, Can I just quick pick everyone brain here about the following: There is a security audit going on at the company I work for and one of the things that needed to be resolved was that there were a lot of users who don't have a home directory. As this is a fairly large environment of over... (5 Replies)
Discussion started by: Solarius
5 Replies

10. Shell Programming and Scripting

piping

I am using pipes (specifically piping out) in Perl to put an array from one file into an array in a different file. I can't figure out how to transfer the array. I kow how to open the pipe : open (FILEHANDLE, "| file") or die~ but how do I transfer the array. I think it has something to do with... (1 Reply)
Discussion started by: lnatz
1 Replies
Login or Register to Ask a Question