Questions tagged [timeout]

A command which runs a specified command for a given time, and then terminates it. See http://man7.org/linux/man-pages/man1/timeout.1.html

Filter by
Sorted by
Tagged with
2
votes
1answer
60 views

Schedule cancellable script to run after duration

I want to be able to run a script after a certain duration has elapsed. I also want to be able to cancel it and reschedule it, i.e. increase the duration on-the-fly. I was thinking of somthing like ...
3
votes
1answer
1k views

Systemd - restart service if it is activating too long

I have a systemd service and some ExecStartPost scripts. Sometimes these scripts may take a long time. While these scripts are executing, service is in "activating" state. Is there any way to set an ...
4
votes
1answer
2k views

read timeout parameter (-t) not working?

I'm not sure how to explain the problem in general, so I'll just use this example: #!/bin/bash cleanup() { rm "$myfifo" rm "$mylock" kill '$(jobs -p)' } writer() { for i in $(seq 0 ...
1
vote
1answer
295 views

Timeout when mounting EFS on EC2

Let us say I have an EC2 VM which we will call V in security group S1. I have an EFS mount point which we will call M in security group S2. Everything is in the same VPC, on the same subnet, in the ...
1
vote
1answer
638 views

How to get raw output of showkey for use in a script? [closed]

I want to get the output of showkey for use in a script, without the 10 second limitation.
13
votes
2answers
19k views

How to execute code in a new tmux session - from within current session?

I use Ubuntu 16.04 and I need the following tmux solution because I want to run a timeout process with sleep as in my particular case I wasn't satisfied from at and encountered a bug with nohup (when ...
5
votes
3answers
6k views

SSH: connection reset after idle for some time

When my connection has been idle for some time, the remote host closes the connection. I try to type a new command, it hangs, then closes the connection. How can I keep the ssh connection active for ...
1
vote
2answers
974 views

How to execute nohup in an heredocument?

I have this timeout code block: #!/bin/bash WB=$1 sleep 2h; commands... kill $WB To run the script with nohup and in the background, I can paste it in a file, and execute: nohup /opt/myscript.sh $$...
1
vote
1answer
165 views

Making “at” or “sleep” utilities to print stdout in timeout, on the highest of Bash sessions [closed]

I want to execute a set of commands 2 hours ahead from current time (i.e, in a timeout). I need to keep using Bash regularly while these commands are timed-out (i.e, the commands need to run in ...
5
votes
9answers
1k views

How to timeout by hours in Bash (and keep timing out even if the session was closed)?

I created the following script to install and then uninstall PHPmyadmin on Ubuntu 16.04... My aim is to use this script each time I want to use PHPmyadmin, and then, after some time like 2 hours, ...
0
votes
1answer
1k views

timeout command and pipe - order of precedence

I need to test receipt of TCP data. I may not use iperf. The requirements are saying that I should create a TCP server to which will someone will send random data. I need to count the number of ...
3
votes
1answer
961 views

Send random data over TCP for a while, and count how many bytes were sent

To test data throughput, I want to 1) for X seconds 2) send random data 3) over TCP, and 4) to know afterwards exactly how many bytes were transmitted. My best attempt (which is not much) 1) timeout ...
3
votes
3answers
1k views

Pass-through pipe with timeout

How can I implement a timeout when no data is being passed through a pipe? It would act as watchdog with following usage: process1 | watchdog --timeout 60 | process2 When no data pipes through I ...
1
vote
1answer
645 views

FreeBSD pkg installation operation timed out error

I'm trying to install some packages in FreeBSD. I got this timed out error during installation of gnome3 also.Now I'm trying to install Firefox and again same error. Can anyone give me solution for ...
2
votes
2answers
6k views

Tcpdump - counting outgoing and incoming UDP packets

Is it possible with tcpdump to count (for some set up time) the number of outgoing and incoming UDP packets? I don't have much experience in tcpdump, so an advice how to do that would be very helpful....
4
votes
3answers
660 views

SSH-like session that survives physical network disconnection

I want my SSH login session to remain connected after the computer goes to sleep and wakes up. From what I understand TCP can survive intermittent network problems, so can I change settings so that it ...
4
votes
2answers
974 views

bash syntax - wrapping command inside sudo :: tail logs until string found with timeout using Terraform

Goal: using sudo execute a one line cmd to tail a log until a string is found and then exit 0. If the string is not found within a given timeout, exit anything but 0. Attempted Solution 1: ...
5
votes
1answer
2k views

Return status of Busybox `timeout` command

I'm writing a shell script that's supposed to function on various different distributions, some of which are using busybox and some are not. This script uses the timeout command to figure whether a ...
2
votes
1answer
4k views

What is default value of ServerAliveInterval?

I’m using Amazon Linux, [davea@mymachine ~]$ uname -a Linux mymachine.mydomein.org 4.4.35-45.83.amzn1.x86_64 #1 SMP Wed Jul 27 22:37:49 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux In my /etc/ssh/...
1
vote
1answer
1k views

Can't ssh to myself through internet?

I'm trying to connect to myself through ssh. (For testing purpose). I'm on a Ubuntu laptop. I successfully launched a ssh serveur, and "ssh localhost" works fine. If I try "ssh ", it works too. (I got ...
2
votes
1answer
894 views

SSH only works/keeps alive while ping running in background

A brand new linux box running Ubuntu 16.04.1 (LTS) Server was installed into a Citrix VM. It was set up with openSSH. When connecting to it via, it will timeout. This happens even immediately after I ...
2
votes
0answers
507 views

NFS caches expiring unexpectedly

I need to build a NFS4 + CacheFilesd setup on a high latency, low throughput link where local caches never expire. The only invalidation semantics must be the NFS Server callbacks when something is ...
2
votes
1answer
4k views

How to get the output of timeout command without using a shell script

I am using a ssh command executor in java which runs the command and gets the output in stderr, stdout and an integer exit value. I am trying run a command with timeout like, timeout 5s COMMAND ...
1
vote
2answers
1k views

Cp default timeout limit [closed]

I have a script that creates and copies a file to multiple machine on a network. Sometimes a machine or two may be down, which in turn causes the cp to take a really long time to timeout. My ...
6
votes
1answer
607 views

Restart systemd service when output is no longer generated

Is it possible to restart a systemd service when there is no output generated for a predefined amount of time? I have a script which apparently can hang, but that is not detected by systemd (or ...
1
vote
0answers
598 views

Linux - Cannot connect using ssh key

I used to connect normally to the website on digitalocean using ssh keys and it works normally. Currently I tried to connect and suddenly I keep getting: ssh_exchange_identification: read: Operation ...
2
votes
0answers
942 views

Is an SSH connection timeout expected when iptables is set to REJECT?

We’re setting up a firewall for a machine that should allow: incoming SSH connections from particular IP addresses; ICMP, except for redirect. We’ve opted to use REJECT over DROP, at least until we’...
14
votes
1answer
2k views

POSIX equivalent for GNU timeout?

The GNU coreutils timeout command is extremely handy for certain scripting situations, allowing for using the output of a command if it is quick to run, and skipping it if it would take too long. How ...
5
votes
2answers
54k views

How to find and edit “Apache timeout”?

I'm trying to view the default value of Apache timeout of my server, but I found nothing about that in /etc/httpd/conf/httpd.conf . So where is " timeout " supposed to be and how do I change its value ...
1
vote
0answers
2k views

Apache Load Balancer Timeout

We have two httpd servers running on RHEL 6 behind a hardware load balancer We are getting timeout errors in our httpd error log. [Fri Feb 19 15:06:49.823372 2016] [proxy_http:error] [pid 15760] (...
3
votes
2answers
2k views

How does an SSH connection become inactive? [duplicate]

I have setup an SSH connection to run a program on a remote server. The program prints debug information on the terminal every 10 seconds. If I leave the SSH windows open for a long time (say 10 hours)...
0
votes
1answer
776 views

timeout when initiating a sshfs connection

I have following line in /etc/fstab 192.168.1.10:/data /mnt/data fuse.sshfs rw,noauto,nosuid,nodev,noexec,_netdev and following line in /etc/rc.local: mount /mnt/data During boot process, the ...
1
vote
1answer
625 views

timeout doesn't work with accumulo shell in bash script

I'm trying to check if a scan of an Accumulo table times out (to see if the table is corrupted). #!/bin/bash timeout -s KILL 20s accumulo shell -zi myInstance -u root -p secret -e "scan -np -t ...
2
votes
1answer
99 views

Tracking where the script stopped after timeout

I've got a shell script doing connection performance test, that I timeout if it takes too long. Upon timeout, it logs the results of a few commands so I can make myself an idea of the system status ...
0
votes
1answer
56 views

run a programm with timeout sending multiple signals in different times

i need to run a programm with timeout with multiple time limits and different signals for the limits. for example: run nano with timeout sending SIGTERM after 5s and after 10s SIGKILL
0
votes
1answer
346 views

How to extract all links from a given url in a decent time

I'm trying to extract the links from a specified url and redirect them to a file. At first I tried using --spider , this is my code: wget --spider --force-html -m http://file/path 2>&1 | grep ...
10
votes
1answer
37k views

systemctl keeps timing out on service restart

I'm running CentOS 7.2; see below: # systemctl stop firewalld Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: Timeout was ...
1
vote
1answer
1k views

Postfix cannot start but dovecot is ok

My postfix service cannot start. Here is message: Job for postfix.service failed. See 'systemctl status postfix.service' and 'journalctl -xn' for details. And here is service status: postfix....
2
votes
2answers
4k views

Apache SSL timeout is not matching settings

I have a CentOS 6.7 apache Server version: Apache/2.4.7 (Unix) server with both http and https ports configured. They are configured the same, except for the SSL specific settings. The most relevant ...
1
vote
0answers
4k views

Kali 2.0 Reaver 1.5.2 EAPOL request times out error (code: 0x02)

Hi and thanks very much in advance for any help. I am new to Kali and reaver and am encountering an issue with EAPOL requests getting stuck. To explain the whole situation, reaver itself won't ...
0
votes
0answers
48 views

java frameworks ( tomcat, jboss ), tcpip, session expiration

We have in house linux servers from different vendors, so each server has a different distro ( rhel, centos, debian, ubuntu ) and tomcat or jboss. With some web application, if the logged user ( ...
0
votes
1answer
148 views

Timeout procedure for using to much memory or cpu

How hard is it to create some kind of timeout procedure for using to much memory or cpu on a linux/unix server? What would you have to do to do this? This happens WAY to often. I understand you may ...
5
votes
1answer
825 views

Give script time to execute, if exceeded, stop it

Is this possible, to give max time in seconds to script for execution? for example, i have script, that pings some network. Usually, it takes about 10 seconds, but if execution takes more than 10 ...
20
votes
2answers
1k views

timeout, breaking pipes and wc

I had an idea to quickly benchmark some decompression programs. E.g. for gz, I would run the command: timeout 10 zcat foo.gz | wc -c Which would measure the amount of data the decompressor could ...
2
votes
2answers
715 views

Run and stop a monitoring command as sudo for s seconds every m minutes

I want to run sudo airodump-ng -w myfile every ten minutes or so, for m minutes. It does not matter if the running time shifts (that it, if it runs m minutes later each time). Notice that this is a ...
2
votes
2answers
962 views

Batch timeout alternative?

What I need is an 80 seconds sleep, that I could skip by hitting a key. Being able to see the remaining time would be a plus.
2
votes
0answers
73 views

'Unbusy' terminals which will be logged out when TMOUT is reached

I would like auto-logout some terminal sessions with a TMOUT (timeout) configuration, but in that case the users leave a program opened for which the 'unbusy' sign is the ZERO I/O between server and ...
2
votes
1answer
1k views

Silently timeout command in zsh

This is an oft-asked question: Super User: Loop: Start program and kill after time out SO: How to kill a child process after a given timeout in Bash? SO: How to run a process with a timeout in Bash? ...
16
votes
1answer
1k views

Why does oot say “hey” in usleep -o?

On a Centos 6.6 box I noticed this... [root@abcd /]# usleep --help Usage: usleep [microseconds] -v, --version Display the version of this program, and exit -o, --oot oot says hey! ...
2
votes
2answers
2k views

Huge delay in script response when using SFTP with expect

I am using a script to call SFTP service to fetch some logs from the remote server. This works fine in normal scenario but, i have noticed a very long delay of around 30 minutes or more in some of the ...