CentOS 5 :: Bash Script Under Cron Produces Broken Pipe
Apr 20, 2011
I have script which does file locking via flock and then writing it's pid into that file. It perfectly works being run by hand in terminal, running under cron on Debian, but somehow fails being run under cron on Centos 5.6. Script part and straced outputs are below.
I move a page from a server in SuSe to Debian and this script was working well but when I move the page to a Debian base server it is sending in the logs the following message:
cat: write error: Broken pipe, referer: [URL]
The cgi does the following, read a db file plain text that repeat each 15 lines an information where to look the seraching info. if it is there sends to the output the 15 lines block. but it was not sending errors in suse distro, does anybody knows why the cat's line are sending "cat: write error: Broken pipe," if I am not writing or making a pipe with ">" to none file.
I've written a simple server in linux used fork to create a FIFO pipe.The server create two FIFO pipe.One for server read data from client and write data to client.Then another pipe for client read data from server and write data to server.When the server read data from a client used server-pipe and then write data to client.But ,if the client no read open the pipe,the server side write will be crashed because of a broken-pipe SIGPIPE. How to check whether the read side is opened?Or,how to catch the SIGPIPE,and then my server will still execute on,not crashed!!
I am running somes instances of Redis. I want to get Redis stats with following command:
Code:
$ echo "info" | nc <server_IP> <port>
but sometime it returns nothing. The first thing come to my mind is broken pipe or something like this. I always get the result if telnet to Redis and typing 'info' command. I also try pipe viewer to monitor the progress of data but it didn't help:
We are facing broken pipe exception while connecting to SMPP gateway through TCP/IP.on RHEL4 It is coming till we restart the application. Below is the exception we are getting. java.net.SocketException: Broken pipe
I connect to our server by ssh, default ssh client on Debian system.when I run a command that has large output on stdout (on shell) my connection is lost and I get error: "Write failed: Broken pipe"Unfortunate on our server there is limitation for connection per hour!
I am building a python script which works same as SMTP protocol. I have build separate functions in that for each command of SMTP, and after this i have integrated all those functions in a new function named as send_mail(so that i don't have to execute every function separately for every command). Now, when i execute the script for the first time it runs successfully, but for the second time it gives the error of "BROKEN PIPE". I really can't make out how the socket is getting closed.
my net worked HP printer will not print-broken pipe - this started after I had to switch off the printer at the mains in order to attend to a paper jam. Now it will not print apart from a test page. I am using Fedora 10 and the device info is "hp:/net/Officejet_Pro_L7500?ip=192.168.0.4"
I have installed a LAMP server (Debian Lenny + Apache2 + PHP Version 5.3.1-0.dotdeb.1). On this machine, my web application (PHP + MySQL) exists in 2 flavours:
- Dev - Prod
In /etc/apache2/sites-available, I have ims & ims-dev, one for each instance. Their contents are identical in terms of settings, except for the paths (dev/prod):
I wrote y bash script that opens YouTube playlist using youtube-dl and VLC applications: the output of youtube-dl is the input of VLC. The only problem is VLC needs to be closed after each playlist item unless I get the error message of the operating system:
"ERROR: unable to write data: [Errno 32] Broken pipe".
I understand the reason but I don't know how to resolve it: it is possible to close previous STDIN of VLC without killing the entire VLC process so that a new youtube-dl instance can connect to the same VLC instance? In short this is my question. The problem is detailed here: Downloading and playing videos and subtitles.
I'm following the "The Perfect Server - Fedora12 x86_64 [ISPConfig 3]" instructions and I am encountering an error when trying to build the rpm for courier-imap (from page 4 of the HOWTO).
I understand that $! is the PID of a command. For example:
Code: #!/bin/bash myprogram & echo "PID of myprogram is $!"
I'd like to send the output of "myprogram" to both console and to a log file using the "tee" command but I also want to store the PID of "myprogam". Something like this:
Code: #!/bin/bash myprogram | tee ./logfile & echo "PID of myprogram is $!"
The problem is that $! is now the PID of "tee" rather than the PID of "myprogram".
I don't quite understand how pipes work in bash. I know that it takes an output from one command as the input in another command. What an output is I can get because it's what the command prints out to the screen. But how do I know what input a command will take? Here is an example I thought would work:
Which gem | rm Unfortunately it didn't. Which gem prints out "/usr/bin/gem" so that must be the output right? I thought that was given to rm so it would be "rm /usr/bin/gem" but I was wrong. How do I know what input a command takes?
Two processes are communicating through a pipe: A | B. A is writing data faster than B is reading it in. Is there any way to have A limit its writing rate to match B's reading rate?
AFAIK the pipe will get full, and will make A's writing block, waiting for B to read in more data. But is there a way to limit A's writing rate before the pipe fills up? (In a way it's like having a pipe with a really small capacity, but as far as I know pipe capacity is a constant compiled into the kernel.)
Code:
EXAMPLE FOR CLARIFICATION
Right now the command is printing out the following in 1-second intervals:
But with flow control it should print out (again in 1-second intervals):
...since "date" would block on the writing loop due to the slow reading loop.
Unpacking replacement ffmpeg ... dpkg: error processing /var/cache/apt/archives/ffmpeg_5%3a0.5.1+svn20100411-0.0_i386.deb (--unpack): trying to overwrite '/usr/share/ffmpeg/libx264-ipod640.ffpreset', which is also in package libavcodec52 4:0.5.1-3 dpkg-deb: subprocess paste killed by signal (Broken pipe) Errors were encountered while processing: /var/cache/apt/archives/ffmpeg_5%3a0.5.1+svn20100411-0.0_i386.deb E: Sub-process /usr/bin/dpkg returned an error code (1)
When using YUM UPDATE from the prompt more than 230 items are scheduled for update however when the download process has completed I receive errors regarding Perl dependences such as:
file /usr/lib/perl5/5.8.8/List/Util.pm from install of perl-5.8.8-27.el5.x86_64 conflicts with file from package perl-5.8.8-18.el5_3.1.i386
I am unsure how to overcome this. It occurs on two different servers.
I'm still a newbie when it comes to *nixes so these might be easy for some of you here is my problem I tried installing MIME::Lite using CPAN but it always produces an error so it doesn't continue, any other way to install it...
I am having a truly bizarre problem when trying to set up my sheeva plug as a backup server. I have four users (one for each member of my family) that I want to give permission to ssh in (well, sftp in but they're essentially the same) and backup to an external harddrive.
My user works perfectly well and has done since I got the plug. So does a transmission user I set up to run the transmission daemon. With the other three users, however, I get the following error after SSH asks for the user's password:
Code:
Write failed: Broken pipe
This happens whether I try locally or over my network. I haven't been able to find a solution to it at all. I've made sure that /bin/bash was set as the shell and that the home directory is writeable with the correct permissions (ls -al /home):
Code:
drwxr-xr-x 7 root root 4096 Dec 21 19:25 . drwxr-xr-x 21 root root 4096 Dec 17 19:27 ..
[code]...
The alternative for me would be to use netatalk and AFP but the problem is that there is no native support for AFP and so things like d�ja dup backup may not be able to mount the afp drive...
Whenever I put ssh into remote machine am getting the following messages. Write Failed: Broken Pipe (After logged into that machine ) Read Socket Failed: Connection reset by peer (While trying to log in ) Also known_hosts file is changed frequently.
which cropped up today after no changes to the system: I can successfully ssh into my ubuntu 64-bit 9.10 machine (via OS X with iTerm), but after about 30 seconds, the connection drops with the message "Connection reset by peer Connection to xx.xx.xx.xx closed".
If I then try to immediately ssh back in I get: "Write failed: Broken pipe". If I try to immediately ping the machine instead, I cannot ping it until the ~10th try. Eventually I can log back in again, only to be kicked off after between 5 and 60 seconds. I called the network people and their are no known issue right now with networking. The networking on the ubuntu machine is otherwise fine, it seems. In the /var/log/auth.log file, it simple says:
Quote: Feb 9 14:19:20 harriet sshd[4134]: Accepted password for xxx from xx.xx.xx.xx port 55105 ssh2 Feb 9 14:19:20 harriet sshd[4134]: pam_unix(sshd:session): session opened for user xxx by (uid=0) Feb 9 14:19:28 harriet sshd[4046]: pam_unix(sshd:session): session closed for user xxx
The solution I come across to a similar problem is to add a "ClientAwakeInterval" number to sshdconfig, but this (as expected) doesn't fix my problem.
I've been upgrading a bunch of our servers from sarge to etch and then to lenny, on two of these servers, cron has broken, cronjobs will not run. On another two (that have no significant differences from the others) cron is unaffected I created a simple job to run while I was testing
*/1 * * * * root /usr/local/mailtest-1 in the script is echo test mail from busted server | mail -s "test mail from your busted server" [URL]. and that runs fine if I run it manually, I've added it into /etc/crontab and crontab -e but haven't got a single mail from it. The cron service is running
I tried apt-get remove --purge and then a re-install but it doesn't seem to have worked. All the logs have stopped rotating as well so I'm starting to think that maybe it's not a fault with cron but with some other service that it depends on. However, I've not been able to figure out what that might be.
I'm doing ping between 2 RH servers through a VPN site2site tunnel and in some times I got in the result pipe 2 and another pipe 3 as I mark it in blue color below.
e.g.
64 bytes from 192.168.1.10: icmp_seq=0 ttl=128 time=0.229 ms 64 bytes from 192.168.1.10: icmp_seq=1 ttl=128 time=0.287 ms 64 bytes from 192.168.1.10: icmp_seq=2 ttl=128 time=0.278 ms
[code]....
What's the difference between pipe 2 and pipe 3 and what's the meaning of it?
I have an rsync script I wrote that I have tested and it works perfectly when I run it manually. Now I am working on a server setup script and I have gotten my setup script to create the rsync script in /etc/cron.hourly and restart crond. To spite the fact that the script is in /etc/cron.hourly and I have restarted crond, the script does not run. With that said, how can I script adding the rsync script to run hourly as a cron job?
I need to simply replace a 2 lines, or one and I'll run each command separately, in a eps file. I know I can grep the line and pipe that into the sed but I would like to keep this in a sed command. I can use sed /s and get it if I copy the section out of the file and paste it. Really just trying to rewrite the boundingbox coord's in eps files.
I've got a bash script that uses rsync via SSH to back up data from a remote webserver. This script works fine when I run it myself but when it runs as a cron job I get the following error:
I have a script that pops up a jpg file several times a day as a reminder. The script is called up by crontab and it works perfectly.The issue is that I want the script to also perform a system "beep" in addition to popping up the jpg file. When I test it on the command line everything works but when I run it in cron the jpg file pops up but the beep doesn't beep. I'm thinking the problem is in the "echo -e \a" part. I must be missing something.Here is my script:
Code: #!/bin/sh chown -Rc steven:users "/home/steven" I have more lines in the script but each line does the same error. This is run in a cron job but it always returns.
Code: chown: cannot access `/home/steven ': No such file or directory But it is a valid directory I have even tried adding an / and even a space on the end and still same error.
I have a personal server and a dynamic IP address, so I wrote a script to check the currently assigned IP address and compare it to the one stored in a file from the last check, and visit the update URL if it's different.