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
1answer
52 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
0answers
19 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
0answers
32 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
0answers
17 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 ...
0
votes
0answers
15 views

What is the maximum idle cpu wakeup time tolerated by socket clients?

1 Summary An application process main thread is running an endless loop waiting for client requests over socket and sleeping in between. (This is comparable to an idle cpu waiting for a wake-up irq.) ...
0
votes
0answers
11 views

Disabling standby in full screen for all apps

Ubuntu 18.04.5 LTS I would like Ubuntu to consider full screen als anactivity so it doesn't go in standby/sleep. It should not matter what's running, if it's full screen = no standby/sleep. Examples: ...
0
votes
1answer
72 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 ...
0
votes
3answers
70 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 ...
1
vote
1answer
58 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?
2
votes
2answers
98 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 ...
0
votes
0answers
17 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.
0
votes
0answers
17 views

Suspend & Disabling a Device at Boot

System & OS: Ubuntu 20.10, Supermicro X11SPA-TF (see inxi dump below) Problem description: Suspend to RAM does not work. The screen is blanked, but nothing else happens (the system doesn't power ...
1
vote
0answers
33 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 ...
0
votes
0answers
11 views

automatic suspend not working when spotify is running

my dell e6410 running linux ulyana mate does not suspend automatically when spotify is running. i can make it do automatic suspend by running the "systemctl unmask" but have to do it ...
1
vote
2answers
178 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
0answers
152 views

Wifi not working after waking up from sleep mode Pop OS!

I installed Pop OS! recently, and every time I use my laptop after putting it in sleep mode, the WiFi does not work and it shows up as "No Wifi Adapter Found". I tried to search and solve ...
0
votes
1answer
382 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 ...
0
votes
2answers
162 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 ...
0
votes
1answer
59 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 ...
0
votes
1answer
12 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 ...
0
votes
1answer
560 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 ...
1
vote
1answer
114 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 ...
1
vote
0answers
205 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 ...
1
vote
1answer
32 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 ...
13
votes
2answers
993 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 ...
0
votes
1answer
48 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 ...
1
vote
0answers
365 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 ...
1
vote
0answers
276 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 ...
1
vote
1answer
41 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,...
-1
votes
2answers
230 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 ...
1
vote
1answer
26 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 ...
0
votes
2answers
313 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 ...
0
votes
1answer
300 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, ...
2
votes
0answers
1k 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 "...
0
votes
1answer
92 views

Run a simple script during sleep/suspend

How can I have a simple bash script run during sleep? The script is pinging a machine on the network every 5 seconds, and if it is online, it will wake the computer from sleep. Is this possible on ...
1
vote
2answers
2k views

Wifi issue after sleep

I am running Linux Mint 19 Tara. I cannot understand why but lately my wifi stop working after I resume it from sleep, the only way to make it work is either a reboot or sudo /etc/init.d/network-...
1
vote
1answer
423 views

hrtimer_nanosleep explanation

I have searched the Internet and did not find any explanation for hrtimer_nanosleep. What is the usage of this function and how does it differ from the clock_nanosleep API? Can someone please explain ...
1
vote
1answer
119 views

Piped command hangs on killed sleeping child

I use a 'watchdog' function to perform a failsafe wakeup if a certain command hangs. This is implemented by running a background task that sleeps for 30s and then executes the wakeup. If the parent ...
1
vote
2answers
8k views

create a systemd startup script that delays 30 minutes

I tried to create a systemd startup script that starts an rkhunter scan 30 minutes after system start of my laptop, like this: [Unit] Description=starts rkhunter and displays any findings with zenity ...
1
vote
2answers
1k views

sleep system call on Linux - interaction with signals

I have a question about the documentation of sleep, on Linux OS. man 3 sleep says: regarding thread safety, sleep() is "MT-Unsafe sig:SIGCHLD/linux", which means that on Linux sleep() may ...
3
votes
1answer
145 views

Is 'sleep' based on the system clock or on time elapsed?

Is 'sleep' based on the system clock or on time elapsed? For example, if you execute: sleep 1200 And immediately suspend your system for 10 minutes, will it end in another 10 minutes, or will it ...
0
votes
0answers
316 views

Can a signal in one thread, interrupt sleep period of another thread of the same process in linux

There are two threads (parent thread and child thread, both runs in their own infinite loop) in a process. The parent thread does only one work, i.e. to continuously (while(1)) check the system time ...
0
votes
1answer
1k views

Not able to hibernate or suspend centos system

I am running Centos 7 and all I want to do is make my computer go to sleep immediately. There is a setting I have set to make my computer go to sleep but only after a certain amount of inactivity but ...
0
votes
2answers
94 views

bash remove members Slack from channels using xargs and sleep?

I'd like to be able to remove a batch of people from a "private" Slack channel. Use case: whoops, I just added 137 people to the wrong channel! The Slack Member ID list is obtained from an Airtable ...
3
votes
0answers
443 views

Suspend delayed after lid close

For some reason, when I close my laptop lid, it takes my system 25 seconds to sleep. This is without any autolock prorams (xss-lock, xautolock, etc.) running. In my journalctl I can see exactly a 25 ...
1
vote
1answer
949 views

Can't suspend Debian machine: wakes up immediately after sleep (“PM: Device usb1 failed to suspend async”)

Since I installed the latest Debian updates yesterday (udev, systemd, ...) I can't put my Debian 9/KDE machine to sleep. It wakes up immediately after suspending (systemctl suspend). /var/log/syslog ...
4
votes
3answers
1k views

Terminate BASH For loop, that contains long sleep and other stuff, using any specific key

I have a bash script that has a for loop that iterates a lot of times and sleeps between iterations, potentially for a long time. It then writes results to a file, then terminates. On occasion I ...
3
votes
2answers
1k views

How to quit command prompt after a sleeping command executes?

I have a simple script: f=1 # initial value loop(){ ... if [[ $f -eq 1 ]] then echo $msg1 f=2 (sleep $interval; loop) & exit 1 elif [[ $f -eq 2 ]] ...
1
vote
2answers
138 views

Sleep certain sections of the script

I want to pause/sleep the elif part but keep the other elif parts working . I don't want the whole script to sleep if 1 sensor goes off. #!/bin/sh while true; do valid="" scan=`./script` ...
0
votes
0answers
71 views

How to determine if guest OS is suspended when running as virtual machine

Running CentOS 7 and in need to do some network related commands when suspended and resumed by the VMWare. Thus far all the solutions I have seen, is connected to pm-utils. But nothing appears to ...