Inter-Process Networking
Power Manager consists of a collection of processes. These processes include the Power Manager application, the Scheduler, and per-user assistants.
These processes need to find and talk to each other. This section discusses how this communication works.
On Start Up
The Scheduler is launched and kept running using a macOS launchd job stored in /Library/LaunchDaemons; list Power Manager’s launchd jobs with the command:
sudo launchctl list | grep uk\.co\.dssw\.powermanager
The Scheduler uses TCP/IP and UNIX domain sockets for networking. By default, TCP/IP socket ports are assigned by macOS to avoid conflicting with other processes. Only connections originating on the same computer are accepted (local host only). You can use the lsof tool to list Power Manager’s sockets with the command:
sudo lsof -i | grep uk\.co
Service Discovery
When the Power Manager application or another process needs to talk to the Scheduler, the following steps are performed.
- The Scheduler provides a notary service at a known UNIX domain socket.
- The connecting application uses the notary service to authenticate and obtain a Scheduler TCP/IP address.
You can query the notary using the nc tool with the command:
echo "{}" | nc -U /var/tmp/uk.co.dssw.powermanager/notary
Troubleshooting
If you are having problems connecting to the Scheduler, see Scheduler Unreachable.