To run on start up, you can do the following. #1

Open
andreimc opened this Issue Jan 2, 2014 · 2 comments

Projects

None yet

3 participants

@andreimc
andreimc commented Jan 2, 2014

compile main.c to something like power_fixer move it to /usr/local/bin or somewhere

create a com.power_fixer.plist in /Library/LaunchDaemons with the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Program</key>
    <string>/usr/local/bin/power_fixer</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/bin/power_fixer</string>
    </array>
    <key>Label</key>
    <string>com.power_fixer</string>
    <key>UserName</key>
    <string>root</string>
    <key>GroupName</key>
    <string>daemon</string>
    <key>InitGroups</key>
    <true/>
    <key>OnDemand</key>
    <false/>
    <key>ServiceIPC</key>
    <true/>
    <key>RunAtLoad</key>
    <true/>
    <key>Umask</key>
    <integer>420</integer>
    <key>ExitTimeOut</key>
    <integer>5</integer>
    <key>Debug</key>
    <false/>
    <key>WaitForDebugger</key>
    <false/>
    <key>Disabled</key>
    <false/>
</dict>
</plist>

make sure the plist is owned by root:

do a chown root /Library/LaunchDaemons/com.power_fixer.plist

launchctl load /Library/LaunchDaemons/com.power_fixer.plist

all done, power issues gone thanks binchewer for your hard work!!!

@GurudayalKhalsa

Thanks, works for me

@keith
keith commented Jan 24, 2014

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment