nut - 2.6.1 - launch upsmon at startup

gforeman02 gforeman02 at gmail.com
Thu Mar 1 07:47:56 PST 2012


Charles Lepple over at the nut user group sent me the following plist (modified upsmon location for macports):

<?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>Label</key>
       <string>org.networkupstools.upsmon</string>
       <key>OnDemand</key>
       <false/>
       <key>ProgramArguments</key>
       <array>
               <string>/opt/local/sbin/upsmon</string>
               <string>-D</string>
       </array>
</dict>
</plist>

Here is what I did:

1) Setup Macports
2) 'port install nut'
2)  'cp /opt/local/etc/upsmon.conf.sample /opt/local/etc/upsmon.conf'
4) update upsmon.conf as appropriate for your environment
3) add the plist to /Library/LaunchDaemons
4) REBOOT.  I found that this was the only way to get the plist to load.  I am sure there is a better way, but this was easy and worked.
5) check that the process is running with ps -ef | grep upsmon

If you see something like:

   0   148     1   0  8:17AM ??         0:00.04 /opt/local/sbin/upsmon -D
 500   250   148   0  8:18AM ??         0:00.23 /opt/local/sbin/upsmon -D

You should be good since nut is running two processes.  One is for root and the other is for the nut user installed via macports.

It would be great to have a 'nut-client' port so that those only wanting the upsmon capability can easily get up and running.

I'll do the following: submit a feature request in the bug tracker to get a 'nut-client' port and attach the plist above to it.  I am sure things get more complex when attempting to get the other daemons running, so I'll just keep things scoped to this right now.


Thanks,
Greg



On Feb 29, 2012, at 7:27 PM, Ryan Schmidt wrote:

> 
> On Feb 29, 2012, at 18:14, gforeman02 wrote:
> 
>> How can I get upsmon to launch at system start?  Is there a plist file or something included with the port?
> 
> The port does not use the startupitem keywords, so there is at least no MacPorts-created plist included. Feel free to write one yourself. If you can patch the portfile to use the startupitem keywords to create a plist, please submit a patch (in the issue tracker).
> 



More information about the macports-users mailing list