[30042] trunk/dports/net/nedi/Portfile
source_changes at macosforge.org
source_changes at macosforge.org
Thu Oct 18 16:44:54 PDT 2007
Revision: 30042
http://trac.macosforge.org/projects/macports/changeset/30042
Author: markd at macports.org
Date: 2007-10-18 16:44:51 -0700 (Thu, 18 Oct 2007)
Log Message:
-----------
Startupitem and variable tweaks.
Modified Paths:
--------------
trunk/dports/net/nedi/Portfile
Modified: trunk/dports/net/nedi/Portfile
===================================================================
--- trunk/dports/net/nedi/Portfile 2007-10-18 22:33:10 UTC (rev 30041)
+++ trunk/dports/net/nedi/Portfile 2007-10-18 23:44:51 UTC (rev 30042)
@@ -4,9 +4,9 @@
name nedi
version 1.0.w
-revision 5
+revision 6
categories net
-maintainers markd at macports.org
+maintainers markd
platforms darwin
description Network Discovery Suite
@@ -41,9 +41,16 @@
# variant in the mysql5 port in cases where mysql5 was not already installed.
}
+# Set some useful variables
+set nedidir ${prefix}/share/
+set nedimonitorbin ${prefix}/share/${name}/moni.pl
+set nedimonitorpid ${prefix}/var/run/${startupitem.name}.pid
+
startupitem.create yes
startupitem.name nedimonitor
-startupitem.start "${prefix}/share/${name}/moni.pl"
+startupitem.pidfile manual "${prefix}/var/run/${startupitem.name}.pid"
+startupitem.start "\[ -x \${nedimonitorbin} \] && \${nedimonitorbin} &; echo \$! > \${nedimonitorpid}"
+startupitem.stop "\[ -r \${nedimonitorpid} \] && /bin/kill \$(cat \${nedimonitorpid})"
use_configure no
patch {}
@@ -55,7 +62,6 @@
}
destroot {
- set nedidir ${prefix}/share/
xinstall -m 755 -d ${destroot}${nedidir}
system "cp -R ${worksrcpath} ${destroot}${nedidir}"
}
@@ -94,6 +100,9 @@
file rename ${destroot}${prefix}/share/${name}/nedi.conf \
${destroot}${prefix}/share/${name}/nedi.conf.sample
system "chmod 600 ${destroot}${prefix}/share/${name}/nedi.conf.sample"
+
+# Create a file to hold moni.pl's PID
+system "touch ${destroot}${prefix}/var/run/${startupitem.name}.pid"
}
pre-install {
@@ -155,9 +164,9 @@
4) Configure NeDi, initialize database, and Login to NeDi
-----------------------------------------------
--Set NeDi owner: sudo chown -R <nedi-user>:<nedi-group> ${prefix}/share/${name}/
--Apache symlink: ln -s ${prefix}/share/${name}/html/ ${prefix}/apache2/htdocs/nedi
--Edit nedi.conf Backend/Authen/Device Access sections: sudo pico ${prefix}/share/${name}/nedi.conf
+-Set NeDi owner: sudo chown -R <nedi-user>:<nedi-group> ${nedidir}${name}/
+-Apache symlink: ln -s ${nedidir}${name}/html/ ${prefix}/apache2/htdocs/nedi
+-Edit nedi.conf Backend/Authen/Device Access sections: sudo pico ${nedidir}${name}/nedi.conf
Leave nedi.conf permissions at 600 to protect your network passwords!
backend MSQ
dbpass <nedidb-password>
@@ -194,7 +203,7 @@
-Make any other desired changes in nedi.conf
-Start NeDi data collection:
- cd ${prefix}/share/${name}/nedi.pl
+ cd ${nedidir}${name}
sudo -u <nedi-user> nedi.pl -c -d (debug)
-Put a command in the crontab to discover your network at regular intervals.
A typical interval is 1 hour; to get accurate NeDi rrdtool graphs at
@@ -202,7 +211,7 @@
Otherwise, you must adjust NeDi's default rrdtool settings. To run
NeDi every hour, the cron entry is:
-0 * * * * cd ${prefix}/share/${name} ; ./nedi.pl -c >> /dev/null 2>&1
+0 * * * * cd ${nedidir}${name} ; ./nedi.pl -c >> /dev/null 2>&1
6) Set NeDi to receive device alerts, syslogs, and SNMP traps. (optional)
@@ -218,7 +227,7 @@
-To enable the NeDi SNMP trap receiver, first use the snmpconf Unix utility to create an
snmptrapd.conf file with the entry:
- traphandle default ${prefix}/share/nedi/trap.pl
+ traphandle default ${nedidir}${name}/trap.pl
Then load the startup script to run the Unix snmptrapd daemon:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071018/91153d64/attachment.html
More information about the macports-changes
mailing list