Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [sleep]

a command for delaying execution of a program for the given length of time. For low power mode, use *suspend* instead.

Filter by
Sorted by
Tagged with
1 vote
1 answer
12 views

How to figure out what process or event is waking up laptop from `xset dpms force off`

I have a laptop where I tried xscreensaver auto blanking screen after 1 minute of idle time and even though everything seems idle it doesn't blank the screen. So then I ran this command to blank the ...
user avatar
0 votes
2 answers
36 views

Bash script with while loop that waits for a file to be refreshed but kills if time threshold is exceeded

I am very basic with bash so apologies if this is obvious to solve and please let me know if more details are needed. The script below is part of a larger script to launch a python workflow and wait ...
user avatar
0 votes
1 answer
81 views

SIGSEGV address boundary error shortly after waking from sleep

After resuming from a hybrid-sleep, I can log in (swaylock) and initially it seems ok - pwd, journalctl -xe run as expected in the shell still open from when I put it to sleep. After a short while ...
user avatar
  • 1,588
0 votes
1 answer
53 views

What does the sleep command do when run in background?

When I run this command - sleep 10 the terminal waits for 10 seconds. So sleep is acting on the terminal. What happens when I do - sleep 10 &? In the first case it was acting on the terminal but ...
user avatar
  • 101
0 votes
1 answer
71 views

Random float sleep in bash script?

I need randomized pauses in my script between two numbers smaller than 1 second in my script. The following used to work: #! /bin/bash sleep $(python -c "import random;print random.uniform(.2,.8)&...
user avatar
  • 3
0 votes
0 answers
66 views

Alpine Linux becomes unreachable after a certain period of inactivity

I have installed Alpine Linux as OS for a mini server. I have correctly configured the server to be reached via ssh (openSSL) and my programs run on docker containers. I use a wired connection. The ...
user avatar
0 votes
1 answer
43 views

Variable sleep bash alias [duplicate]

So, I'm trying to create an alias which will run a command after sleeping x seconds. alias ls_sleep="sleep $1 && ls" The problem is, $1 is being passed as string and things like $(($...
user avatar
  • 101
0 votes
1 answer
105 views

Second display does not turn on after sleep

After my machine (Fedora 35) goes to sleep and wakes, my second monitor won't turn on again. I can reproduce the same problem by running xrandr --output HDMI-1-1 --off xrandr --output HDMI-1-1 --auto ...
user avatar
0 votes
1 answer
49 views

Does locking in gnome allow background tasks like uplaoding to keep running?

I am uploading things in the back and want to lock the screen, but am not sure if the lock function in gnome locks the screen while allowing that to continue. So far it seems that the computer is not ...
user avatar
  • 135
1 vote
1 answer
79 views

Using sleep command in ssh authorized_key to prevent user's actions

I'm setting up an Ubuntu server to receive ssh connections from clients so I will then be able to connect back to their machine (reverse SSH tunneling). I searched for a way to prohibit any action ...
user avatar
0 votes
0 answers
37 views

Deactivate Linux Sleep/freeze/hibernate state without systemctl

I have a system with a very specific Linux compilation that runs on ARM CPUs. It lacks almost all services (systemctl included) and generally-included software (apt-get, snap, etc.) and it is not ...
user avatar
0 votes
0 answers
9 views

What kernel settings or configuration do I need to look at for a kernel that will never refuse to suspend?

Sometimes my laptop refuses to suspend, and overheats in its bag. This has been an ongoing issue with some versions of Linux over the years. Usually the reason is nfs shares, other times Wi-Fi or ...
user avatar
  • 226
0 votes
0 answers
26 views

Why does sleep() call returns when attaching to the process with a debugger?

While debugging one C application I added a code like this: #include <unistd.h> // ... if( /* some condition violated */ ) { log(WARNING, "condition violated! run `lldb -p %d`\n", ...
user avatar
0 votes
0 answers
16 views

Closing the lid wakes laptop from sleep

Plugging the power cable in or removing it does the same. Expected behaviour would be that only opening the lid or pressing a key wakes it up. I disabled everything in /proc/acpi/wakeup, no change. ...
user avatar
0 votes
1 answer
163 views

GDM lock screen after resume

I saw a really old question a but like this one but with no answer and no activity in three years. I'm on arch linux with GDM and gnome and when I resume my laptop from suspend, the screen is on what ...
user avatar
  • 203
0 votes
0 answers
127 views

Manjaro with KDE takes a long time to wake up after sleeping

I've been a long time user of Cinnamon, which I always thought was super fast, but recently switched to KDE. My experience has been pretty good on all fronts, except that I’ve noticed my laptop takes ...
user avatar
  • 487
1 vote
1 answer
72 views

Killing `sleep` in a subshell

In bash, I'm observing that calling kill on a sleeping process won't kill it if I start out with a subshell. Can you help me understand why? function foo () { # Start a loop with `sleep` in the ...
user avatar
0 votes
1 answer
132 views

Dell laptop runs hot and loud on idle during suspend and cannot be woken up/resumed (Pop!_OS 21.04)

My Dell Inspiron 5405 (Ryzen 4500U CPU, integrated Radeon graphics) runs Pop OS 21.04 (kernel version 3.11). I have installed Powertop, auto-cpufreq, and kept my firmware and OS up to date. A random ...
user avatar
-1 votes
1 answer
127 views

what's the max number accepted by sleep? [closed]

I want to run some jobs after waiting some time: I can do: sleep 1000;foo-1;foo-2 What I expected is to wait couple of hours, sleep seems not the best solution. and I don't want to setup cron job.
user avatar
  • 371
0 votes
1 answer
244 views

Not able to login after suspend/sleep in Linux Mint 20.04 from XFCE DE

I think this is due to Deepin Desktop Environment, which I install just now, from ubuntudde-ppa. I tried this post:- https://askubuntu.com/questions/818919/xubuntu-16-04-how-do-i-make-it-lock-screen-...
user avatar
7 votes
1 answer
887 views

Why does sleep, when run in a shell script, ignore SIGINT?

When I run sleep manually, and then kill -INT it, sleep exits immediately. For example: $ /bin/sleep 60 & [1] 4002356 $ kill -INT 4002356 [1]+ Interrupt /bin/sleep 60 $ ps -C ...
user avatar
  • 1,226
1 vote
1 answer
238 views

systemd has a <sleep infinity > process. What is it?

I was looking through the process table and this process, /bin/sleep infinity, was there. It's started by /lib/systemd/systemd --user. If I kill the sleep, my current session is stopped and I get ...
user avatar
1 vote
0 answers
63 views

Capture sleep, hibernate and wakeup events on Linux

I need to capture these on both laptop and desktop environmetns. Explored 2 options, but unfortunately none of them worked as expected. DBus works on desktop but these events also need to be captured ...
user avatar
0 votes
0 answers
66 views

why SIGPIPE behaves different in different kernels?

I have two different systems running with linux and I'm getting some logs with tail -f logfile While tail was running, I sent SIGPIPE to tail's process. tail continued to run on system 1 but died ...
user avatar
1 vote
0 answers
151 views

Run scripts before and after sleep

I need to run some scripts before and after my system (Fedora 33) goes into sleep mode. So far I tried two different approaches and they both have failed. First was to place the commands and script ...
user avatar
  • 1,156
0 votes
1 answer
603 views

How to pipeline sleep? sleep pipeline doesn't work

I wanted to simulate execution time of certain scripts for which I found sleep NUMBER does exactly what I want. In my scenario I needed something like sleep 5 | command | sleep 5 ... But it behaved ...
user avatar
  • 152
0 votes
3 answers
310 views

Why is the command sleep an independent process but others seemingly not when used in a shell script?

I'm writing a bash script named test.sh as below on my Ubuntu: #!/bin/bash while true; do echo 'abc' # pwd, df... sleep 1 done When I execute ./test.sh at one terminal, I open another ...
user avatar
  • 2,819
1 vote
1 answer
274 views

How Do I Set My Fedora KDE 33 Workstation To NOT Suspend Upon Lid Close?

My Fedora KDE 33 Workstation (Old Sony Vaio Book) suspends when I close it. I would like to listen to music with the lid closed, so how should I do this?
user avatar
1 vote
2 answers
362 views

How to kill a command run from a script after a period? [duplicate]

I would like to run a never-ending command (such as play a mp3 file in loop) for a period of length T. I put the command in a shell script my.sh: #! /bin/bash vlc /path/to/my.mp3 # will play the file ...
user avatar
  • 89.9k
0 votes
0 answers
52 views

My screen gets "pixelated" after waking up from the sleep. (Zorion OS)

After waking up from sleep, my laptop's screen and all the apps that were running on it before going to sleep have distorted pixels.
user avatar
  • 131
1 vote
0 answers
62 views

Keeping Linux Mint 19.1 Mate from putting the display to sleep

I am running Linux Mint 19.1 Mate on a computer running kiosk software. For the love of all things I cannot get it to stop putting the display to sleep. I have set Control Center Power Management ...
user avatar
1 vote
2 answers
588 views

sleep command delay grossly inaccurate (VM)

I need to use sleep in a shell script, so I tried it out in a terminal, but the delays it produces are inconsistent and very inaccurate. For example sleep 3 produces a delay close to 20 seconds. These ...
user avatar
0 votes
1 answer
711 views

Pop! OS wakes up from suspend with a black screen

Release: 20.04, Gnome. Without grub. On a Lenovo IdeaPad Flex 5 (2020) 2-in-1. I found this thread advising to edit the grub file, but this distro doesn't have grub. Is there a similar file I could ...
user avatar
1 vote
3 answers
625 views

Verbose sleep command that displays pending time seconds/minutes?

sleep command can be used to introduce a delay. e.g. sleep 5 will sleep for 5 seconds. Is there any alternative/way/method that will display the pending seconds on the terminal? output like resuming ...
user avatar
  • 24.2k
0 votes
1 answer
156 views

Disabled ipv6, but the setting doesn't persist after sleep

I added these lines to a .conf file in the directory /etc/sysctl.d net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1 I then do sudo systemctl ...
user avatar
  • 2,085
0 votes
1 answer
18 views

cron starts ev. min script, that sleeps some times for 1200s

I wrote a script, that sleeps some times for 1200s. That script must be executed through cron every minute. If my script pauses 1200s, will cron still start a new process? If so, how can I set this to ...
user avatar
  • 1
0 votes
1 answer
2k views

Press ENTER to continue

I want to know if there is any way to make my script stop until the user hits the Enter key, but without using the command read, just by the options of stty. I was wondering a code for this and got ...
user avatar
1 vote
1 answer
183 views

Errors running "nordvpn connect" on Wake from Suspend

I'm running Pop!_OS, a Ubuntu based OS, and I want to run nordvpn disconnect before suspend and nordvpn connect after suspend. I'm using code from this arch linux wiki and can't get the nordvpn ...
user avatar
1 vote
0 answers
350 views

Fedora/ Gnome: Disable sleep when undocking

Ask: I am looking for a way to stop my Fedora 32 notebook from going to sleep when I remove the external monitor (lid is always closed, it is always plugged in) Use case: I have a WFH setup where I ...
user avatar
1 vote
1 answer
72 views

Can't exec mplayer as a background process

If I give a command like: $ mplayer ~/sounds/mysound.wav then it works and plays a sound. If I sleep before playing the sound, then it also works: $ sleep 5s && mplayer ~/sounds/mysound.wav ...
user avatar
  • 5,331
14 votes
2 answers
2k views

bash script: fixed sleep time is adding up in while loop

I am new to bash scripting and started out with a few sample scripts. One is: #!/bin/bash SECONDS=5 i=1 while true do echo "`date`: Loop $i" i=$(( $i+1 )) sleep $SECONDS ...
user avatar
  • 383
0 votes
1 answer
78 views

How to measure total cumulative time spent in sleep()?

I am analyzing a tool written in bash and python. The call from the top traverses through many layers of bash and python programs. The time to completion is in the order of hours (4-5 hours). In these ...
user avatar
  • 295
1 vote
0 answers
480 views

Kubuntu 20.04 randomly will not turn screen on when resuming from sleep

lspci -k output: https://pastebin.com/AhGX7SKd Computer Type: Laptop: Lenovo E585 GPU: Vega 10 CPU: Ryzen 7 2700U RAM: 8gb Operating System & Version: Kubuntu 20.04, manjaro 20.0, xubuntu ...
user avatar
  • 111
1 vote
0 answers
418 views

ps command output, WCHAN column '-' for all processes

ps axo ppid,pid,stat,wchan,cmd outputs - for the WCHAN column for all processes, including the ones in sleep, on Debian bullseye, did I do something wrong? BTW, wchan shows 'the kernel function in ...
user avatar
  • 467
1 vote
1 answer
64 views

pause a program (bash script) to a certain time

I want to pause a certain bash script for 30 minutes. Right now I use sleep 1800 but that doesn't take into account time the laptop might be in suspend (sleep) state. Is there way to achieve this? If,...
user avatar
  • 125
-1 votes
2 answers
647 views

why ps not see sleep process?

I creart the first terminal , then I use "sleep 1000 &" and I found it by "ps". The problem is when I creat the second terminal and put "ps" ,there is no sleep process. I want to know why ? (my ...
user avatar
  • 15
1 vote
1 answer
53 views

How to get sleep time of a program

I am trying to collect some statistics for a script that I run on a daily bases. I would like to get the amount of time that is actually spent sleeping. Is there a way to just get the sum of all sleep ...
user avatar
  • 11
0 votes
2 answers
806 views

poll for the right output of a command

completely new to bash so any assistance is much appreciated. I'm looking for a script to do the following, its a pretty simple script but I cant seem to get it: I want to run a command, this command ...
user avatar
  • 15
0 votes
1 answer
491 views

Kubuntu 19.10 black screen after wake up

I just got a new Laptop at work and installed a clean Kubuntu 19.10 on it. There is this problem: everytime I close the lid and reopen in or put it in sleep mode manually and attempt to wake it up, ...
user avatar
2 votes
0 answers
2k views

How to disable systemd-logind from watching hardware keys?

This laptop is acting as a server, so these are not only completely irrelevant and unnecessary, but also a serious PITA because the server was suspending when I closed the lid. I've set them to "...
user avatar
  • 1,464