notifyd [-no_restart] [-no_startup] [-shm_pages integer ]
The notification server for the API described in the notify(3) manpage . (Use man 3 notify to display this page.) Using the API, processes may post notifications associated with arbitrary names , and other processes can register to be informed of such notification events. (A name should follow the convention used for Java classes: the reversed DNS domain name associated with the responsible organization, followed by one or more segments; for example, com.apple.system.timezone .) notifyd sets up the shared memory used for the notify_register_check call, and directly answers notify_check requests for other notification methods (signal, Mach port, and file descriptor).
notifyd also reads a configuration file, /etc/notify.conf . Each line begins with one of two keywords: reserve or monitor . The reserve keyword lays out access restrictions for portions of the namespace. The arguments are a name, a user and a group that "owns" the name, and a set of read /write permissions for the user , the group, and others, similar to those applied to files. For example, the following line:
reserve com.apple.system. 0 0 rwr-r-
states that any names starting with com.apple.system. are owned by UID 0 ( root ) and GID 0 ( wheel ), and that anyone can receive notifications for these names, but only root (the owner) can post notifications.
The monitor keyword takes a name and a filename as arguments. When the specified file is changed, a notification is posted for the name. For example, the following line from the stock /etc/notify.conf can be used by processes wishing to keep track of time zone changes:
monitor com.apple.system.timezone /etc/localtime
Another use would be to monitor changes to a daemon's configuration file. When the file is changed, the daemon or another process could receive notification and cause the daemon to automatically reread the configuration.
notifyd is started as a bootstrap daemon, from /etc/mach_init.d/notifyd. plist ( processed by register_mach_bootstrap_servers ). It responds to HUP or TERM signals by restarting (unless the - no_restart flag was used), thus rereading /etc/notify.conf . Before notifyd exits, it sends notifications for all registered names; after it restarts, processes registered for notifications must register again, as their tokens become invalid.
Disables automatic restart. Normally, if notifyd is killed , it's restarted within a few seconds.
Apparently prevents notifyd from issuing notifications, while using all available CPU time. The purpose of this option is unknown.
Specifies the number of pages (i.e., units of 4096 bytes) to reserve for shared memory (although it appears to use about twice that). Defaults to 1 .