From a0c09e1df263d17a7bccc071d2820cc1f40baf9b Mon Sep 17 00:00:00 2001 From: James Date: Sun, 12 Apr 2020 20:17:29 -0500 Subject: [PATCH 1/2] Create com.xserve-frontpanel.daemon.plist By changing the "/xserve-frontpanel/hwmond" portion of this file this can be used to have the file auto load when booting an Xserve. --- com.xserve-frontpanel.daemon.plist | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 com.xserve-frontpanel.daemon.plist diff --git a/com.xserve-frontpanel.daemon.plist b/com.xserve-frontpanel.daemon.plist new file mode 100644 index 0000000..6bd980b --- /dev/null +++ b/com.xserve-frontpanel.daemon.plist @@ -0,0 +1,14 @@ + + + + + Label + com.xserve-frontpanel.daemon.plist + RunAtLoad + YES + KeepAlive + + Program + /xserve-frontpanel/hwmond + + From 2768308d6c9f4d5c9113a9e47bed31629a1ea249 Mon Sep 17 00:00:00 2001 From: James Date: Sun, 12 Apr 2020 20:30:47 -0500 Subject: [PATCH 2/2] Update README.md Add instructions for Plist usage --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.md b/README.md index 9e28fc8..70fcdcb 100644 --- a/README.md +++ b/README.md @@ -19,3 +19,34 @@ cmake . && make ```bash ./hwmond ``` + +--- +## Auto loading with Launchd +The following optional instructions will walk you through using the included plist to auto load the hwmond file at boot and keep it running while the machine is running. + +Start by editing com.xserve-frontpanel.daemon.plist + +```/xserve-frontpanel/hwmond +``` + +portion of the com.xserve-frontpanel.daemon.plist to have the location of where you have installed the file, IE. + +```/PATH-TO-HWMOND/hwmond +``` + +One you have set the path to the hwmond. Open the terminal and cd to the containing directory. Once in the directory set the permissions for the com.xserve-frontpanel.daemon.plist to 644 using the following command. + +```chmod 644 com.xserve-frontpanel.daemon.plist +``` + +Rather than physcially placing the plist into the LaunchDaemons directory it is better to create a symlink as follows, however if you prefer you can physically copy the file to the LaunchDaemons directory. + +```sudo ln -s com.xserve-frontpanel.daemon.plist /Library/LaunchDaemons/com.xserve-frontpanel.daemon.plist +``` + +You now need to load the plist into Launchd ( the process that loads and keeps stuff running ) + +```sudo launchctl load -w /Library/LaunchDaemons/com.xserve-frontpanel.daemon.plist +``` + +The “-w” part of the last command tells the computer this process has to ALWAYS run. So even if you kill the HWmond process Launchd will start it back up. This ensure the front panel lights stay functional as long as the system is running.