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

What happened to a sleep command after server shutdown?

I would like to execute a script after 5 hours. My script is $cat << EOF > run.sh sleep 18000 sh run_my_script.sh EOF I submitted the job as: sh run.sh >& log & But due to some ...
  • 101
0 votes
0 answers
7 views

Xubuntu not resuming from sleep mode

I have recently made the switch from Windows 7 to Xubuntu. Things have been going relatively well. Though my main problem with the install of the new OS is how it behaves when my laptop is left idle ...
2 votes
1 answer
23 views

How to run X programs automatically after wakeup from S3 sleep (suspend) or S4 sleep (hibernation)?

The existing question how to run a user script after systemd wakeup? already has answers that allow running scripts after wakeup from sleep. However, the solutions provided to that question require ...
0 votes
0 answers
23 views

Prevent HD from sleeping in USB external enclosure

I have seen this asked several times. However none of the solutions proposed have worked for me. I am running Ubuntu Server 22.04 with a Mediasonic HF2-SU3S2 ProBox filled with 4 x 2TB drives. ...
0 votes
1 answer
41 views

In my dualboot, KDE Neon(Ubuntu based) does not wake up after sleep/supend/closing lid manually, it needs to be started again manually 9/10 times

I think the title covers it all. I have KDE Neon dualboot with Windows 10. 9 out of 10 times, if it gets to sleep mode it does not wake up. I need to press the power button to power on the laptop ...
1 vote
1 answer
63 views

GPU seems to crash Arch upon wake up

Symptoms: On closing the lid the laptop sleeps successfully(evident by the fan dying). On wake up often (1 out of 10 times) everything just freezes. This happens when running X and ratpoison but also ...
  • 2,775
0 votes
2 answers
72 views

In linux, cannot kill sleep processes (trash.so or dolphin). what to do?

I cant kill any sleep process. I have tried most of the kill signals. I confront this problem often. What i must do in order to kill these processes? trap "kill -15 '-773623'" 0 1 2 3 15 It ...
0 votes
1 answer
52 views

sleep in Bash if/else sleep vs <condition> && sleep clamining cpu

I wrote a script to check on the battery and if it is below 5% notify the user. The script is put to sleep for 1 minute after every check. If I write the script in the following way, the cpu workload ...
  • 33
7 votes
5 answers
2k views

What is difference between sleep and NOP in depth?

I am trying to learn operating system concepts. Here is two simple python code: while True: pass and this one: from time import sleep while True: sleep(0.00000001) Question: Why when running ...
0 votes
2 answers
74 views

Logout of tty but save session for next login

5.18.9-arch1-1 Dell XPS 15 9510 I am running arch linux on xmonad. I do not have a login manager. On boot, I simply login via the tty and run startx to start my x session. This behavior is exactly ...
  • 123
0 votes
0 answers
6 views

separate sleep button on Dell model Vostro 14 3000 system 3490

Why is there no separate sleep button on Dell model Vostro 14 3000 system 3490? The Function Fn button + Insert button = sleep mode worked for me. Is there any other way?
0 votes
1 answer
965 views

Linux cli: disable sleep when laptop lid closed

I have no systemd on my debian based distro (antix) and I also have no desktop environment. How can i make my laptop to only blank (or disable) screen when lid is closed, instead of suspending as well ...
1 vote
0 answers
81 views

Multiple Scripts all in one with breaks [closed]

I’m writing a script where instead of using ‘sleep 600’ (for example), i actually want to execute another script for the same amount of time as sleep. So basically, instead of “doing nothing” for 10 ...
1 vote
1 answer
94 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 ...
0 votes
2 answers
207 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 ...
0 votes
1 answer
152 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 ...
  • 1,638
0 votes
1 answer
367 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 ...
  • 101
0 votes
1 answer
260 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)&...
  • 3
0 votes
0 answers
139 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 ...
0 votes
1 answer
113 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 $(($...
  • 101
0 votes
1 answer
447 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 ...
0 votes
1 answer
186 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 ...
  • 135
1 vote
1 answer
121 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 ...
0 votes
0 answers
91 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 ...
0 votes
0 answers
14 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 ...
  • 256
0 votes
0 answers
30 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", ...
0 votes
0 answers
33 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. ...
0 votes
1 answer
238 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 ...
  • 203
0 votes
1 answer
205 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 ...
  • 487
1 vote
1 answer
181 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 ...
1 vote
1 answer
273 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 ...
-1 votes
1 answer
337 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.
  • 363
0 votes
1 answer
352 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-...
8 votes
1 answer
1k 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 ...
  • 1,306
1 vote
1 answer
350 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 ...
1 vote
0 answers
88 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 ...
0 votes
0 answers
101 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 ...
1 vote
0 answers
280 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 ...
  • 1,198
0 votes
1 answer
876 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 ...
  • 152
0 votes
3 answers
532 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 ...
  • 2,891
1 vote
1 answer
405 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?
1 vote
2 answers
644 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 ...
  • 92.7k
0 votes
0 answers
89 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.
  • 131
1 vote
0 answers
63 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 ...
1 vote
2 answers
710 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 ...
0 votes
1 answer
777 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 ...
1 vote
3 answers
889 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 ...
  • 25.2k
0 votes
1 answer
180 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 ...
  • 2,135
0 votes
1 answer
29 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 ...
  • 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 ...