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
0 votes
0 answers
34 views

2>&1 | tee cannot get full output log

I'm using the timeout command to call my application in timeout duration. And I also use 2>&1 | tee to write the log in my application to a log.txt file. The command: timeout 20 my_application ...
user avatar
2 votes
1 answer
254 views

Prevent shell script from hanging on a line

I have a written a shell script that helps me calculate the disk utilization in remote servers using df -h. I'm including the code snippet below s_arch_1_per=`sshpass -p 'password' ssh root@...
user avatar
1 vote
0 answers
48 views

Server timeout if 2 devices are used in the same network

I have 2 devices: a computer and a Android smartphone on the same network, if a do like 10 requests on my server with my Android phone, I have a timeout when I try to do the request with my computer ...
user avatar
  • 111
0 votes
0 answers
58 views

Why timeout called by python subprocess hangs its called shell program?

My program is like import subprocess subprocess.run(f"timeout -s 9 30 cat", shell=True) However, it has no reaction to input from tty. Removing timeout or running the full command in a ...
user avatar
0 votes
1 answer
46 views

Loop iteration skip on timeout

So I have code something like this. There are two external scripts it runs and sometimes they run too long. I want to limit their execution adding timeout to each loop iteration, but I can't figure ...
user avatar
2 votes
0 answers
33 views

Command for Idle timout [duplicate]

timeout is nice for killing a command that does not complete within n seconds. Is there a similar command to kill a command that has not printed anything on stdout for n seconds (and which therefore ...
user avatar
  • 29.5k
1 vote
0 answers
33 views

What is a good way test the lftp xfer:timeout feature

Has anyone who has experience with the lftp utility been able to test the xfer:timeout feature? I am switching to lftp client version 4.8.3 and need a way to test xfer:timeout. xfer:timeout (time ...
user avatar
0 votes
0 answers
23 views

Problem with server - client connection

I run PyCharm on a Debian 11.1 machine and I want to use the Remote debugging with the Python remote debug server configuration. In this debugging procedure PyCharm emulates a server which connects to ...
user avatar
0 votes
1 answer
41 views

Duration of host unreachable by ping

Suppose I am pinging an IP and the destination is reachable. I did some change in the network so for a few seconds the destination was unreachable. After few seconds it comes live again. Is there any ...
user avatar
0 votes
1 answer
34 views

Terminate a pipeline if no data flows for n seconds [duplicate]

I have a piece of software that produces data on stdout for a while, then continues running but doesn't output any more data. I have a pipeline that takes that output and processes it further, saving ...
user avatar
  • 155
0 votes
1 answer
239 views

timeout stty hangs

I don't understand why the behavior of executing the following script: $ cat z.sh saved_stty=$(stty -g) echo "saved_stty: ${saved_stty}" stty "${saved_stty}" $ ./z.sh saved_stty: ...
user avatar
0 votes
1 answer
147 views

How to ssh from windows to linux?

I want to ssh from windows 10 to linux. I installed OpenSSH server and client. When a I tried to ssh to my own pc, it work. Port 22 is opened. i tried without firewall. But when i tried to linux I get ...
user avatar
0 votes
3 answers
235 views

how to display command output on terminal using timeout

if i do dd if=/dev/zero of=/dev/null it show the results on terminal. but i want to run this command for a specific period of time and show the results. for example, i tried timeout 10s dd if=/dev/...
user avatar
0 votes
1 answer
224 views

Bash - "timeout" with tail issue

timeout 0.6s $(tail -f ./file.txt | grep -qA2 --line-buffered "detail: " | grep -E -- "$KeyNumbers") So timeout isn't functioning as intended with this. I want it to cancel if ...
user avatar
  • 3
0 votes
1 answer
44 views

file send to 000webhost by filezilla

Status: Connection established, waiting for welcome message... Status: Initializing TLS... Status: Verifying certificate... Status: TLS connection established. Status: Server does not support non-...
user avatar
1 vote
1 answer
792 views

How to use the bash timeout function for commands requiring sudo?

In Bash this will set a time limit of 10 seconds for the slowcommand timeout 10 slowcommand I'm wondering how I could get the same behavior, if I had to call sudo in order to run slowcommand, i.e.: ...
user avatar
  • 31
0 votes
1 answer
130 views

How to forcefully close a ssh connection is the command on the target server never returns

I have an automation tool that generates and executes the below command that fires rpm -qa grep httpd on the target host 10.9.100.67. ssh -vvv -o StrictHostKeyChecking=no -o 'IdentityFile="/app/...
user avatar
  • 297
0 votes
1 answer
92 views

how to repeatedly stop and restart a command

I'm trying to find a simple way to repeatedly restart a command after a certain time (let's say 10 seconds for the purpose of this question). For simplicity let's say the command in question is htop -...
user avatar
  • 103
0 votes
1 answer
288 views

Timed tcpdump: pipe is slow

What I actually want to do is measure tcpdump for 10s. $ timeout 10s tcpdump > my.log but I found there has only a short period actually being logged, instead of whole 10s. therefore I did this ...
user avatar
  • 11
-1 votes
1 answer
85 views

Get the exit code before disown

I am executing a command using timeout in the following way that waits for seconds and then exits timeout -k 1 10 <command> &> error.log & disown % However, I've realized that since ...
user avatar
0 votes
1 answer
1k views

ssh: connect to host host port | No firewall

I have a Debian server and I'm trying to access it by ssh from another server and I'm getting timeout error. I have no iptables rules on any of them, and actually I can ssh to target host from any ...
user avatar
  • 101
0 votes
0 answers
112 views

Can't connect SSH from VM to other computer

I connected on my network, two computers, one is hosting a virtual machine(CentOS) connected as Bridge, the other is a Debian. Host (Windows 10 - 10.10.10.2) - Vm (10.10.10.3) - Debian(10.10.10.4) I ...
user avatar
  • 1
0 votes
1 answer
82 views

If someone logs into serial and exits console without logout, how do I automatically logout?

am using a debian based linux system. There is a console access to it via Lantronix SLC8000 Advanced Console Manager. When I login it asks for username and password (Both Console manager and server ) ...
user avatar
0 votes
0 answers
165 views

ssh session for Azure CentOS virtual machine keeps getting disconnected after only few seconds of inactivity

ssh session with PuTTY to an Azure CentOS virtual machine keeps getting disconnected after only few seconds of inactivity. Also i am running a self developed process that gets killed for no reason .. ...
user avatar
  • 101
3 votes
2 answers
494 views

Adding a timeout to a parallelized call in Bash

I have a simple Bash script I am running to parallelize and automate the execution of a program written in Sage MATH: #!/bin/bash for i in {1..500}; do echo Spinning up threads... echo Round $i ...
user avatar
0 votes
0 answers
199 views

Script to set sudo timeout

I would like to use a script to change the sudo timeout of a machine in an automated fashion. Everything I've found online related to changing the sudo timeout is in regards to visudo and manually ...
user avatar
3 votes
1 answer
672 views

Linux timeout command using actual time? Broken binary?

I want to have timeout kill a script after one hour. On debian I run timeout 1h <script> and it simply works. On my arch linux machine, things are different. After trying some stuff I think I ...
user avatar
  • 1,614
1 vote
1 answer
273 views

Perform special action on bash timeout

This question is related only to bash, no ssh or any other tool. I would like to detect a bash timeout, and only a timeout: I am NOT interested in any other exit conditions (exit, EOF, ^D, or ...
user avatar
  • 163
1 vote
0 answers
372 views

Timeout shell commands without the timeout command when job control is not available

I would like to automate the process of doing some benchmarks on a remote device using a serial connection, the benchmarks could potentially fail without stopping, so I would like to add a timeout to ...
user avatar
  • 230
0 votes
1 answer
523 views

Timeout for function in the kernel

I'm trying to add a timeout for a c function in the kernel. I'd like to do something like the function try_until_timeout of the following pseudocode: void myfunction() {/* [...] */} void ...
user avatar
  • 133
4 votes
3 answers
614 views

tail a log util keywords found or timeout

I'm using a special way that can let me visit google. It is very different in the page now... So I can edit the question and comment the answers normally. I deleted more early discussions and go to ...
user avatar
2 votes
1 answer
6k views

Dig: connection timed out; no servers could be reached. But ping works?

When I try to run the dig command against either my servers IP or nameserver I get an error: root@kali2:/etc# dig q-type=soa @192.168.100.10 ; <<>> DiG 9.11.4-P2-3-Debian <<>&...
user avatar
  • 21
1 vote
3 answers
209 views

TMOUT within script file misbehaves for the select command. How to fix it?

UPDATE - looks like this is something peculiar with bash 4.3.42 as it works fine with 4.3.46. Leaving this post for those who run into the same issue in future. When I run this command in bash ...
user avatar
  • 121
0 votes
1 answer
1k views

Why does dig utility hang indefinitely even with timeout specified?

I'm using dig utility to find public IP address. The command I used is: dig +short myip.opendns.com @resolver1.opendns.com but I had problem since on some other computers it took so long, so I ...
user avatar
2 votes
0 answers
331 views

Setting a timeout and limiting memory of a process

I'm trying to run a large process on my machine with a timeout and maximum memory limit. For handling the memory usage, I created a cgroup and use this shell script to start the process: #!/usr/bin/...
user avatar
  • 4,287
0 votes
1 answer
133 views

Exported Date Variable not appearing in subshell

I'm currently working on creating 2 bashes with two different scripts which result in two files named with the same timestamp for easy comparison/processing later. The date variable gets created in ...
user avatar
2 votes
1 answer
99 views

Cat blocking when piping output from /usr/bin/gssproxy (`timeout -k 1 1 /usr/bin/gssproxy | cat` does not terminate)

I use gssproxy under Arch Linux, in particular Name : gssproxy Version : 0.8.0-1 I encountered the following behavior: When trying to pipe the output of /usr/bin/gssproxy like ...
user avatar
4 votes
2 answers
2k views

Setting variable output from timeout

I'm trying to automatically query a status via telnet (this isn't something I'm able to work around in this case). The idea is to grep for something and assign the result to a variable, to pass to a ...
user avatar
  • 379
1 vote
2 answers
1k views

How to timeout a program with a potentially infinite loop

Suppose I run a program that I suspect to contain an infinite loop, or some other code that might run for too long. I know that in Linux I can do: timeout 1 ./program to give the program a time-out ...
user avatar
3 votes
0 answers
704 views

/sys/block/sd*/device/timeout not accurate

The default value for the timeout file for SCSI disks is 30, supposedly meaning 30s. In my dmesg logs, I find that the system is waiting 180s before timing out. Setting timeout to various values ...
user avatar
0 votes
2 answers
2k views

wget not downloading streaming mp3 correctly

I am trying to download a streaming mp3 using wget. this is my basic command: wget http://sj128.hnux.com/sj128.mp3 -c --timeout=1 --waitretry=0 --tries=0 -O "file.mp3" i have been doing this in a ...
user avatar
1 vote
1 answer
557 views

Stop netcat as soon as grep matches something

I am facing a problem using netcat in a bash script. I would like to match a specific output after sending a command and continue the script execution as soon as possible (not waiting for a netcat ...
user avatar
4 votes
1 answer
5k views

Slow boot time after cloning disk and resizing partitions

I recently replaced an SSD with a larger SSD. I used Clonezilla to clone the old disk to the new one. After that I used GParted Live to resize the existing partition, pushing the swap partition to the ...
user avatar
  • 527
3 votes
1 answer
199 views

Coreutils timeout(1) plays badly with man/less

I want to set a timeout to the less(1) command on our company's production server. Everyday we produce large log files on it, and despite the nightly batch job to archive/remove them, we sometimes get ...
user avatar
  • 387
0 votes
1 answer
688 views

Maximum timeout for process

I have a script which I think can take few days to finish. Basically it submits slurm jobs when queue isn't full and in the process it can wait a while. The script results in incomplete results, ...
user avatar
  • 101
1 vote
2 answers
1k views

Connection errors on Apache httpd proxy, but only for some vhost

I set up an Apache v2.4 reverse proxy on a CentOS 7 machine, serving requests to several vhosts; amongst these there are Atlassian application servers. The proxy's private IP address is 10.0.0.77, ...
user avatar
  • 25.3k
2 votes
1 answer
100 views

Suggested improvements to stream-recording script: timeout?

I'm trying to adapt the script below (taken from https://superuser.com/questions/181517/how-to-execute-a-command-whenever-a-file-changes) to cause my system to record a video stream whenever a ...
user avatar
  • 361
1 vote
1 answer
281 views

Is there a timeout for the networksetup command on macOS?

I want to set a 1 second timeout for networksetup so the command does not take longer than 2 seconds at most.
user avatar
5 votes
1 answer
586 views

Timeout subprocess pid

I'm using the timeout utility inside a bash script to run a command for a given time (e.g., timeout -s SIGINT 500s ./my_script). I want to monitor the process myscript to see how much CPU/memory it ...
user avatar
  • 163
1 vote
1 answer
535 views

The `read` builtin hangs indefinitely when used with `timeout`

The script below works perfectly with bash but not with sudo bash or sh. Pressing enter or ^C won't work. Only ^\ and ^Z work, but not with sudo bash. printf '#!/bin/sh\nread var\n' > myscript ...
user avatar
  • 501