Rename de.barton.nagcollect to de.barton.nagcollect.plist
authorAlexander Barton <alex@barton.de>
Mon, 5 Sep 2011 13:15:42 +0000 (15:15 +0200)
committerAlexander Barton <alex@barton.de>
Mon, 5 Sep 2011 13:15:42 +0000 (15:15 +0200)
The file extension ".plist" is required for LaunchDaemon configuration
files, so rename de.barton.nagcollect to de.barton.nagcollect.plist.

But we have to handle the old name as well to ease upgrades ...

client/lib/de.barton.nagcollect [deleted file]
client/lib/de.barton.nagcollect.plist [new file with mode: 0644]
contrib/Makefile.Darwin
contrib/NagCollect.pmdoc/04de.xml
contrib/launch-osx.sh
contrib/setup-osx.sh

diff --git a/client/lib/de.barton.nagcollect b/client/lib/de.barton.nagcollect
deleted file mode 100644 (file)
index 2ce97e5..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<?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>de.barton.nagcollect</string>
-       <key>Program</key>
-       <string>/usr/local/sbin/nagcollect</string>
-       <key>Nice</key>
-       <integer>5</integer>
-       <key>RunAtLoad</key>
-       <true/>
-       <key>StartInterval</key>
-       <integer>900</integer>
-</dict>
-</plist>
diff --git a/client/lib/de.barton.nagcollect.plist b/client/lib/de.barton.nagcollect.plist
new file mode 100644 (file)
index 0000000..2ce97e5
--- /dev/null
@@ -0,0 +1,16 @@
+<?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>de.barton.nagcollect</string>
+       <key>Program</key>
+       <string>/usr/local/sbin/nagcollect</string>
+       <key>Nice</key>
+       <integer>5</integer>
+       <key>RunAtLoad</key>
+       <true/>
+       <key>StartInterval</key>
+       <integer>900</integer>
+</dict>
+</plist>
index cc516d5df7a26d732ce8aec609aa0b5ecc77be20..f82cbd2afeaa32a5cb56d1484e43db6400d02d02 100644 (file)
@@ -1,16 +1,23 @@
 #
 # NagCollect -- Nagios Data Collector for Passive Checks
 #
 # NagCollect -- Nagios Data Collector for Passive Checks
-# Copyright (c)2009 Alexander Barton, alex@barton.de
+# Copyright (c)2009,2011 Alexander Barton, alex@barton.de
 #
 
 install-client:
        [ -r /Library/LaunchDaemons/de.barton.nagcollect ] \
 #
 
 install-client:
        [ -r /Library/LaunchDaemons/de.barton.nagcollect ] \
-               && launchctl unload -w /Library/LaunchDaemons/de.barton.nagcollect \
+               && launchctl unload -w \
+                       /Library/LaunchDaemons/de.barton.nagcollect \
                || true
                || true
+       rm -f /Library/LaunchDaemons/de.barton.nagcollect
+       [ -r /Library/LaunchDaemons/de.barton.nagcollect.plist ] \
+               && launchctl unload -w \
+                       /Library/LaunchDaemons/de.barton.nagcollect.plist \
+               || true
+       rm -f /Library/LaunchDaemons/de.barton.nagcollect.plist
        install -d -o 0 -g 0 -m 755 /Library/LaunchDaemons
        install -d -o 0 -g 0 -m 755 /Library/LaunchDaemons
-       install -c -o 0 -g 0 -m 644 -p client/lib/de.barton.nagcollect \
-               /Library/LaunchDaemons/de.barton.nagcollect
-       launchctl load -w /Library/LaunchDaemons/de.barton.nagcollect
+       install -c -o 0 -g 0 -m 644 -p client/lib/de.barton.nagcollect.plist \
+               /Library/LaunchDaemons/de.barton.nagcollect.plist
+       launchctl load -w /Library/LaunchDaemons/de.barton.nagcollect.plist
 
 .PHONY: install-client
 
 
 .PHONY: install-client
 
index ada35b58d4701b014e8848d7be49f68d9a31d053..4b3f53a0eceb244293ee7bafcef6a7d2d99c41ec 100644 (file)
@@ -1 +1 @@
-<pkgref spec="1.12" uuid="93FCFF65-282E-4131-B4AC-6FC1345FF6F8"><config><identifier>de.barton.nagcollectClient.launchscript.pkg</identifier><version>1</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true">../client/lib/de.barton.nagcollect</installFrom><installTo mod="true">/Library/LaunchDaemons</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>scripts.preinstall.path</mod><mod>scripts.postflight.path</mod><mod>installTo</mod><mod>scripts.postinstall.path</mod><mod>scripts.preflight.isRelativeType</mod><mod>installFrom.isRelativeType</mod><mod>scripts.postflight.isRelativeType</mod><mod>version</mod><mod>parent</mod><mod>scripts.preupgrade.path</mod><mod>identifier</mod><mod>scripts.postupgrade.path</mod><mod>requireAuthorization</mod><mod>scripts.preflight.path</mod><mod>extraFiles</mod><mod>installTo.path</mod></config><scripts><preinstall relative="true" mod="true">setup-osx.sh</preinstall><postinstall relative="true" mod="true">launch-osx.sh</postinstall><preupgrade relative="true" mod="true">setup-osx.sh</preupgrade><postupgrade relative="true" mod="true">launch-osx.sh</postupgrade></scripts><contents><file-list>04de-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents><extra-files/></pkgref>
\ No newline at end of file
+<pkgref spec="1.12" uuid="93FCFF65-282E-4131-B4AC-6FC1345FF6F8"><config><identifier>de.barton.nagcollectClient.launchscript.pkg</identifier><version>1</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true">../client/lib/de.barton.nagcollect.plist</installFrom><installTo mod="true">/Library/LaunchDaemons</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>scripts.preinstall.path</mod><mod>scripts.postflight.path</mod><mod>installTo</mod><mod>scripts.postinstall.path</mod><mod>scripts.preflight.isRelativeType</mod><mod>installFrom.isRelativeType</mod><mod>scripts.postflight.isRelativeType</mod><mod>version</mod><mod>parent</mod><mod>scripts.preupgrade.path</mod><mod>identifier</mod><mod>scripts.postupgrade.path</mod><mod>requireAuthorization</mod><mod>scripts.preflight.path</mod><mod>extraFiles</mod><mod>installTo.path</mod></config><scripts><preinstall relative="true" mod="true">setup-osx.sh</preinstall><postinstall relative="true" mod="true">launch-osx.sh</postinstall><preupgrade relative="true" mod="true">setup-osx.sh</preupgrade><postupgrade relative="true" mod="true">launch-osx.sh</postupgrade></scripts><contents><file-list>04de-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents><extra-files/></pkgref>
index dd75800583d70f7b7e263dd6ac7312acc19b6adc..75f0802a0898687f40ab01017a2405103aad035c 100755 (executable)
@@ -1,13 +1,15 @@
 #!/bin/sh
 #
 # NagCollect -- Nagios Data Collector for Passive Checks
 #!/bin/sh
 #
 # NagCollect -- Nagios Data Collector for Passive Checks
-# Copyright (c)2009 Alexander Barton, alex@barton.de
+# Copyright (c)2009,2011 Alexander Barton, alex@barton.de
 #
 logger -t "launch-osx.sh" -s "starting ..."
 [ -r /usr/local/etc/nagcollect.conf ] && . /usr/local/etc/nagcollect.conf
 if [ -n "$SERVER_URL" -a -n "$CLIENT_KEY" -a -n "$CLIENT_ID" ]; then
        logger -t "launch-osx.sh" -s "Configuration valid, loading LaunchDaemon script ..."
 #
 logger -t "launch-osx.sh" -s "starting ..."
 [ -r /usr/local/etc/nagcollect.conf ] && . /usr/local/etc/nagcollect.conf
 if [ -n "$SERVER_URL" -a -n "$CLIENT_KEY" -a -n "$CLIENT_ID" ]; then
        logger -t "launch-osx.sh" -s "Configuration valid, loading LaunchDaemon script ..."
-       launchctl load -w /Library/LaunchDaemons/de.barton.nagcollect
+       chown root:wheel /Library/LaunchDaemons/de.barton.nagcollect.plist
+       chmod 644 /Library/LaunchDaemons/de.barton.nagcollect.plist
+       launchctl load -w /Library/LaunchDaemons/de.barton.nagcollect.plist
 else
        logger -t "launch-osx.sh" -s "Configuration not valid, NOT LOADING LaunchDaemon script!"
 fi
 else
        logger -t "launch-osx.sh" -s "Configuration not valid, NOT LOADING LaunchDaemon script!"
 fi
index 98db9284122c35093e236a3502aabcec702eb68a..9e8bcc653d5564de7749d18e2b34ff5329f66eb3 100755 (executable)
@@ -1,9 +1,13 @@
 #!/bin/sh
 #
 # NagCollect -- Nagios Data Collector for Passive Checks
 #!/bin/sh
 #
 # NagCollect -- Nagios Data Collector for Passive Checks
-# Copyright (c)2009 Alexander Barton, alex@barton.de
+# Copyright (c)2009,2011 Alexander Barton, alex@barton.de
 #
 logger -t "setup-osx.sh" -s "starting ..."
 [ -r /Library/LaunchDaemons/de.barton.nagcollect ] \
        && launchctl unload -w /Library/LaunchDaemons/de.barton.nagcollect
 #
 logger -t "setup-osx.sh" -s "starting ..."
 [ -r /Library/LaunchDaemons/de.barton.nagcollect ] \
        && launchctl unload -w /Library/LaunchDaemons/de.barton.nagcollect
+rm -f /Library/LaunchDaemons/de.barton.nagcollect
+[ -r /Library/LaunchDaemons/de.barton.nagcollect.plist ] \
+       && launchctl unload -w /Library/LaunchDaemons/de.barton.nagcollect.plist
+rm -f /Library/LaunchDaemons/de.barton.nagcollect.plist
 logger -t "setup-osx.sh" -s "done."
 logger -t "setup-osx.sh" -s "done."