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
16 views

AVRCP volume change event fails in bluez 5.49

While connecting device with One plus phones, I am facing volume sync issue. Phone does not give absolute volume changes to device. I suspect while connection happening, Some capabilities exchange ...
Abdul Asik's user avatar
-1 votes
1 answer
84 views

How can I specify a maximum service duration in systemd service?

I have a problem where on rare occasions my Type=simple systemd service hangs or gets caught in a loop. This causes its timer to stop scheduling the service because, as confirmed with sudo systemctl ...
deanresin's user avatar
  • 441
9 votes
1 answer
581 views

Exit status of pipe with timeout command behaves differently in interactive shell vs shell script

Interactive sh shell session: $ sh $ timeout 1 yes | sed -n s/a/b/p ; echo $? Terminated 143 $ Non-interactive script via sh -c: $ sh -c 'timeout 1 yes | sed -n s/a/b/p ; echo $?' 0 $ Why do those ...
finefoot's user avatar
  • 2,980
1 vote
0 answers
38 views

unprivileged SSH sessions timeout but a session that has been su'd (to root) stays alive

From Windows-10, I use MobaXterm to SSH log in to a Fedora-38 machine remotely with unprivileged account 'mike' and typically establish a second session that I su to privileged 'root' account so I don'...
DarkSky's user avatar
  • 11
0 votes
0 answers
69 views

Time, Memory Limit and Timeout for Python Command Only

I want to enforce timeout of 5s to python command and at the same time want to measure the execution time for python command (taking into account that python3 command memory limit is 256 MB), what I ...
Albert Einstein's user avatar
0 votes
2 answers
41 views

How to monitor script execution time and generate notifications at milestone intervals without terminating the script?

Is there a way I can monitor the execution time of a script and generate notifications if the script is still running at milestone intervals? AFAICS, wait in bash always blocks. I intend using this in ...
symcbean's user avatar
  • 5,110
0 votes
0 answers
24 views

Why does this script get to linger after having seemingly exited from Ctrl-C? [duplicate]

I have a script, script-A, which runs script-B. When run under the terminal, it terminates as expected from Ctrl-C, but when run via ssh it continues to silently run after Ctrl-C even though ssh ...
yong's user avatar
  • 351
0 votes
0 answers
100 views

Shortening nvme timeout to fail _earlier_ - implications?

On the VMware Workstation virtualization hosting platform, using a Linux kernel, I am regularly facing [ 2181.746685] nvme nvme0: I/O 0 QID 4 timeout, completion polled I suspect that this is due to ...
Stefan Hoffmeister's user avatar
0 votes
0 answers
77 views

sigtimedwait sets errno to ETIMEDOUT with timeout=0

In a cpp multithreaded program, we're using a copy of Linux sigwait implementation at the end of our main function, after creating all threads and initializing our program: sigset_t mask; ...
binks's user avatar
  • 1
0 votes
0 answers
40 views

How do I set a default ssh-agent timeout under Gnome

I really really want cached passphrases for ssh to expire after a couple hours. This duplicates Configuring the default timeout for the SSH agent which had some good answers, but none of them work ...
kencorbin's user avatar
  • 101
2 votes
2 answers
4k views

systemd-journal-flush.service Failed with result timeout - Failed to start Flush Journal to Persistent Storage

I see this on my systemctl log, the systemd-journal-flush.service fails to start with a timeout error. Server is apparently running fine though. OS is CentOS 8. Logs don't tell much about the error. ...
ariel's user avatar
  • 123
0 votes
1 answer
193 views

Ncat very slow over UDP. Possible causes?

I've got three servers, "a", "b" and "c", all in same /24 subnet mask. On all of the servers, to any of the two other servers, nc to TCP port 9999 consistently takes 0.01 ...
RonJohn's user avatar
  • 1,015
0 votes
0 answers
15 views

sudo: timed out reading password [duplicate]

Today I've run into a strange monologue of sudo: [sudo] password for me: sudo: timed out reading password sudo: a password is required [sudo] password for me: sudo: timed out reading password sudo: ...
user619271's user avatar
-1 votes
1 answer
290 views

How to prevent timeout command to kill?

My process a.out is starting by a timeout command similar to: timeout 1 ./a.out - < file.txt It runs on a server and I have no control over that because it is part of a shell script that being ...
user174174's user avatar
1 vote
1 answer
2k views

TCP Timeouts in Nginx

I am running about sixty webservers on a Proxmox Cluster (uses KVM). The VMs are running the most recent version of Debian 11. They use nginx, different versions of PHP-FPM and MariaDB. I follow a ...
Stefan Schumacher's user avatar
4 votes
2 answers
1k views

How to shutdown pc if no user is logged in?

I am sorry if I have missed any existing answers or solutions - my searching did not bring up any viable solutions yet. The issue: My pc contains Windows and Linux, with Linux being the primary OS. ...
Betaminos's user avatar
  • 149
0 votes
1 answer
558 views

scp hanging sometimes

I have an issue with data transmission from one server to another. An example of the issue is doing scp to copy a file between the servers. 1 time out of 10 it just hangs, and eventually times out, ...
CJ7's user avatar
  • 829
0 votes
0 answers
551 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 ...
Trung Nguyen's user avatar
2 votes
1 answer
962 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@...
nidooooz's user avatar
1 vote
0 answers
129 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 ...
Julien's user avatar
  • 111
0 votes
0 answers
917 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 ...
Steven Yang's user avatar
1 vote
1 answer
2k views

bash script, check port response with bash's built-in /dev/tcp, time delay | hangs | speed up

With this scripts i check if a host is response on a given port with the bash's built-in /dev/tcp. I can use ip address or domains(hostnames). Script 1 #!/bin/bash HOST_NAME="127.1" ...
Z0OM's user avatar
  • 3,148
0 votes
1 answer
943 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 ...
Александр Лисов's 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 ...
Ole Tange's user avatar
  • 33.8k
1 vote
0 answers
193 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 ...
Phil Rafferty's user avatar
0 votes
1 answer
207 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 ...
suaib islam's user avatar
0 votes
1 answer
60 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 ...
ddulaney's user avatar
  • 165
0 votes
1 answer
728 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: ...
Martin Raszyk's user avatar
0 votes
1 answer
501 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 ...
xMrViktorx's user avatar
1 vote
3 answers
903 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/...
Boris L's user avatar
  • 11
0 votes
1 answer
796 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 ...
Kai's user avatar
  • 3
0 votes
1 answer
120 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-...
Game Stakes's user avatar
1 vote
1 answer
2k 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.: ...
su_li's user avatar
  • 31
0 votes
1 answer
287 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/...
Ashar's user avatar
  • 459
0 votes
1 answer
553 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 -...
flawr's user avatar
  • 115
-1 votes
1 answer
618 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 ...
Ftyn's user avatar
  • 1
0 votes
1 answer
156 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 ...
user782400's 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 ...
Sajad's user avatar
  • 101
0 votes
0 answers
173 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 ...
Y.op's user avatar
  • 1
0 votes
1 answer
286 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 ) ...
Navaneeth Cs's user avatar
0 votes
0 answers
297 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 .. ...
Sana.91's user avatar
  • 101
3 votes
2 answers
859 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 ...
Alex Williams's user avatar
0 votes
0 answers
278 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 ...
Grayson Pike's user avatar
3 votes
1 answer
1k 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 ...
confetti's user avatar
  • 1,892
1 vote
1 answer
380 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 ...
volingas's user avatar
  • 183
1 vote
0 answers
628 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 ...
Abitbol's user avatar
  • 230
0 votes
1 answer
825 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 ...
Maxime B.'s user avatar
  • 143
5 votes
3 answers
988 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 ...
BlueRoyale's user avatar
2 votes
1 answer
9k 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 <<>&...
Jane's user avatar
  • 21
1 vote
3 answers
358 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 ...
Grzegorz's user avatar
  • 121

1
2 3 4 5