void Daemon::create() { createPidfile(); detachFromParent(); savePidToPidfile(); changeWorkingDirectory(); closeStandardFileDescriptors(); openNewFileDescriptors(); }
void FileNVRAM::stop(IOService *provider) { // OSSafeReleaseNULL(mFilePath); if (mTimer) { mTimer->cancelTimeout(); getWorkLoop()->removeEventSource(mTimer); OSSafeReleaseNULL(mTimer); } if (mCommandGate) { getWorkLoop()->removeEventSource(mCommandGate); } PMstop(); LOG(NOTICE, "Stop called, attempting to detachFromParent\n"); IORegistryEntry* root = IORegistryEntry::fromPath("/", gIODTPlane); detachFromParent(root, gIODTPlane); LOG(NOTICE, "Stop has passed the detach point.. move along now\n"); }