Introduction
Sometimes a MacBook Pro does something extremely annoying: you click Apple menu โ Shut Down, the screen turns off for a moment, and then the Mac starts again by itself.
At first it feels like a normal restart, but actually it may be a wake/power-management issue. The Mac begins shutting down, but a hardware, network, USB-C, monitor, dock, Bluetooth, or macOS power event wakes it again.
In our real case, the logs showed the issue was coming from the Wi-Fi/network wake path, not from a normal app like Chrome, Slack, VS Code, or Docker. The key log lines showed airportd ... systemWokenByWiFi and repeated IOSkywalkLegacyEthernet ... en0, where en0 was the Wi-Fi interface.
Apple also notes that unexpected restarts can be caused by software or connected devices, so both macOS services and external hardware must be checked. (Apple Support)
Common Symptoms
You may see one or more of these:
- You click Shut Down, but the Mac restarts immediately.
- It happens only when an external monitor is connected.
- It happens only with a USB-C dock or hub.
- It happens only when charger is connected.
- It happens even after disabling
AutoBoot. - You see no clear app error.
pmsetlogs show terms like:MAGICWAKEDarkWakeWake reasonairportden0IOSkywalkNetworkBSDClientsystemWokenByWiFi
Why This Happens
Modern MacBook Pros, especially Apple Silicon models, do not instantly go into a full electrical โdead offโ state the moment you click shutdown. macOS shuts down in stages:
- Apps close.
- User session ends.
- System services stop.
- Hardware controllers power down.
- Wi-Fi, Bluetooth, USB-C, Thunderbolt, power delivery, and network services may still be active briefly.
During this transition, a wake-capable service or device can send a signal. macOS may interpret that as:
โSomething needs the Mac awake.โ
So the flow becomes:
User clicks Shut Down
โ
macOS starts shutting down
โ
Wi-Fi / USB-C / dock / network wake event arrives
โ
Mac powers back on
โ
User thinks shutdown became restart
Appleโs own Battery settings include Wake for network access, which allows the Mac to wake so shared resources can be accessed; Apple documents that this setting can be changed to Never if you do not want remote/network wake behavior. (Apple Support)
Real Case Diagnosis
In this case, this command was used:
log show --last 10m --style compact --predicate 'eventMessage CONTAINS[c] "MAGICWAKE" OR eventMessage CONTAINS[c] "Wake reason" OR eventMessage CONTAINS[c] "IOSkywalk" OR eventMessage CONTAINS[c] "Previous shutdown cause"' | tail -30
Code language: JavaScript (javascript)
The important output was:
airportd ... systemWokenByWiFi
This means the Apple Wi-Fi service was involved.
There were also repeated lines like:
IOSkywalkLegacyEthernet as no other controller was found for en0
Code language: JavaScript (javascript)
Earlier, networksetup -listallhardwareports confirmed:
Hardware Port: Wi-Fi
Device: en0
So the direct culprit was:
Wi-Fi en0 โ airportd โ IOSkywalk network stack โ wake event
In simple language:
The Mac was being woken by the Wi-Fi/network subsystem during or shortly after shutdown.
The later pmset -g assertions output showed No kernel assertions, which means there was no persistent kernel-level blocker at that moment. That makes a normal app less likely and points more toward a temporary wake event during shutdown.
Step-by-Step Troubleshooting Guide
Step 1: Confirm Whether It Is a True Restart or Wake Event
After the Mac restarts automatically, immediately open Terminal and run:
pmset -g log | grep -i "Wake reason" | tail -20
Code language: JavaScript (javascript)
Also run:
log show --last 30m | grep -i "Previous shutdown cause"
Code language: JavaScript (javascript)
If you see Wake reason, DarkWake, MAGICWAKE, airportd, or en0, it is likely a wake event.
If you see panic, crash, or shutdown cause errors, it may be a crash/restart problem.
Step 2: Check Power Assertions
Run:
pmset -g assertions
Look for these:
PreventSystemSleep
PreventUserIdleSystemSleep
ExternalMedia
NetworkClientActive
Kernel Assertions
Example interpretation:
| Output | Meaning |
|---|---|
PreventSystemSleep 1 | Something is actively preventing sleep/shutdown behavior |
NetworkClientActive 1 | Network service may be active |
ExternalMedia 1 | External disk/device may be involved |
MAGICWAKE | Network/wake event happened |
No kernel assertions | No persistent kernel-level blocker now |
In our case, the later output showed:
No kernel assertions.
That was a good sign because it meant there was no ongoing kernel blocker after the restart.
Step 3: Find What en0 Means
If logs show en0, do not guess. Find the exact interface:
networksetup -listallhardwareports
Example output:
Hardware Port: Wi-Fi
Device: en0
or:
Hardware Port: USB 10/100/1000 LAN
Device: en0
Interpretation:
| Device | Culprit |
|---|---|
en0 = Wi-Fi | Wi-Fi network wake |
en0 = USB LAN | USB-C dock/monitor Ethernet |
en0 = Thunderbolt Ethernet | Thunderbolt dock/network adapter |
en0 = Bridge | Thunderbolt bridge/network bridge |
In this real case:
en0 = Wi-Fi
So the direct culprit was Wi-Fi wake.
Step 4: Disable Network Wake Features
Run:
sudo pmset -a tcpkeepalive 0
sudo pmset -a womp 0
sudo pmset -a powernap 0
Then verify:
pmset -g | egrep "tcpkeepalive|womp|powernap"
Code language: JavaScript (javascript)
Expected output:
powernap 0
tcpkeepalive 0
womp 0
Meaning:
| Setting | Meaning |
|---|---|
tcpkeepalive 0 | Disables TCP keep-alive while sleeping |
womp 0 | Disables Wake on Magic Packet / Wake for network access behavior |
powernap 0 | Disables background updates during sleep |
Appleโs Battery settings also expose related options such as Wake for network access and Power Nap, where available. Apple describes Power Nap as allowing checks for mail, calendar, and iCloud updates while sleeping, and Wake for network access as allowing the Mac to wake for shared resources. (Apple Support)
Step 5: Disable Wake for Network Access in macOS UI
Go to:
Apple menu โ System Settings โ Battery โ Options
Change:
Wake for network access โ Never
Also disable Power Nap if shown.
Appleโs guide says Mac laptop users can go to Battery settings, open Options, and set Wake for network access to Never if they do not want the Mac waking for network access. (Apple Support)
Step 6: Test Shutdown Again
Now test normal shutdown:
Apple menu โ Shut Down
Do not unplug anything yet.
If it shuts down properly, the issue was likely network wake.
If it still restarts, continue.
Step 7: Confirm Wi-Fi as the Culprit
Run this test:
networksetup -setairportpower en0 off
sudo shutdown -h now
If the Mac shuts down properly after Wi-Fi is disabled, then the cause is confirmed:
Wi-Fi wake / network stack
After turning the Mac on again, re-enable Wi-Fi:
networksetup -setairportpower en0 on
Step 8: Check External Monitor, Dock, and USB-C Hub
Even if logs show Wi-Fi, an external monitor or dock can still contribute indirectly.
Many USB-C monitors behave like multiple devices at the same time:
Monitor
+ Charger
+ USB hub
+ Ethernet adapter
+ Audio device
+ Power delivery controller
So a monitor may trigger wake indirectly through USB-C, power delivery, network, or hub behavior.
Check these scenarios:
| Scenario | Likely Cause |
|---|---|
| Restart happens only when monitor connected | USB-C display/dock wake |
| Restart happens only when charger connected | Power delivery wake |
| Restart happens only with dock | Dock firmware or USB hub |
| Restart happens only with Ethernet via dock | Dock LAN wake |
| Restart happens even without monitor | macOS network/power setting |
Try changing monitor settings:
- Disable USB-C charging / Power Delivery if possible.
- Disable monitor USB hub.
- Disable monitor Ethernet.
- Disable โUSB always on.โ
- Disable โAuto input switch.โ
- Disable โWake on USB-C.โ
- Update monitor firmware.
- Try HDMI instead of USB-C.
- Try a different USB-C port.
- Try direct cable instead of dock.
Step 9: Check Login Items and Apps
Most of the time, this issue is not caused by a normal app. But still check:
osascript -e 'tell application "System Events" to get the name of every login item'
Code language: JavaScript (javascript)
Also check:
System Settings โ General โ Login Items
Temporarily disable:
- VPN clients
- cloud sync tools
- display managers
- dock utilities
- antivirus/security agents
- keyboard/mouse tools
- DisplayLink Manager
- monitor control apps
Apps that manage hardware, networking, display, or VPN are more suspicious than normal apps like browser or editor.
Step 10: Safe Mode Test
Safe Mode helps check whether third-party login items, extensions, or drivers are involved.
For Apple Silicon Mac:
- Shut down the Mac.
- Press and hold the power button.
- Wait until Loading startup options appears.
- Select your startup disk.
- Hold Shift.
- Click Continue in Safe Mode.
Apple documents this Apple Silicon Safe Mode process in its Mac Help guide. (Apple Support)
After entering Safe Mode, try shutting down again.
Interpretation:
| Result | Meaning |
|---|---|
| Shutdown works in Safe Mode | Third-party software/driver likely involved |
| Shutdown still restarts | Hardware, firmware, USB-C, network, or macOS power setting likely involved |
Step 11: Try Terminal Shutdown
Run:
sudo shutdown -h now
Interpretation:
| Result | Meaning |
|---|---|
| Terminal shutdown works | macOS UI/session/app issue possible |
| Terminal shutdown also restarts | Lower-level wake, hardware, firmware, network, dock, or power issue |
Step 12: Check for Crash or Kernel Panic
Run:
log show --last 24h | grep -i "panic"
Code language: JavaScript (javascript)
Also:
log show --last 24h | grep -i "shutdown cause"
Code language: JavaScript (javascript)
If your Mac is crashing, that is different from wake-triggered restart.
Apple says unexpected restarts can be related to software or connected devices, and recommends checking both when the Mac restarts because of a problem. (Apple Support)
Step 13: Run Apple Diagnostics
If shutdown still fails after all network and monitor checks, run Apple Diagnostics.
For Apple Silicon:
- Shut down.
- Press and hold the power button.
- Wait for startup options.
- Press and hold Command + D.
For Intel:
- Turn on the Mac.
- Immediately press and hold D.
Apple documents Apple Diagnostics as a way to test Mac hardware, with different startup steps for Apple Silicon and Intel Macs. (Apple Support)
Command Cheat Sheet
Check wake reason
pmset -g log | grep -i "Wake reason" | tail -20
Code language: JavaScript (javascript)
Check shutdown reason
log show --last 30m | grep -i "Previous shutdown cause"
Code language: JavaScript (javascript)
Small focused wake log
log show --last 10m --style compact --predicate 'eventMessage CONTAINS[c] "MAGICWAKE" OR eventMessage CONTAINS[c] "Wake reason" OR eventMessage CONTAINS[c] "IOSkywalk" OR eventMessage CONTAINS[c] "Previous shutdown cause"' | tail -30
Code language: JavaScript (javascript)
Check power assertions
pmset -g assertions
Find network interfaces
networksetup -listallhardwareports
Disable network wake features
sudo pmset -a tcpkeepalive 0
sudo pmset -a womp 0
sudo pmset -a powernap 0
Verify settings
pmset -g | egrep "tcpkeepalive|womp|powernap"
Code language: JavaScript (javascript)
Turn Wi-Fi off for testing
networksetup -setairportpower en0 off
Turn Wi-Fi back on
networksetup -setairportpower en0 on
Force shutdown from Terminal
sudo shutdown -h now
How to Read Important Log Terms
| Log Term | Meaning |
|---|---|
airportd | Apple Wi-Fi daemon |
systemWokenByWiFi | System wake related to Wi-Fi |
en0 | Network interface, often Wi-Fi |
IOSkywalkNetworkBSDClient | Apple low-level network stack |
IOSkywalkLegacyEthernet | Low-level network driver path |
MAGICWAKE | Wake triggered by network/magic packet/wake event |
DarkWake | Mac wakes in background without full user session |
Wake reason | Hardware/software reason for wake |
powerd | macOS power management daemon |
WindowServer | Display/session service |
mds/mds_stores | Spotlight indexing |
In the real troubleshooting case, the repeated clues were airportd ... systemWokenByWiFi and IOSkywalkLegacyEthernet ... en0, which pointed to Wi-Fi/network wake rather than a user app.
Scenario-Based Diagnosis
Scenario 1: Mac restarts only with external monitor connected
Likely cause:
USB-C monitor / dock / power delivery wake
Fixes:
Disable monitor USB hub
Disable monitor Ethernet
Disable USB-C always-on
Try HDMI instead of USB-C
Update monitor firmware
Try another USB-C port
Code language: PHP (php)
Scenario 2: Mac restarts only with Wi-Fi on
Likely cause:
Wi-Fi wake / network keepalive
Fixes:
sudo pmset -a tcpkeepalive 0
sudo pmset -a womp 0
sudo pmset -a powernap 0
Also:
System Settings โ Battery โ Options โ Wake for network access โ Never
Scenario 3: Mac restarts even with Wi-Fi off
Likely cause:
USB-C dock, monitor, charger, Bluetooth, or firmware-level wake
Fixes:
Test without dock
Test with direct charger
Test with HDMI
Disable Bluetooth before shutdown
Run Safe Mode
Run Apple Diagnostics
Code language: JavaScript (javascript)
Scenario 4: Mac restarts and shows crash report
Likely cause:
Kernel panic / system crash
Fixes:
Check panic logs
Remove third-party drivers
Update macOS
Run Apple Diagnostics
Check external devices
Scenario 5: Mac restarts after shutdown only recently
Likely cause:
Recent macOS update, new dock, new monitor, new login item, VPN, display driver
Code language: JavaScript (javascript)
Fixes:
Remove recent login items
Update dock/monitor firmware
Update DisplayLink if installed
Test Safe Mode
Important Warning About tcpkeepalive
When you disable TCP keepalive:
sudo pmset -a tcpkeepalive 0
macOS may warn that some features like Find My Mac may not work properly while sleeping. That is expected.
So use this setting carefully.
If you depend heavily on Find My Mac or remote access, you may want to test:
sudo pmset -a tcpkeepalive 1
But if the restart problem returns, then TCP keepalive/network wake is probably involved.
Optional: AutoBoot Setting
Some users try:
sudo nvram AutoBoot=%00
This is meant to disable automatic boot behavior on some Mac models.
To restore:
sudo nvram AutoBoot=%03
But this does not fix every MacBook Pro. In our case, it did not solve the problem, which proved that the issue was not simply Apple Silicon AutoBoot. The logs later pointed more strongly to Wi-Fi/network wake.
Recommended Final Fix Order
Use this order to avoid wasting time:
- Disable Wake for network access from System Settings.
- Run:
sudo pmset -a tcpkeepalive 0
sudo pmset -a womp 0
sudo pmset -a powernap 0
- Verify:
pmset -g | egrep "tcpkeepalive|womp|powernap"
Code language: JavaScript (javascript)
- Test shutdown normally.
- If still failing, test:
networksetup -setairportpower en0 off
sudo shutdown -h now
- If shutdown works with Wi-Fi off, the issue is confirmed as Wi-Fi/network wake.
- If shutdown still fails, investigate monitor/dock/USB-C hardware.
- If still unresolved, boot Safe Mode and run Apple Diagnostics.
Final Conclusion
When a MacBook Pro restarts immediately after clicking Shut Down, do not assume it is a normal restart or a random macOS bug. It is often a wake event triggered during shutdown.
In this case, the evidence showed:
airportd โ systemWokenByWiFi
en0 โ Wi-Fi
IOSkywalk โ Apple network stack
So the actual issue was:
Wi-Fi/network wake activity caused the Mac to power back on after shutdown.
The best practical fix is:
sudo pmset -a tcpkeepalive 0
sudo pmset -a womp 0
sudo pmset -a powernap 0
plus:
System Settings โ Battery โ Options โ Wake for network access โ Never
This gives users a clear, command-based way to identify the culprit instead of randomly unplugging monitors, guessing apps, or getting frustrated.
Iโm a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I share tech blog at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow , and SEO strategies at Wizbrand.
Do you want to learn Quantum Computing?
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at WIZBRAND
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services โ all in one place.
Explore Hospitals