How to see which processes are stopping a mac from sleeping
Benj Edwards is an Associate Editor for How-To Geek. For over 15 years, he has written about technology and tech history for sites such as The Atlantic, Fast Company, PCMag, PCWorld, Macworld, Ars Technica, and Wired. In 2005, he created Vintage Computing and Gaming, a blog devoted to tech history. He also created The Culture of Tech podcast and regularly contributes to the Retronauts retrogaming podcast. Read more.
Trying to get a Mac to automatically sleep after a certain period of time can be frustrating. Several things can interrupt the process, including network activity and stubborn apps. Luckily, you can use a handy tab in Activity Monitor to quickly diagnose what might be preventing your Mac from sleeping. Here’s how.
First, let’s open “Activity Monitor.” You can locate the app in your Applications > Utilities folder, or you can use “Spotlight.” Click the “magnifying glass” icon in your menu bar, or press Command+Space. When a search bar pops up, type “activity monitor” and hit “Return.”
When Activity Monitor opens, click the “Energy” tab.
In the “Energy” tab, you will see a list of active processes (apps and background system functions) with information on their energy impact. Look for a column header labeled “Preventing Sleep,” and click it.
If you see a “Yes” listed in the “Preventing Sleep” column, then your Mac will not automatically engage sleep mode while that process is still active. If it’s a process you recognize, you can wait for an active task to finish, or try to “Quit” the app. If it’s a process that is not behaving as you expect or is refusing to close, you can force it to quit.
To force a process to close in Activity Monitor (on any tab), select the process in the list and click the “Stop” button, which looks like a small octagon with an “X” inside.
When Activity Monitor asks you to confirm, click “Force Quit.” After that, if that process was the only thing holding up your Mac’s sleep mode from engaging, then your Mac should go to sleep the next time you expect it to.
If Your Mac Still Won’t Sleep
If you didn’t find an app preventing sleep listed in Activity Monitor, you can dig deeper into the problem using a command line tool called pmset. However, that tool requires much deeper Mac troubleshooting experience to figure out the cause of the sleep problem.
Whatever happens, don’t stay up all night trying to figure it out—remember to get some sleep yourself. If you’re having trouble, try a glass of warm milk. Good luck!
My Mac is set to go to sleep after 5 mins of inactivity, and typically this works fine. But every week or so I find that my Mac no longer goes to sleep and nothing I have tried stops this behavior.
So far I have tried:
- resetting the SMC and NVRAM a number of times
- starting up in Safe Mode
- checking that my Energy Saver settings have not changed (Sleep is still set at 5 mins and I have not opted to prevent the Mac from sleeping when the display is off)
- quitting all running apps and using Force Quit to relaunch the Finder
- updating all my programs to the latest versions
- updating macOS to the latest version (currently macOS Mojave 10.14.5)
I have never installed anything to prevent sleep.
The only course of action that works is a full restart, which is highly inconvenient.
How do I work out what program is stopping my Mac from sleeping?
1 Answer 1
You’ve done a pretty good job so far of troubleshooting this yourself and there are many things that prevent sleep out of the box and by design.
What I would do next is exactly what you’re asking about – a targeted check to see if an application is what’s stopping your Mac from going to sleep.
To do this, follow these steps:
- The next time your Mac isn’t going to sleep, open Activity Monitor
- Click on the Energy tab
- Now you’ll see a list of applications with a number of columns, one of which should be headed “Preventing Sleep”
- Now check to see if any applications have a “Yes” listed in this column
IMPORTANT: If an application has an expansion triangle to the left of its name, make sure you expand it to confirm whether anything is preventing your Mac from going to sleep. For example, web browsers such as Safari often have multiple windows/tabs open and one of these could be preventing your Mac from going to sleep. However, this will not be obvious unless you click on the expansion triangle.
- If so, you can force them to Quit by selecting them and pressing option command Q
- Now wait to see if your Mac will go to sleep
Notes:
- If you don’t see a “Preventing Sleep” column at Step 3, then go to View > Columns > Preventing Sleep to display it.
- If no applications are listed as preventing sleep, then let me know via the comment box below and we’ll proceed with other steps.
For people that like command line options – there is an assertions log that shows what is going on – things that make the Mac think you are active, things that will block sleep, etc.
This is the same information that the activity monitor shows, just more detail and you can see items come and go by letting the log run:
One nice thing about command line is you can ignore everything that doesn’t have “sleep” in it:
Have you ever been annoyed to find that your Mac won’t go to sleep when you tell it to? Reader wjv found that, in Mac OS X 10.6 and later, there’s a simple way of finding out what’s keeping your Mac awake. To do so, run the following command in your Terminal: pmset -g assertions .
In the first section of output, you’ll see the status of two kernel assertions (essentially, assumptions the system makes about the state of your system) named PreventSystemSleep and PreventUserIdleSystemSleep . An accompanying status of 1 for either of these means that it is currently triggered. For example, here’s what I see when I run that command on my Mac mini:
Below that, you’ll see something like this:
This second section lists the processes which own any enabled assertions, by process ID and bundle ID (the text in parentheses after that). For example, above, two processes are preventing sleep: iTunes (because I’m currently listening to music) and coreoudiod (probably because it’s processing iTunes’ music).
If the bundle ID doesn’t ring a bell, you can enter ps up followed by the process ID at the Terminal command line, or look in Activity Monitor, to find the name of the command associated with that process. If you identify an app (such as iTunes in the example above), you can terminate it and put your Mac to sleep. If the process is something other than an app that you meant to run, terminating it may make your system unstable, which could cause it to crash—which would be a bit like sleeping, but not as nice.
If your Mac is stood idle for a significant period of time, then you’ll usually want it to drift off to sleep.
Not only does sleeping help preserve your Mac’s battery life, but it’s also an important security feature that can help keep the contents of your Mac safe from prying eyes.
Assuming that you’ve password-protected your Mac (and you really should!) once your Mac has been asleep for a significant period of time, it’ll go into lockdown and you’ll need to enter a password before you can continue using it. This is a handy security feature if you’re in the bad habit of wandering off and leaving your Mac running, at which point anyone in the area could potentially access your Mac and its contents.
Hopefully, the worst that’ll happen is your colleague or housemate plays a practical joke on you, but even discovering that someone has been posting strange things to your Facebook in your absence is annoying!
Sleep is a useful feature, but sometimes your Mac may simply refuse to go to sleep, no matter how long it’s been stood without user input. If you return to your Mac after a break only to discover that it’s been sat there, awake, the entire time, then you’ll want to find out exactly what’s causing your Mac’s insomnia.
Check your Energy Saver Settings
Let’s start by ruling out the obvious: double-check that your Mac actually is configured to go to sleep after it’s been stood inactive for a period of time.
- Click the ‘Apple’ logo in your Mac’s toolbar.
- Select ‘System preferences….’
- Select the ‘Energy saver’ pane.
The ‘Turn display off…’ slider shows how long your Mac needs to be left without user input before it drifts off to sleep. Check the slider in the ‘Battery’ and ‘Power Adapter’ tabs, and make sure they’re both set to a reasonable amount of time.
If either of these sliders are set to ‘Never,’ then you’ve found the reason why your Mac never seems to sleep!
Investigating with Activity Monitor
Some apps and processes can keep your Mac awake indefinitely, so you should take a closer look at exactly what’s running on your Mac.
Open your Mac’s built-in Activity Monitor by opening a new ‘Finder’ window and navigating to ‘Applications > Utilities > Activity Monitor.’
Open the ‘Energy’ tab and you’ll see a ‘Preventing sleep’ column. Any processes that are marked with a ‘Yes’ have the potential to prevent your Mac from going to sleep, so you should close the related app and then see whether this has solved your problem.
Investigating with the Terminal
If you can’t spot any obvious culprits in the Activity Monitor, then it’s time to dig a little deeper.
The macOS system supports a feature called power assertions, which programs can invoke if they need to prevent the system from going to sleep.
You can check whether any of these sleep assertions are currently active, by launching your Mac’s Terminal. Open the Terminal by navigating to ‘Applications > Utilities > Terminal’ and then issue the following command:
pmset -g assertions
This command returns quite a bit of information.
The first section is a list of all the different categories of assertions. A 0 next to a category means it isn’t active, but a 1 means that this assertion is currently active.
Below this list, you’ll find information about the specific processes that are invoking any active assertions, although this information does take a bit of deciphering.
Here’s a snippet of my Terminal output:
Listed by owning process:
pid 182(coreaudiod): [0x0000022a00018162] 00:00:08 PreventUserIdleSystemSleep named: “com.apple.audio.AppleHDAEngineOutput:1B,0,1,1:0.context.preventuseridlesleep”
Firstly, ‘pid’ stands for Process ID, and the number immediately after it is the actual process ID.
You can use this number to identify the process in your Mac’s Activity Monitor, so launch the Activity Monitor and then open either the CPU, Memory, Disk or Network tabs. All of these tabs contain a PID column, so work your way down the list, looking for the same process ID you identified in the Terminal.
Some processes will only appear in certain tabs, so you may need to work your way through several Activity Monitor tabs before you find the process you’re looking for.
Once you’ve located the process, you’ll see its related application in the Activity Monitor’s left-hand column. Simply closing this application may solve your problem and allow your Mac to drift off to sleep again, but sometimes you may need to force-quit the process itself.
You can close any process by selecting it in Activity Monitor and then clicking the ‘Force a process to quit’ icon in the upper-left corner. However, closing the wrong process (particularly system processes) can cause your apps to start misbehaving, and may even cause problems with the wider system, so you should never close a process without knowing exactly what work this process is responsible for.
If in doubt, then take some time to research the process online, and if you’re still unsure then play it safe and leave the process well alone!
Before you go
After spending over 20 years working with Macs, both old and new, theres a tool I think would be useful to every Mac owner who is experiencing performance issues.
CleanMyMac is highest rated all-round cleaning app for the Mac, it can quickly diagnose and solve a whole plethora of common (but sometimes tedious to fix) issues at the click of a button. It also just happens to resolve many of the issues covered in the speed up section of this site, so Download CleanMyMac to get your Mac back up to speed today.
Does your Mac go to sleep when you are downloading a file or backing it up? Do you want to keep your Mac from sleeping? Okay, there are three easy ways to do so. The first one is using the energy-saver feature, second is to use the terminal, and the third is using a third-party app. All of these methods are straightforward. So, let us dig right in and see how to stop your Mac from sleeping.
Prevent Your Mac from Sleeping Using Energy Saver
- Click on the Apple logo from top-right → Click on System Preferences.
- Click on Energy Saver.
Note: If you are on a MacBook, you will see two tabs here: Battery and Power Adapter. You can follow steps 3 and 4 below for both Battery power and while your MacBook is charging.
- Drag the Turn display off after slider to Never → Select Ok from the popup.
- Next, tick the box for Prevent computer from sleeping automatically when the display is off.
Now, your Mac will not go to sleep. If you wish to turn off this feature, follow the above steps, and drag the slider to the left and set the time according to your preference. Now, you Mac will sleep after the set period of inactivity.
RELATED: How to Keep MacBook from Sleeping With Lid Closed
Prevent Mac From Sleeping Using Terminal App
- Go to Applications folder → Utilities → and open Terminal.Or press Command (⌘) + Space Bar to open Spotlight Search and type Terminal.
- Type one of the following Terminal commands according to your preference and hit the enter
- caffeinate -d To prevent the display from sleeping
- caffeinate -i To prevent the system from idle sleeping
- caffeinate -m To prevent the disk from going idle
- caffeinate -s Keep the Mac awake while it is plugged into AC power
- caffeinate Now, your Mac will stay awake for as long as you leave the Terminal running. To stop this, use the keyboard shortcut Ctrl+C
- caffeinate -t 1800 & Here 1800 is the time in seconds. You can set it to anything. Now your Mac will stay awake for this time duration
The above commands run as long as you leave the Terminal app running.
Using Third-party Apps
- Download
- Open the app and click on Next. You can read and click Next on all subsequent screens to learn more about this app.
- Click on two half-circle icon (that looks like a pill) from the top menu bar.
- Click on Indefinitely. Now you Mac will never sleep.
- Now, Click on the Amphetamine app icon from the top menu bar and then click on End Current Session.
Other Apps That Prevent Your Mac From Sleeping
Amphetamine is potent (and popular). However, your choices are not limited. Some other great apps that keep your Mac from sleeping are:
Signing off…
These were the easy ways to keep your macOS device from sleeping. Now you can peacefully continue to download big files, backup the Mac, or prevent the screen from dimming when you are not watching a video in full screen. I hope this tutorial was helpful, and you learned something new.
You may also like to take a peek at:
Which method are you going to use? System Preferences, any App, or Terminal? Please share your thoughts with us in the comments down below.
This article explains the difference between Shut Down, Stop, Suspend and Pause actions.
Shut Down
Shutting down virtual machine in Parallels Desktop is just like shutting down Windows on a PC. All Windows applications close, giving you the opportunity to save your progress if necessary, and Windows stops running.
To shut down Windows, do one of the following:
Click the Parallels icon in the menu bar and choose Actions > Shut Down.
If the Parallels Desktop menu bar is visible at the top of the screen, choose Actions > Shut Down.
Stopping a virtual machine is similar to pulling the power plug out of a physical computer. To turn off the virtual machine, use the standard shutdown procedure of the guest operating system installed in it, or click the Shut Down button in the Parallels Desktop toolbar. If the guest operating system cannot be shut down for some reason or other, you can forcibly stop the virtual machine by doing one of the following:
- Clicking the Stop button in the Parallels Desktop toolbar, or
- Choosing Stop from the Actions menu.
Warning: If you forcibly stop the virtual machine, you may lose all unsaved data.
Suspend
Suspending a virtual machine is similar to putting a real computer into the sleep mode. When you suspend a virtual machine:
- Its current state (including the state of all applications and processes running in the virtual machine) is saved to a special file on your Mac (inside virtual machine’s bundle).
- Virtual machine’s process is stopped, therefore host RAM and CPU are freed from VM activity.
- When the suspended virtual machine is resumed, it continues operating at the same point the virtual machine was at the time of its suspending.
Suspending your virtual machine may prove efficient if you need to restart your Mac, but do not want to: quit the applications running in the virtual machine or spend much time on shutting the guest operating system down and then starting it again.
To suspend a virtual machine, do one of the following:
- Choose Suspend from the Actions menu or
- Click the Suspend button in the Parallels Desktop toolbar.
You can see the progress of saving the virtual machine’s state.
Warning: If you edit the configuration of a suspended virtual machine, you will not be able to resume this virtual machine.
Suspend limitations
Suspending virtual machines is not possible when:
- It’s a Boot Camp-based virtual machine and NTFS drivers are installed on Mac.
- Virtual machine has physical partitions/disks connected.
- Virtual machine is booted from external disk.
Pause
Pausing a virtual machine does the following:
- Virtual machine’s process is paused: virtual machine CPU activity is clear, but RAM is still used by the virtual machine’s process.
- The released CPU resources can then be used by the host OS and its applications or by other virtual machines running on the host computer.
- The resume process takes less time comparing to suspending, as the virtual machine’s process is already running and guest RAM is loaded.
To pause a virtual machine, do one of the following:
- Click the Pause button in the Parallels Desktop toolbar, or
- Choose Pause from the Actions menu.
To continue running the virtual machine, click the Resume in the Parallels Desktop toolbar or choose Resume from the Actions menu.
Parallels Desktop is designed to operate like an ordinary computer application. This means that you do not have to change the virtual machine’s state from running to paused, suspended, or stopped before putting your Mac to sleep. In sleep mode, your Mac does not allocate any resources to the running applications (including Parallels Desktop and all virtual machines) so that they are stopped automatically. As you start your Mac, all the applications are automatically up and running again.
Была ли эта статья полезной?
Как, по вашему мнению, можно улучшить эту статью?
You can keep your MacBook awake and even use an external monitor
:max_bytes(150000):strip_icc()/JeremyLaukkonen-1bb154ef56254c2896eae37b5f535144.jpg)
- Tweet
- Share
What to Know
- Navigate to System Preferences >Battery >Energy Saver >Power Adapter, and move the slider to Never.
- After adjusting the Energy Saver settings, connect your MacBook to a charger and an external monitor.
- The only way to keep a MacBook awake with the lid closed without connecting to a monitor is to use a third-party app.
This article explains how to prevent your MacBook from sleeping when the lid is closed.
Can You Stop a MacBook From Sleeping When You Close the Lid?
You can stop a MacBook from sleeping when you close the lid, and you can even use a MacBook that’s closed if you connect a monitor, keyboard, and mouse. If you like to use your MacBook with an external monitor, but you don’t have room on your desk for both the monitor and your MacBook, then closing it and storing it in a vertical stand while it’s in use is a great solution.
How Do I Keep My MacBook On When I Close the Lid?
Your MacBook is designed to sleep whenever you close the lid as the default setting. This feature saves power when the MacBook is plugged in and preserves battery life when it isn’t. The problem is if you want to close your MacBook and use it with an external monitor, you’ll run into a situation where it sleeps instead. If you’re going to keep using your MacBook with the lid closed, you’ll need to change a few settings.
Here’s how to keep your MacBook on when you close the lid:
You will also need to connect a keyboard to your MacBook and either a mouse or trackpad if you want to keep using it while it’s closed.
Click the Apple icon in the upper left corner.
Click System Preferences.
Click Battery.
Click Power Adapter.
Click the slider and move it to Never.
Click the Prevent computer from sleeping automatically when the display is off check box.
Plug your MacBook into power.
Connect your MacBook to an external monitor using an adapter if necessary.
You can now close your MacBook without the display turning off.
If you want to use your MacBook in this configuration permanently, you can use the Mac sleep scheduler to have it sleep and night and wake up in the morning automatically.
Why Does My MacBook Sleep When I Close the Lid?
Your MacBook sleeps when you close the lid for a couple of different reasons, depending on whether it’s plugged in or not at the time. When it’s plugged in, it sleeps to help conserve energy and also allow it to charge more quickly, as it uses much less power while asleep. When running on battery power, it sleeps when you close the lid to conserve battery power. Since you typically don’t need to use your MacBook when the lid is closed, the default setting is for the display to turn off and the MacBook to sleep whenever the lid is closed.
The most common reason to want to keep a MacBook from sleeping when the lid is closed is if you’re going to use it with an external monitor and keyboard. Apple makes that reasonably easy if you follow the instructions provided in the previous section.
Can You Keep a MacBook From Sleeping With the Lid Closed Without a Monitor?
Apple only provides you with one way to keep your MacBook from sleeping with the lid closed, and that’s to tweak the energy-saver settings, connect the battery charger, and plug in an external monitor.
If you want to keep your MacBook from sleeping without plugging in an external monitor, you need to install a third-party app. There is no option in the battery or energy saver settings that allows a MacBook to remain awake with the lid closed if an external monitor isn’t plugged in.
Select System Preferences > Battery or Energy Saver > Power Adapter > Turn display off after. Move the slider to Never and select Prevent computer from sleeping automatically when the display is off to keep your Mac from sleeping.
If you don’t want your MacBook to go into sleep mode after a certain amount of time on battery power, turn off this setting. Go to System Preferences > Battery or Energy Saver > Battery > Turn display off after > and move the toggle to the right to Never.
Ensure the setting for turning off the display is active. Go to System Preferences > Battery or Energy Saver > Turn display off after. From Power Adapter, disable Wake for network access if this setting is on. Also, check Bluetooth wake settings; go to System Preferences > Bluetooth > Advanced > and uncheck Allow Bluetooth devices to wake this computer.
You leave your laptop and, coming back, find it still brightly lit or at least on? Find out here how to investigate which applications, processes or browser tabs may be at fault and responsible for why a Mac is not sleeping.
First, Give Me Your Hand and Swim
If you are a sea otter, you lie back and drift in the lake to — sleep.
if you are a sea otter, you also spend most of your time alone — except during mating season, of course. Then, you tend to hold on to your neighbors, especially during sleep, and can be seen famously asleep holding hands drifting through the lake.
Now, this might raise suspicions why sea otters so far have been neglected as mascots for any version of OS X or macOS… when sometimes they, too, only sleep when you hold their hand. Let’s find out what keeps your Mac awake:
How to Find Out Why a Mac Is Not Sleeping
Using Activity Monitor
Time needed: 5 minutes.
To find out which application, process, thread, or Safari tab is preventing your Mac from sleeping:
Where: You can find Activity Monitor in the /Applications/Utilities folder, or under Other in Launchpad.
Tip: A quick way to launch Activity Monitor is through Spotlight, of course; press Command Space , start typing acti… , and select Activity Monitor.
Ensure the Preventing Sleep column shows.
Note: Select View | Columns | Preventing Sleep from the menu if you cannot see it.
Tip: Select View | Active Processes to see all (and only) processes that are currently active and most likely to prevent sleep.
Look for Yes in the Preventing Sleep column.
Note: Do expand applications with sub-processes (such as Safari) to see their preventing sleep.
Tip: Click the Preventing Sleep column header to put all the applications that keep your Mac from going into sleep mode on top.
With Safari, you can identify the very tab or window that is preventing sleep using Activity Monitor. With other browsers such as Firefox or Google Chrome, look for media playing if the application as a whole shows Yes for Preventing Sleep.
Find Out Why a Mac Is Not Sleeping Using the Terminal
You can also — and more precisely — find out what processes are stopping your Mac from entering sleep mode, and what prevent the display from turning off using the Terminal prompt:
- Open Terminal.
- Type pmset -g .
- Press Enter.
- Find the delays for entering sleep and turning off the display as well as which processes prevent either in the following lines:
– sleep: if any processes prevent sleep mode, they will appear as (sleep prevented by ___).
– displaysleep: Processes stopping the screen from turning off appear as (display sleep prevented by ___).
Note: You can still turn off the display manually, of course.
To see detailed information about the assertions:
- Type pmset -g assertions at the Terminal prompt.
- Press Enter.
Tip: You can also pull up an ongoing log of new sleeping blocks as they happen with pmset -g assertionslog .
How to Find Out Why a Mac Is Not Sleeping: FAQ
I see lots of “Safari Web Content (Cached)” processes taking up memory; can I quit them?
While it is not necessary to do so, you can safely close these processes:
- Highlight all processes you want to quit.
Note: Hold down Command to select multiple processes or Shift to select a range; click the Process Name column to sort by name.
Tip: Press Command Control F and type (Cached) to see only the cached Safari processes. - Select View | Quit Process from the menu.
- Select Quit (you do not need to force quit these processes).
Will the Chrome Task Manager help me identify which page is preventing sleep?
No, unfortunately it will not.
As it is typically tabs playing media, your best bet is Chrome’s media hub. To see which tabs play media:
- Click the media hub button next to the Chrome address bar.
- See the tabs and windows with media, paused or playing.
Do I have to use the Energy tab in Activity Monitor?
No, you can add the Preventing Sleep column to any Activity Monitor tab.
(How to find out why a Mac Is not sleeping tested with macOS Big Sur 11.0 and Catalina 10.15; updated February 2021)
Some MacBook Pro, MacBook Air, and MacBook users may have noticed their computers are draining battery even when the Mac is sleeping and not in use. This seems like a peculiar issue, but it turns out there there may be an explanation.
A simple way to diagnose this issue is by going to Apple menu > System Preferences > Battery, then choosing “Usage History”. When you see the battery level drop but the ‘Screen On Usage’ is nonexistent, you know the battery is draining when the Mac is not in use. The screenshot above demonstrates this in a severe case, where a MacBook Air drained the entire battery when not in use.
Fixing MacBook Pro / Air Battery Draining When Sleeping
Usually this happens because the Mac is not actually sleeping, the screen is just off, or the Mac is being woken up. Or, a feature called Power Nap is turned on the Mac laptop. Let’s look into this with a variety of troubleshooting tricks.
Find Apps/Processes Preventing Sleep
Some apps and command line tools specifically prevent sleep, so determining which and why is important. You can use the command line and pmset to figure this out, or Activity Monitor, which easier for most users.
- Open Activity Monitor from Spotlight by hitting Command+Spacebar then typing ‘Activity Monitor’ and hitting return
- Pull down the “View” menu and go to “Columns” and check the “Preventing Sleep” column on
Now you can sort by “Preventing Sleep” to see what, if any, processes or apps are preventing the Mac from sleeping
If you a specific application is preventing sleep, simply quitting the app usually resolves the problem.
For example, sometimes the OpenEmu emulator will prevent sleep on a Mac, so if that app is open and running you may not be able to actually put the Mac to sleep, as you see in the screenshot above.
Command line processes like caffeinate are designed to prevent sleep so if you see something like that running, that’s certainly the cause.
Disabling Power Nap
Some MacBook Pro and MacBook Air laptops support a feature called Power Nap, which allows the Mac to check email and get notifications while it should be asleep. Turning this off may resolve some battery draining while sleeping issues, particularly if you get a lot of emails and notifications.
- From Apple menu go to “System Preferences” and choose “Battery”
- In the Battery tab, uncheck the box for “Enable Power Nap when on battery”
Disabling Enhanced Notifications
Some Macs also use a feature called Enhanced Notifications to deliver notifications when the display is sleeping, you can turn those off which may ameliorate battery draining when the Mac should be sleeping as well.
Advanced: Finding out exactly why the Mac waking from sleep
If you’re more technically inclined and comfortable with the command line, you can follow this guide to see exactly why a Mac is waking from sleep. Often you’ll see things like AirPort (wi-fi) activity, lid opening, or keyboard/mouse activity shown, but because it’s using system logs to determine this it is not particularly in a user friendly format.
There are a few helpful commands to refer to that may lead you to discover the reason, process, or app that is causing the Mac to wake from sleep. You can refer to these as needed, and it may be helpful to run each command separately to investigate the Macbook battery draining issue.
Run these commands from the Terminal application.
Using log to discover wake requests on MacBook laptop:
log show | grep -i “Wake Request”
This may reveal something like the following, where ‘powerd’ is waking the Mac with an “RTC” request which is often an automated behavior, whether it’s waking on schedule or on network request:
2021-11-03 22:02:38.472928-0700 0x5cb1b Default 0x0 76 0 powerd: [powerd:wakeRequests] Selected RTC wake request:
Using pmset to find wake requests on Mac laptops:
pmset -g log |grep “Wake Request”
May return something like, where the ‘process’ is the reason for the wake request:
2021-11-30 13:33:36 -0800 Wake Requests [*process=SuperUpdaterPro request=Maintenance deltaSecs=7200 wakeAt=2021-11-30 15:33:36 info=”upkeep wake”] [process=powerd request=TCPKATurnOff deltaSecs=99481 wakeAt=2021-12-01 17:11:38]
Using log again to discover wake reasons for MacBook laptops
log show |grep -i “Wake reason”
May return something like, where ‘AppleTopCaseHIDEventDriver’ indicates the lid of the Mac laptop was opened:
2021-10-26 00:48:13.953155-0700 0x12174 Default 0x0 0 0 kernel: (AppleTopCaseHIDEventDriver) [HID] [ATC] [Error] AppleDeviceManagementHIDEventService::setWakeReason Error setting wake reason (reportID = 0xc5, Return Value = 0xe0005000)
Rebooting, resetting SMC, disconnecting peripherals and USB devices, and miscellania
Sometimes users can stop mysterious inability to sleep or power draining issues by simply rebooting the Mac.
Also, disconnecting peripherals like USB devices or other gadgets may resolve the issue.
Another common troubleshooting trick for mystery power issues is to reset the SMC on the Mac (this only applies to Intel Macs, as Apple Silicon does not have SMC), which can often resolve issues if a Mac won’t sleep.
It can also be generally useful to how long your MacBook battery actually lasts for, which you can check in Activity Monitor as well.
Have you experienced any issues with your MacBook Pro, MacBook Air, or MacBook draining battery while the computer is sleeping, or otherwise not in use? Did you find a solution? Did the tips mentioned here help? Share with us your own experiences in the comments.
Description
Attach local standard input, output, and error streams to a running container
Usage
Extended description
Use docker attach to attach your terminal’s standard input, output, and error (or any combination of the three) to a running container using the container’s ID or name. This allows you to view its ongoing output or to control it interactively, as though the commands were running directly in your terminal.
Note: The attach command will display the output of the ENTRYPOINT/CMD process. This can appear as if the attach command is hung when in fact the process may simply not be interacting with the terminal at that time.
You can attach to the same contained process multiple times simultaneously, from different sessions on the Docker host.
To stop a container, use CTRL-c . This key sequence sends SIGKILL to the container. If –sig-proxy is true (the default), CTRL-c sends a SIGINT to the container. If the container was run with -i and -t , you can detach from a container and leave it running using the CTRL-p CTRL-q key sequence.
Note: A process running as PID 1 inside a container is treated specially by Linux: it ignores any signal with the default action. So, the process will not terminate on SIGINT or SIGTERM unless it is coded to do so.
It is forbidden to redirect the standard input of a docker attach command while attaching to a tty-enabled container (i.e.: launched with -t ).
While a client is connected to container’s stdio using docker attach , Docker uses a
1MB memory buffer to maximize the throughput of the application. If this buffer is filled, the speed of the API connection will start to have an effect on the process output writing speed. This is similar to other applications like SSH. Because of this, it is not recommended to run performance critical applications that generate a lot of output in the foreground over a slow client connection. Instead, users should use the docker logs command to get access to the logs.
Override the detach sequence
If you want, you can configure an override the Docker key sequence for detach. This is useful if the Docker default sequence conflicts with key sequence you use for other applications. There are two ways to define your own detach key sequence, as a per-container override or as a configuration property on your entire configuration.
To override the sequence for an individual container, use the –detach-keys=” ” flag with the docker attach command. The format of the is either a letter [a-Z], or the ctrl- combined with any of the following:
- a-z (a single lowercase alpha character )
- @ (at sign)
- [ (left bracket)
- \\ (two backward slashes)
- _ (underscore)
- ^ (caret)
These a , ctrl-a , X , or ctrl-\\ values are all examples of valid key sequences. To configure a different configuration default key sequence for all containers, see Configuration file section.
For example uses of this command, refer to the examples section below.
Options
| Name, shorthand | Default | Description |
| –detach-keys | Override the key sequence for detaching a container | |
| –no-stdin | Do not attach STDIN | |
| –sig-proxy | true | Proxy all received signals to the process |
Examples
Attach to and detach from a running container
Get the exit code of the container’s command
And in this second example, you can see the exit code returned by the bash process is returned by the docker attach command to its caller too:
A few Mac users have recently been complaining that their MacBooks/Pros/Airs keep waking from sleep. The end result is that when they do want to use them again, perhaps the following morning, their batteries are partially discharged – more than they should had they remained asleep.
Sleep itself can be prevented by the following:
- Network activities which wake the Mac (see below).
- Processes which prevent sleep. You can discover those by opening Activity Monitor, switching to its Energy tab, and clicking once on the head of the list Preventing Sleep. Processes listed as Yes at the top will prevent your Mac from sleeping, and need to be quit for that to occur.
The following events and activities can wake a Mac which is already asleep:
- Network activities which wake the Mac, including various types of sharing. Check the Sharing pane doesn’t make that Mac a ‘server’ for any of these, and disable Wake on Demand (see below).
- Notifications (see below).
- Bluetooth activity, typically other Bluetooth devices trying to connect. To fix this, open the Bluetooth pane, click on the Advanced… button, and uncheck the last item, to Allow Bluetooth devices to wake this computer.
- Opening the lid of a recent laptop model or connecting it to mains power, which automatically wake it.
Apple explains in detail the Wake on Demand system which allows connecting clients to wake a sleeping Mac which is sharing to them, in this article, now sadly archived. In addition to ensuring that your Mac isn’t offering a sharing service which could wake it up, open the Energy Saver pane and uncheck the item Wake for network access.
The most common problems now are notifications, which seem to come from every man and his dog, many of which don’t appear entirely under your control. The better apps are listed in the Notifications pane, but when you view their settings, there’s no control to suppress or mute them during sleep.
The best way to ensure that your Mac doesn’t get woken up by notifications is using the Do Not Disturb (DND) settings at the top of the list at the left. Tick (enable) DND to be turned on:
- When the display is sleeping,
- When the screen is locked (10.15 only),
- When mirroring to TVs and projectors.
Ensure that the bottom two boxes are unchecked, or they will allow your Mac to wake for:
- calls from anyone,
- repeated calls.
Then all notifications should be suppressed when your Mac is asleep, except for those of Find My Mac, which you do still want to work.
If your Mac continues to wake when it should be asleep, then the only reliable way to establish what is happening is to browse your log, using Consolation 3 to identify the event which caused it to wake. If you don’t know exactly when that happened, that can get tedious.
Computers sleep as a way to save energy and prevent unnecessary wear on your machine’s hardware. Yet there are times you may want to stop your Mac from sleeping such as when you’re watching a movie, cloning a large repository from GitHub, or need to let a large download finish from your favorite website.
When in these situations, it can be inconvenient to look through System Preferences > Energy Saver until you find the settings needed and then you must remember to re-enable your original settings when you are done. With OS X 10.8, Mountain Lion, we are able to stop our Macs from sleeping for a period of time from our command line with the caffeinate command. Let’s take a look at how to use this command, and some alternatives for older machines.
Caffeinate and How to Use It
The caffeinate command is used to prevent a Mac from going to sleep. The simplest way to use this command is to run the following command in the terminal.
When run, the cursor will move down to a blank line where it will stay until you tell the command to stop running or close the terminal. While running, caffeinate will prevent your Mac from sleeping. To stop the process from running, you can press Ctrl+C which will instantly end the process, and return you to the command prompt.
While running, caffeinate will leave a blank prompt.
For some situations, such as while watching a movie, this may be fine. Other times, you may prefer to set the duration you would like to prevent the Mac from sleeping. Luckily, Apple has made this rather easy to accomplish by using the -t option to your command, followed by the time in seconds. For example, if you wanted to prevent your Mac from sleeping for 5 hours, you would run the following command:
The caffeinate command can also be linked to other commands, such as cloning a git repository, by linking caffeinate to a specific command. This can be done in the following way:
Tip: The brackets around the command ( [command_you_want_to_link] ) are there for demonstation, but would not be used around a normal command such as open .
Using Caffeinate’s Options
Apple understands that each person using this command may have different needs and has provided a number of different options to let users decide what is needed in their situation. These options include:
- -d — Prevent the display from sleeping.
- -i — Prevent the system from idle sleeping.
- -s — Prevent the system from sleeping. This is valid only when system is running on AC power.
- -u — Declare that a user is active. If the display is off, this option turns the display on and prevents the display from going into idle sleep.
- -t — Specifies the timeout value in seconds for which the command is valid.
To learn more about caffeinate and other ways to use the command, visit the Mac Developer Library entry on caffeinate.
Alternatives to the Command Line
Older versions of OS X, unfortunately, do not have the ability to use this command, and the convenience of an application can be difficult to beat. Luckily, developers have listened and provided a number of convenient and compatible options. Each of these includes different features, ranging from simple time settings to more advanced facical detection via the iSight camera, so I encourage you to look through them to find what best fits your needs. These include, but aren’t limited to:
- Caffeine on the Mac App Store by Lighthead Software — Free
- InsomniaX by semaja2 — Free
- Should I Sleep on the Mac App Store by Marcelo Leite — $1.99
- SleepLess by ALXsoft — $9.50
- SmartSleep by Jinx — $3.99
Conclusion
In this Quick Tip we briefly covered some reasons you may want to prevent your Mac from sleeping, how to use the caffeinate command, and lastly I shared some applications that available to users who may prefer the convenience of an application or may not have Mountain Lion installed on their machine. I hope you’ve enjoyed this quick tip, if you have any questions please let me know in the comments and I’ll do my best to answer them!
There are a number of programs, processes, and tasks that your Mac runs either periodically or all the time in the background by default. Many of these programs are essential, but many are not and disabling them will increase the total percentage of your computer’s resources which are available to QLab.
What follows here is a list of these programs or processes which we recommend disabling, and instructions for doing so. This section presupposes a basic understanding of the Mac OS and at least a passing familiarity with the Terminal.
Note: A version of this information was published on our blog in an article entitled Prepare, Execute, Troubleshoot.
Disable Spotlight
Spotlight periodically updates its index of all files on all attached disks, and this updating can cause the disk to be momentarily unavailable to QLab. This can cause late cues or stuttering in playback. To prevent Spotlight from updating its index, open a Terminal window and enter this command:
Disable Display Sleep, Disk Spindown, and System Sleep
Obviously we don’t want our computer going to sleep during a show. The Mac OS has independent sleep intervals for the display, the hard disk, and the whole system. To prevent all three kinds of sleeping, open a Terminal window and enter this command:
Disable Screen Saver
Likewise, we don’t want the screensaver coming up, particularly if QLab is running video. To prevent that from happening, open a Terminal window and enter this command:
Disable Time Machine
Backups are wonderful. You should back up everything, all the time. But on a computer used for your show, backups should only be done manually. Time Machine, much like Spotlight, uses indexing and background processes which can take hold of the disk at inopportune moments. To shut off Time Machine, open a Terminal window and enter this command:
Disable Software Update
You don’t want your computer trying to update software in the middle of a run, let alone in the middle of a performance. To disable Software Update, open a Terminal window and enter this command:
Disable Dashboard
Dashboard, largely neglected by Apple these days, is a pernicious little vampire of CPU time and network access. Also, if accidentally invoked, it takes over the screen of your Mac entirely, which can be surprising and confusing and lead to missed cues. To disable Dashboard entirely, open a Terminal window and enter this command:
Stay Off The Internet
Many individual applications, including QLab, have their own internal scheme to check for updates. You can turn them off manually, and we recommend that. But the best way to guarantee that automatic software updates or any other network traffic won’t bother your show is to disconnect the show computer from the Internet. We strongly encourage this. If you use a network to connect your QLab computer to other hardware, and your show doesn’t require Internet access, make sure that network is a closed LAN (local area network) and has no path to the Internet.
Log Out of iCloud
Even when your Mac is offline, iCloud is surprisingly assertive about checking in and trying to phone home. Logging out of iCloud ensures that this check-in process doesn’t claim processor power when you need it.
Minimize Internet Accounts
Similarly, any accounts used to sync Mail, Contacts, and Calendars can potentially try to access the Internet and take up processing power while doing so, even while network access is disabled.
Disable Hot Corners
Perhaps a lesser danger to a smooth running show, hot corners are nevertheless potentially problematic and we like to disable them, particularly when using screen sharing or VNC. To disable all four hot corners, open a Terminal window and enter these four commands, one at a time:
Disable Notification Center
Depending on the way that you’re using QLab, the iOS-style notifications system in Mac OS 10.8 and newer can be anything between a minor nuisance to a seriously embarrassing accidental component of your projection design. To prevent those charming little pop-up bubbles in the top right corner of your screen, open a Terminal window and enter this command:
Disable Mission Control
Mission Control is the feature that shows you all the open windows of all the open applications on your Mac, and makes it easy to move between them. On most laptops, the keyboard shortcut for this is F3, which is marked with three little rectangles. Needless to say, accidentally invoking Mission Control, particularly in a show with projections, can be a problem. To keep your own control of your theatrical mission, open a Terminal window and enter this command:
Restart the Dock
Oddly, the Dock is in control of several of the system components that we just adjusted. Restarting the Dock allows these changes to take effect. Open a Terminal window and enter this command:
If you’re using QLab for video, there are two more critical settings:
Disable Mirror Displays
When you have more than one display connected to a Mac (including the built-in display on a laptop or iMac), you can either have the displays mirroring each other, showing the same thing, or turn off mirroring, which lets each display show its own image. That’s how you want it set for QLab, so that you can see QLab on your display, and the audience sees your cues on the other display or displays. Amazingly, there is no Terminal command for this! To turn off display mirroring:
Disable Displays have separate Spaces
Spaces is Apple’s name for virtual desktops (if you don’t know what this means, don’t worry about it.) If your displays are set to have separate spaces, the Menu bar also appears on all Displays, and that is visible to your audience when no cues are playing through QLab. To set your displays to share Spaces, and thus keep the menu bar out of your picture, open a Terminal window and enter this command:
Important: you’ll need to log out, then back in again for this to take effect.
Blackout the Desktop
When QLab is playing a Video cue, it places a black “backdrop” over any screen that the Video cue is playing on. When no video is playing, however, QLab does not display this backdrop. Therefore, in order to prevent your audience from seeing anything when no Video cue is playing, you’ll need to set the desktop background on your projector (or other audience-visible display) to black. You can do that in two ways. Either:
Alternately, QLab provides a quick and easy way to do the same thing. Simply choose Black out desktop backgrounds from the Tools menu, and all desktop backgrounds will be set to black. You can later choose Restore saved desktop backgrounds, also from the Tools menu, to restore the desktop backgrounds you had previously.
Macs are generally highly power efficient due to, in part, the optimized sleeping schedule with OS X. Yet in certain scenarios, you might not want your Mac to go to sleep: downloading a huge file, reading a book, reviewing a spreadsheet, analyzing some content on the screen. the list goes on. To resolve this, you can go to System Preferences and mess with the settings, but this can be an annoying process if you need to do it often.
Naturally, there are various solutions available for this dilemma. A classic option is to use the free program Caffeine. More recent versions of OS X introduced some changes to the way the system handles going to sleep alongside a handy built-in utility to induce insomnia. The aptly named Caffeinate is a command line utility that is accessed via Terminal. As the name suggests, running the command will “caffeinate” your Mac and prevent it from going to sleep.
The command can be run by itself along with some modification options that will customize its behavior. Some of the more common options are adding a sleep timer, targeting a specific program/process, and modifying the sleep options.
Step 1: Launch Terminal
Like other operations, Caffeinate is run via Terminal. Just search for and open Terminal from Spotlight Search, from your Launchpad, or via the Utilities folder in Applications.
Step 2: Run the Caffeinate Command
You can simply run the Caffeinate command inside Terminal and it will prevent your Mac from going to sleep for as long as it’s active. To do so, just type in caffeinate inside the Terminal prompt and press the Enter/Return key.
You’ll notice two small changes inside Terminal that tells you the command is currently active. The first is that the Red stoplight has a dot inside it (red arrow) indicating that Terminal is currently running a command. The second is that the prompt cursor is unavailable (blue arrow) indicating that a command is currently being carried out.
Step 3: No More Caffeine!
To stop the Caffeinate command, press the Control + C keys while inside Terminal. This classic keyboard combination stops the currently running Terminal command and your Mac should now resume its regular sleep cycle.
As stated, the Caffeinate command can be run by itself or with some modifier flags—here are a couple useful modifiers:
Adding a Sleep Timer
Say that you want your Mac to “stay up” for an hour, then resume its proper sleep cycle. Just modify the caffeinate command like so, caffeinate -t 3600, where the -t adds a timer followed by the time in seconds. So for this example of 1 hour, it would be 3600 seconds.
Targeting a Specific Application/Process
Another modifier flag is to attach Caffeinate to a certain application or system process. The benefit of this is that the system will not go to sleep as long as the specified program/process is running. So for example, if you’re running Final Cut Pro and don’t want your Mac dozing off, just modify the command like so:
- caffeinate /Applications/Final\ Cut\ Cut\ Pro
This is simpler than it looks. The first part is just the caffeinate command and the second part, for this specific scenario, is just the location of the core Final Cut Pro program.
Some More Specific Modifier Flags
Per the manual pages for the Caffeinate command, there’s a couple other more specific options that you can attach.
- -d will prevent the display from going to sleep
- -i will prevent the system from idle sleeping
- -m will prevent the disk from going to sleep
- -s will prevent the machine from going to sleep when plugged in
- -u replicates a currently active user
Naturally, all these choices can be piled on for interesting scenarios. For example, if you’re planning on some Netflix and chill, you can combine the pieces into the following to ensure that your Mac stays up.
- caffeinate -d /Applications/
Benefits & Limitations of the Caffeinate Command
If you have used the command line before, then you know that you can link up the different flags and arguments in various ways to create something custom and possibly powerful. A few common usage scenarios were outlined above, but these can be wielded in many different and interesting ways depending on your needs.
On the flip side, there are a lot of options and a lot of use scenarios which can potentially conflict and overwhelm you, especially if you’ve never used Terminal before. If that’s the case, then the free and easy-to-use Caffeine app is the way to go.
Personally, I use both Caffeine and the Caffeinate command. Caffeine is awesome for a quick and simple solution but when you want to get all fancy, then Caffeinate is a good native option to use.
More Terminal Hacks
- Purge RAM for Improved System Performance
- Install the Command Line Developer Tools Without Xcode
- Access Recently Used Apps & Documents from Your Dock
- 13 Terminal Commands Every Mac User Should Know
- Organize Your Dock by Adding Blank Spaces as App Icon Dividers
Follow Apple Hacks over on Facebook and Twitter, or Gadget Hacks over on Facebook, Google+, and Twitter, for more Apple fun.
Keep Your Connection Secure Without a Monthly Bill. Get a lifetime subscription to VPN Unlimited for all your devices with a one-time purchase from the new Gadget Hacks Shop, and watch Hulu or Netflix without regional restrictions, increase security when browsing on public networks, and more.
If the USB device does not work after your computer has been in extended hibernation, it is likely that Windows has automatically turned off the USB Root hub to save power.
The steps below outline how to configure the USB root hub to stay on during hibernation, to prevent this from happening.
Windows 10 / 8
- On your keyboard, press the Windows key + X and select Control Panel.
- Click Hardware and Sound, then click Power Options.
- Click Change plan settings for the plan you want to change.
- Click Change advanced power settings.
- Click the plus sign (+) next to “USB settings” and “USB selective suspend setting” to expand the options and change the setting to Disabled.
- Click OK to apply the setting.
Note: You may need to disconnect and re-connect your USB device after applying these settings to re-establish the connection.
Windows 7 / Vista
- Click the Start button and select Control Panel.
- Click Hardware and Sound, then click Power Options.
- Click Change plan settings for the plan you want to change.
- Click Change advanced power settings.
- Click the plus sign (+) next to “USB settings” and “USB selective suspend setting” to expand the options and change the setting to Disabled.
- Click OK to apply the setting.
Note: You may need to disconnect and re-connect your USB device after applying these settings to re-establish the connection.
Windows XP
- On your desktop, right-click the My Computer icon and select Properties.
- Click the Device Manager tab.
- Expand Universal Serial Bus controllers by clicking the arrow to the left of it.
- Right-click the first USB Root Hub device and select Properties.
- Click the Power Management tab.
- Clear the box next to Allow the computer to turn off this device to save power.
- Click OK to apply the setting.
- Repeat steps 4-7 for any remaining devices in the Universal Serial Bus Controllers section with “Root Hub” in the name.
Note: You may need to disconnect and re-connect your USB device after applying these settings to re-establish the connection.
В этой статье рассказывается, как предотвратить самопроизвольное извлечение внешних дисков на компьютерах Mac.
Обычно сообщение Disk Not Ejected Properly (Диск не извлечен должным образом) появляется, если отключить внешний диск от компьютера, не выполнив перед этим безопасное извлечение. Некоторые пользователи сообщали о том, что после обновления macOS иногда происходит самопроизвольное извлечение накопителей. В большинстве сообщений говорится, что эта проблема наблюдается, когда как компьютер переходит в режим сна. См. пример ниже.
Кроме того, самопроизвольное извлечение внешнего диска может произойти еще в некоторых случаях:
- Неисправный кабель внешнего диска.
- Неисправный блок питания внешнего диска для настольных компьютеров.
- Неисправный порт USB или Thunderbolt в компьютере.
- Сбой внешнего диска.
- Проблема, связанная с обновлением macOS или процессом обновления.
Порядок устранения неполадки
- Попробуйте использовать другой кабель
- Попробуйте использовать другой блок питания (в случае с внешним диском для настольных компьютеров)
- Подключите внешний диск к другому порту USB или Thunderbolt на компьютере
- Выполните диагностику внешнего диска с помощью программы First Aid. Инструкции
- Выполните сброс NVRA или PRAM на своем компьютере Mac
Способы предотвращения самопроизвольного извлечения внешнего диска
Безопасное извлечение внешнего диска, если он не используется
Лучший метод избежать внезапного извлечения внешнего диска — выполнить его безопасное извлечение, когда он не используется. Для этого воспользуйтесь одним из следующих способов:
- на рабочем столе щелкните накопитель правой кнопкой мыши и выберите пункт Eject «Имя диска» (Извлечь «Имя диска»);
- на рабочем столе перетащите внешний диск в корзину;
- в Finder нажмите кнопку Eject (Извлечь) рядом с внешним диском.
Запрет перехода компьютера и внешнего диска в режим сна
Если накопитель работает нормально, а самопроизвольное извлечение начинается после обновления macOS, то проблема может заключаться в macOS. В этом случае, чтобы предотвратить самопроизвольное извлечение внешнего диска, можно запретить переход компьютера и внешнего диска в режим сна. См. действия ниже.
Изменение параметров в области «Экономия энергии» на компьютере MacBook
- Перейдите в меню Apple и выберите Системные настройки
- Выберите Экономия энергии
- Выберите Сетевой адаптер
- Установите флажок Предотвращать автопереход компьютера в режим сна при выключенном дисплее
- Снимите флажок По возможности переводить диски в режим сна
Примечание. Этот способ не работает, если компьютер Mac питается от аккумулятора. Компьютер Mac должен быть подключен к сети питания, а его крышка должна быть открыта.
«Экономия энергии» на компьютерах MacBook Pro
Изменение параметров в области «Экономия энергии» на компьютерах iMac and Mac Mini
- Перейдите в меню Apple и выберите Системные настройки
- Выберите Экономия энергии
- Установите флажок Предотвращать автопереход компьютера в режим сна при выключенном дисплее
- Снимите флажок По возможности переводить диски в режим сна
«Экономия энергии» на компьютерах iMac
«Экономия энергии» на компьютерах Mac Mini
Примечание. Даже после изменения этих параметров самопроизвольное извлечение внешнего диска может произойти, если вручную перевести компьютер в режим сна. В этом случае лучше всего выполнить безопасное извлечение накопителя, а затем уже переводить компьютер Mac в режим сна.
A closed but alert MacBook can act as a desktop, server or jukebox.
A MacBook doesn’t need to be open to be useful. Connected to an external display, it can run while it’s closed and act like a Mac Mini . By itself, a MacBook can run when closed with the help of a third-party app. You may want to do this so you can tote your MacBook from meeting to meeting at work without needing to reconnect to your network each time you reopen it. Or perhaps you want use it as a server, or just to play music to an external speaker with it tucked away.
1. Connected to external display
When connected to an external display, your MacBook will keep running if you also have it connected to a wall outlet and wired keyboard and mouse. You can use a wireless keyboard and mouse as long as you go to System Preferences > Bluetooth > Advanced and check the box for Allow Bluetooth devices to wake this computer. When you see your MacBook’s desktop on the external monitor, you can close your MacBook and it will keep running.
- See this Apple Support page for more information.
2. Using InsomniaX to prevent sleep
MacOS does not have a setting that lets you override the default behavior of entering sleep mode as soon as a MacBook’s lid is closed. Enter InsomniaX for Mac.
InsomniaX is a free app that places an icon in the menu bar that you can use to disable sleep mode when the lid is closed as well as when your MacBook sits idle. With Disable Lid Sleep checked from the menu bar icon, you can close your MacBook and keep it running.
I use it to play music and can happily report that the Bluetooth connection remains active along with my music source (be it Spotify, YouTube, iTunes or whatever) so I can pump out the jams to a Bluetooth speaker from my closed MacBook Pro .
Lastly, I would be remiss if I didn’t end this post with a warning: Running your MacBook while it’s closed could lead to it getting too hot. MacBooks vent air from their back edge, and the opening is smaller when the lid is shut. If you feel your MacBook is getting uncomfortably warm operating in this manner, you may want to disable the sleep override or use it for shorter amounts of time.
This article provides instructions to prevent random ejection of external drives on Mac.
The message “Disk Not Ejected Properly” usually appears when an external drive is disconnected from the computer without safely ejecting. However, some users have reported issues with drives randomly ejecting themselves after updating the macOS. Most reports indicate that the issue is seen after the computer has gone to sleep. See the prompt below:
There are a few other instances that can cause random ejection of an external drive:
- Defective external drive cable
- Defective external desktop drive power supply
- Defective computer USB or Thunderbolt port
- Failing external drive
- Issue related to macOS update or the update process
Troubleshoot
- Test the external drive using a different cable
- Test a different power supply (external desktop drive)
- Connect to a different USB or Thunderbolt port on your computer
- Diagnose your external drive by running First Aid. Click here for instructions
- Reset NVRA or PRAM on your Mac
Methods to avoid Unexpected Ejections
Safely Ejecting When Not Using
The best method to avoid unexpected ejections is safely ejecting the drive when you are done using it. Use one of the methods listed below to eject an external drive:
- On the desktop right-click the drive then choose Eject “Drive Name”
- On desktop, drag the external drive to the Trash
- In Finder, click the Eject button next to the external drive
Preventing computer and drive from sleep
If your drive was working normally and the ejection issue started after upgrading the macOS, the issue may relate to macOS itself. If that’s the case, a method that prevents both computer and external drive from sleeping avoids unexpected ejection. See the steps below:
Changing Mac’s Energy Saver settings on MacBook
- Click on the Apple icon then select System Preferences
- Click on Energy Saver
- Click on Power Adapter
- Enable “Prevent computer from sleeping automatically when display is off”
- Disable “Put hard disks to sleep when possible”
Note: The workaround will not work if the Mac is operating on battery. The Mac power supply must remain connected and the computer lid must remain open.
Hi I’m Cara, a Carbonite expert. I can walk you through this process!
- This article is for Windows – View the Mac article
Windows has a number of settings you can configure to save power, including a number of sleep and hibernation modes, though not all will be available on each computer. The following are the three most common:
- Sleep: A low-power mode in which some hardware components remain powered. System state (in memory) is maintained in memory.
- Hibernation: A low-power mode that reduces power consumption to its lowest possible level. System state (in memory) is saved to disk.
- Hybrid Sleep: A combination of Sleep and Hibernation, system memory is saved to disk and the computer then enters Sleep.
Sleep is useful in making sure the computer can resume quickly. Hibernation allows the computer to resume after a power failure, but is slower to start than Sleep. Hybrid Sleep can resume quickly, but if the power fails, can still resume from the Hibernated state saved to disk. For the purposes of backing up and restoring, all low-power modes will interrupt Carbonite, as programs typically do not run while the computer is in Sleep Mode or Hibernation.
Carbonite will automatically change the power settings of your Windows computer for the initial backup so that your computer remains on when the computer is plugged into a power source. After the initial backup is complete, Carbonite will automatically change the power settings of your computer back to the way they were. This allows Carbonite to keep your computer on for the duration of the initial backup and helps to make sure that your files get uploaded to our servers as fast as possible.
Carbonite makes the following power settings changes during the initial backup:
Put the computer to sleep = Off
- This will make it so that your computer does not go into Sleep mode when idle.
Wireless Adapter Settings = Maximum Performance
- This will help you get the most out of your wireless adapter if you are connected to the internet wirelessly.
Lid close action = Do nothing
- This will make it so that your computer doesn’t shut off when you close the lid.
After your initial backup is done, these settings will be automatically changed to how they were before you installed Carbonite.
Even if your computer does go into sleep mode, your backup will still continue from where it left off after it is turned back on and connected to the internet.
You can adjust your power settings manually at any time for better backup and restore performance. Please choose your operating system from the list below for instructions.
The sections below are collapsed. Please click a section title to open / close the appropriate section.
Windows 7
To configure power settings for Windows Vista and Windows 7 computers, first click the Windows Start button and select Control Panel.
Within the Control Panel, double-click Hardware and Sound.
Click Power Options to view and edit the power settings on your computer.
You will see the Power Options Properties window displayed.
Under Select a power plan, click Change plan settings for whichever plan you have selected.
For the Put the computer to sleep setting, select Never. Once changed, click Save changes and close the Control Panel.
Windows 8
To configure power settings for Windows 8 computers, first open the Search charm by pressing the Windows key + F on your keyboard or hovering your mouse over the top right corner of your computer screen until the Charm bar appears, then clicking the search icon.
Within the Search charm, type Power Options into the Search field and press Enter on your keyboard.
Click Settings under the Search field and click Power Options in the results panel.
You will see the Power Options Properties window displayed. Under Select a power plan, click Change plan settings for whichever plan is selected.
For the setting entitled Put the computer to sleep, select Never. Once changed click Save changes and close the Control Panel.
Windows 10
The easiest way to access Power Options in Windows 10 is by using the Search bar in Start Menu. Click the Search bar next to the Start Menu and type power. Then click Edit power plan in the search results.
You will see the Power Options Properties window displayed. Under Choose or customize a power plan, click Change plan settings for whichever plan you have selected.
For the setting entitled Put the computer to sleep, select Never. Once changed click Save changes and close the Control Panel.
This module is part of ansible-core and included in all Ansible installations. In most cases, you can use the short module name service even without specifying the collections: keyword. However, we recommend you use the FQCN for easy linking to the module documentation and to avoid conflicting with other collections that may have the same module name.
New in version 0.1: of ansible.builtin
SynopsisÁ
Controls services on remote hosts. Supported init systems include BSD init, OpenRC, SysV, Solaris SMF, systemd, upstart.
This module acts as a proxy to the underlying service manager module. While all arguments will be passed to the underlying module, not all modules support the same arguments. This documentation only covers the minimum intersection of module arguments that all service manager modules support.
This module is a proxy for multiple more specific service manager modules (such as ansible.builtin.systemd and ansible.builtin.sysvinit ). This allows management of a heterogeneous environment of machines without creating a specific task for each service manager. The module to be executed is determined by the use option, which defaults to the service manager discovered by ansible.builtin.setup . If setup was not yet run, this module may run it.
For Windows targets, use the ansible.windows.win_service module instead.
This module has a corresponding action plugin .
Adjust auto sleep time on Mac OS X, Most of the folks are wondering about why I make auto-sleep or showing a black screen when he/she does not continuously access Mac for a few minutes. in a technical manner, we can say it’s the power-saving mode or auto logoff for the security reason. Most of the people affecting due to apple gave limited time for auto turn off the screen (About 10 to 13 minutes) by default. But we can vary this time from the Mac OS X system preference settings. Here I discussed how to Disable or Enable auto-sleep display or auto logoff time duration on Mac OS X With the latest macOS. This setting will be resettings every time after to clean install or Downgrade macOS version.
we are happy to help you, submit this Form, if your solution is not covered in this article.
After sleep desktop or MacBook screen, your system process will be continued in the background. But you can manage all the settings that you want, throughout the below way.
Note: The Power solution go-ahead by keeping Portable External Macbook Charger . If you wish to save battery on your MacBook then Enable Low Power mode on MacBook.
Steps for Adjusting Auto Sleep Time on Mac, MacBook Pro/Air, iMac, Mac Mini Display
Option 1: Schedule Startup Or Wake and Sleep Time on Mac, MacBook: Monterey
It seems like Apple has put a lot of effort into developing small features, but in reality, settings like this have a huge impact on our life. Auto Sleep and Wake for Mac, MacBook is enhanced and more customizable with the options to schedule Startup/Wake and Sleep Time in macOS Monterey or newer.
You can set the days and time for the Startup/Wake as well as the same for Sleep, so even if you’re out and forget to turn off the laptop, the system will automatically turn off the MacBook without any manual intervention on schedule time.
- Click on the Apple menu from the top bar.
- Select System Preferences.
- At the end of the screen, click on Energy Saver.
- Next up, click on Schedule in the left sidebar.
- Now select Startup or wake, and from the dropdown, choose days and then the time at which you want Mac to start up or wake.
- After that, click on Sleep, and set the day and time to let Mac sleep automatically in your given time.
- That’s it.
Option 2: Prevent Mac From Sleeping Monterey, macOS Big Sur, Catalina, or earlier
- Go to the Apple Menu,
- Click on System preference.
Step 2: Next, Click on Energy Sever .
Step 3: Slide to the left to right to increase auto sleep time on Mac or MacBook.
If you are a beginner and a little bit confuse about the wrong settings, that causing the issue double, then First Click on Restore Defaults, after that Make known customization.
The alert message will appear on the screen, Click on Ok for a set time.
Many other options related to power saving are present there, You can enable prefer option as of your usage and requirements.
Way to Adjust auto sleep time on Mac
if you want to know what is current time duration set on your Mac, just Open terminal from Spotlight, and past the below command line, the result has been displayed in below image,
sudo systemsetup -getcomputersleep
Can’t able to set the time using the above steps, Past below command in a terminal, Below example 45 is minutes
sudo systemsetup -setcomputersleep 45
disable or never set auto sleep time on Mac
sudo systemsetup -setcomputersleep never
Less time duration more convenient for saving power when the mac is not in use. So set to try in normal duration, not longer time by adjusting auto sleep time on Mac – MacBook Pro, MacBook Air, iMac Pro.
jaysukh patel
Jaysukh Patel is the founder of howtoisolve. Also self Professional Developer, Techno lover mainly for iPhone, iPad, iPod Touch and iOS, Jaysukh is one of responsible person in his family. Contact On: [email protected] [OR] [email protected]
Who is this article for?
Find your product plan in the Code42 console on the Account menu .
Not an Incydr customer? For CrashPlan articles, search or browse .
Incydr Professional, Enterprise, Gov F2, and Horizon, no.
Incydr Basic, Advanced, and Gov F1, yes.
CrashPlan Cloud, no.
Retired product plans, no.
CrashPlan for Small Business, no.
Overview
If your device is asleep or turned off, the Code42 app doesn’t run, and therefore it can’t back up or download files. If you need to back up or download a large number of files, disable your device’s sleep settings. This article provides links to information about modifying your device’s energy settings to facilitate uninterrupted backup and download tasks.
Considerations
Disabling your sleep settings is especially useful if you are completing your initial backup or downloading all of your files after replacing your device. However, it can be used any time you need the Code42 app to back up or download a large amount of data. This can significantly reduce the time it takes to complete the backup or download process.
Once the Code42 app is done backing up or downloading your files, you can change the sleep settings back to their original settings.
Changing default sleep settings
Select your operating system for instructions on disabling your device’s default sleep settings.
Hibernate and power nap
Other sleep settings include “hibernate” (Windows) and “power nap” (Mac). The Code42 app cannot back up or download files during these states.
- Windows: For instructions on disabling hibernation, see How to disable and re-enable hibernation on a computer that is running Windows.
- Mac: To learn more about what power nap does, and how you can turn it on and off, see What is Power Nap on Mac?.
Определение
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Приостанавливает текущий поток на заданное время.
Перегрузки
Приостанавливает текущий поток на заданное количество миллисекунд.
Приостанавливает текущий поток на заданное время.
Sleep(Int32)
Приостанавливает текущий поток на заданное количество миллисекунд.
Параметры
Количество миллисекунд, на которое приостанавливается поток. Если значение аргумента millisecondsTimeout равно нулю, поток освобождает оставшуюся часть своего интервала времени для любого потока с таким же приоритетом, готовым к выполнению. Если других готовых к выполнению потоков с таким же приоритетом нет, выполнение текущего потока не приостанавливается.
Исключения
Значение времени ожидания является отрицательной величиной и не равно Infinite.
Примеры
В следующем примере метод используется Sleep для блокировки основного потока приложения.
Комментарии
Выполнение потока не будет запланировано операционной системой на указанный период времени. Этот метод изменяет состояние потока для включения WaitSleepJoin .
Можно указать Timeout.Infinite для параметра, millisecondsTimeout чтобы приостановить поток в течение неограниченного времени. Однако System.Threading Mutex Monitor EventWaitHandle Semaphore для синхронизации потоков или управления ресурсами рекомендуется использовать другие классы, такие как,, или.
Системные тактовые импульсы с заданной скоростью, называемой разрешением часов. Фактическое время ожидания может быть не равно указанному времени ожидания, так как указанное время ожидания будет изменено в соответствии с тактами времени. дополнительные сведения о разрешении часов и времени ожидания см. в разделе функция Sleep из Windows системных api.
Этот метод не выполняет стандартные конвейеры COM и SendMessage.
Если необходимо включить спящий режим в потоке, который имеет STAThreadAttribute , но вы хотите выполнить стандартные выгрузки com и SendMessage, рассмотрите возможность использования одной из перегруженных версий Join метода, указывающих интервал времени ожидания.
By: Waseem Patwegar
If you are unable to send or receive files using AirDrop on your MacBook, you can find below the steps to fix the problem of AirDrop Not Working on Mac.
AirDrop Not Working on Mac
AirDrop makes it easy to transfer Files, Photos and Videos between all supported Apple Devices. However, many users still run into a variety of problems while trying to use AirDrop for the first time on their MacBooks.
Even if you had previously used AirDrop on your Mac, it can sometimes stop working due to Network problems, iCloud glitches and other issues.
1. Check Device Compatibility
In order to use AirDrop, both sending and receiving devices need to be 2012 or later versions of Mac, running OS X Yosemite or later version of macOS.
Also, the device to which you are trying to transfer files using AirDrop must be an AirDrop compatible device.
If you are trying to AirDrop from Mac to iPhone, the receiving device (iPhone) needs to be an iPhone 5 or later version, running iOS 7 or later versions of iOS software.
If you are trying to AirDrop from Mac to iPad or iPod, the iPad must be iPad 4 or later and iPod needs to be 5th generation or newer.
2. Make Sure Both WiFi and Bluetooth are Turned ON
AirDrop uses Bluetooth to locate nearby devices and WiFi to transfer Data between two Apple devices. Hence, make sure that WiFi and Bluetooth are enabled on both sending and receiving devices.
Open the Finder on your Mac and click on the AirDrop tab in left-pane. In the right-pane, click on Turn ON Wi-Fi and Bluetooth button.
Make sure both WiFi and Bluetooth are enabled on your device.
3. Allow AirDrop from Everyone
AirDrop provides the option to Share Data with “Contacts only” and with “Everyone”. However, selecting “Contacts only” option can sometimes lead to problems.
Open the Finder on your Mac and click on AirDrop tab in the left-pane. In the right-pane, click on Allow me to be discovered by and select Everyone in the drop-down menu.
If you are having problems sending Files via AirDrop, make sure Allow Everyone option is enabled on the device that you are transferring files to.
4. Sign into iCloud on Both Devices
If you want to use “Contacts Only” Mode in AirDrop, you need to make sure that both sending and receiving device are signed into iCloud.
Also, the Email ID or Telephone Number associated with iCloud Accounts must be available in the Contacts List on both devices.
5. Turn OFF Do Not Disturb Mode
AirDrop does not work if Do Not Disturb Mode is enabled on your device. Hence, make sure that your device is not in DND Mode.
Click on the Notifications Icon located at top-right corner and move the toggle next to Do Not Disturb to OFF position.
Similarly, make sure that the device to which you are transferring files is not placed in Do Not Disturb Mode.
6. Check Firewall Settings
Sometimes, the problem is due to Incoming Communications being blocked in the Firewall Settings on your device.
To confirm, click on the Apple Icon in top-menu bar and select System Preferences in the drop-down menu.
On System Preferences screen, click on Security & Privacy Icon. on the next screen, switch to Firewall tab and click on Firewall Options button.
On the next screen, uncheck the little box next to Block all incoming connections .
Click on OK to save this setting
7. Prevent Mac from Going to Sleep
AirDrop can fail if your Mac goes to sleep during the file transfer process. Hence, follow the steps below to prevent Mac from going to sleep, when the display is OFF.
Click on Apple Icon > System Preferences > Energy Saver > select Prevent computer from sleeping automatically when the display is off option on the next screen.
AirDrop Option Not Available on Mac
If you are unable to find the AirDrop option on Mac, you can refer to this guide: AirDrop Icon Greyed Out on iPhone and Missing on Mac.
- ROM
- CPU
- RAM
- GPU
Looking to see if anyone knows the answer to this (it’s a really dumb question, but as the man says, there are no dumb questions, just dumb answers. So here goes), but first some background. We recently merged with another company, and because this company has stocks, investors, and is traded on the open market, SOX applies to us. Our SOX auditors insisted we have to have a GPO for an auto screen saver that pop on if say someone walks away from their computer for X amount of time. 30 minutes was their recommendation for that maximum amount of time (which is what I set it for). I’m using the standard logon.SCR, and this has been pushed out to all our systems.
Since then, some of my users have gotten it into their head that say their loading up a huge file, and they leave their computer alone, when the screen saver kicks in, it terminates that process, or at least puts it on hold. Now my thinking is that a screensaver doesn’t do that. It’s jsut to prevent someone from viewing your work, and that it WON’T interrupt what you’re doing. A casual search on Google isn’t giving me the answer, and I was wondering if any of my fellow SpiceHeads can shed some light on it.
Screensaver shouldn’t but maybe verify power management settings to make sure it isn’t turning off disks, going to sleep, etc.
11 Replies
My screen saver kicks in all the time on file copies, remote sessions, and various long processes. I like to kick off things which are time consuming before meetings, lock the PC, and let the screen saver kick in all the way down to a power save – monitor turn off. All my processes keep going.
Screensaver shouldn’t but maybe verify power management settings to make sure it isn’t turning off disks, going to sleep, etc.
Yep, as Justin says it shouldn’t cause any problems, we used to do a similar thing at my old workplace as they were ISO 27001 certified and so every PC had to be locked even if you were away from it for a few minutes and I can confirm that I never ran into any problems, either from locking the PC or from letting the screensaver do it using logon.scr.
For the most part that is the case what Justin says – I have seen certain processes that are terminated though, but I cannot remember in particular which ones.
HD IT Solutions is an IT service provider.
Screensavers were originally designed to stop screen burn (i.e. Save the Screen)
These days they’re mostly there to either look impressive, or to prevent someone seeing your screen.
They shoud not stop processes in the background. They are merely another process running on the computer. However, a really busy screensaver may have the effect of consuming more resource than you’d ideally like it to.
Why not run a few tests?
I am in agreement with Justin. I have started processes and set the screensaver while I did something else, and I have never had an issue with the processes being interrupted by the screensaver. We have a 2 min screensaver and 15 min logoff if idle policy here for the end users, so if the logoff would kick in before the process ends, then the process would be terminated.
Screensavers definitely do not stop running processes but they do “grab focus.”