startupitems

macports at parvis.nl macports at parvis.nl
Mon Mar 26 19:17:25 UTC 2018


munin has a client/server architecture: the server runs munin-update every 5 mins by cron, the client runs munin-node permanently.

munin 1.4.7 has

for the node:
-----
startupitem.create  yes
startupitem.name    munin-node
startupitem.start   "${prefix}/sbin/munin-node"
startupitem.stop    "kill `cat ${prefix}/var/run/munin/munin-node.pid`"
-----
this works fine

for the variant +server:
-----
        # Create and symlink launchd item for munin-cron
        xinstall -d ${destroot}${prefix}/etc/LaunchDaemons/org.macports.munin-cron
        file copy ${portpath}/files/org.macports.munin-cron.plist.in \
        ${destroot}${prefix}/etc/LaunchDaemons/org.macports.munin-cron/org.macports.munin-cron.plist
        reinplace s|@PREFIX@|${prefix}|g ${destroot}${prefix}/etc/LaunchDaemons/org.macports.munin-cron/org.macports.munin-cron.plist

        xinstall -d ${destroot}/Library/LaunchDaemons
        ln -s ${prefix}/etc/LaunchDaemons/org.macports.munin-cron/org.macports.munin-cron.plist \
        ${destroot}/Library/LaunchDaemons/org.macports.munin-cron.plist

        ui_msg "###########################################################"
        ui_msg "# A startup item has been generated that will cause the"
        ui_msg "# Munin server to fetch data from all nodes every 5 mins."
        ui_msg "# It is disabled by default, please execute the following"
        ui_msg "# command to enable:"
        ui_msg "#"
        ui_msg "# sudo launchctl load -w /Library/LaunchDaemons/org.macports.munin-cron.plist"
        ui_msg "###########################################################"
---



for 1.4.7 it works:
---
DEBUG: Executing proc-post-org.macports.destroot-destroot-0
xinstall: mkdir /opt/local/var/macports/build/_usr_local_macports_munin_net_munin/munin/work/destroot/opt/local/var/run/munin
xinstall: mkdir /opt/local/var/macports/build/_usr_local_macports_munin_net_munin/munin/work/destroot/opt/local/etc/LaunchDaemons
xinstall: mkdir /opt/local/var/macports/build/_usr_local_macports_munin_net_munin/munin/work/destroot/opt/local/etc/LaunchDaemons/org.macports.munin-cron
--->  Patching org.macports.munin-cron.plist: s|@PREFIX@|/opt/local|g
DEBUG: Executing reinplace: /usr/bin/sed s|@PREFIX@|/opt/local|g </opt/local/var/macports/build/_usr_local_macports_munin_net_munin/munin/work/destroot/opt/local/etc/LaunchDaemons/org.macports.munin-cron/org.macports.munin-cron.plist >@file10
xinstall: mkdir /opt/local/var/macports/build/_usr_local_macports_munin_net_munin/munin/work/destroot/Library/LaunchDaemons
###########################################################
# A startup item has been generated that will cause the
# Munin server to fetch data from all nodes every 5 mins.
# It is disabled by default, please execute the following
# command to enable:
#
# sudo launchctl load -w /Library/LaunchDaemons/org.macports.munin-cron.plist
###########################################################
DEBUG: Executing portdestroot::destroot_finish
--->  Creating launchd control script
###########################################################
# A startup item has been generated that will aid in
# starting munin with launchd. It is disabled
# by default. Execute the following command to start it,
# and to cause it to launch at startup:
#
# sudo port load munin
###########################################################
---

for my munin2 port install fails:
---
Mar 26 20:02:38 DEBUG: Executing proc-post-org.macports.destroot-destroot-0
Mar 26 20:02:38 xinstall: mkdir /opt/mpt/var/macports/build/_usr_local_macports_munin2_net_munin/munin/work/destroot/opt/mpt/var/run/munin
Mar 26 20:02:38 xinstall: mkdir /opt/mpt/var/macports/build/_usr_local_macports_munin2_net_munin/munin/work/destroot/opt/mpt/etc/LaunchDaemons
Mar 26 20:02:38 xinstall: mkdir /opt/mpt/var/macports/build/_usr_local_macports_munin2_net_munin/munin/work/destroot/opt/mpt/etc/LaunchDaemons/org.macports.munin-cron
Mar 26 20:02:38 --->  Patching org.macports.munin-cron.plist: s|@PREFIX@|/opt/mpt|g
Mar 26 20:02:38 DEBUG: Executing reinplace: /usr/bin/sed s|@PREFIX@|/opt/mpt|g </opt/mpt/var/macports/build/_usr_local_macports_munin2_net_munin/munin/work/destroot/opt/mpt/etc/LaunchDaemons/org.macports.munin-cron/org.macports.munin-cron.plist >@file10
Mar 26 20:02:38 DEBUG: couldn't read file "/opt/mpt/var/macports/build/_usr_local_macports_munin2_net_munin/munin/work/destroot/opt/mpt/etc/LaunchDaemons/org.macports.munin-cron/org.macports.munin-cron.plist": no such file or directory
Mar 26 20:02:38     while executing
Mar 26 20:02:38 "exec -ignorestderr -- {*}$cmdline"
Mar 26 20:02:38 Error: reinplace: couldn't read file "/opt/mpt/var/macports/build/_usr_local_macports_munin2_net_munin/munin/work/destroot/opt/mpt/etc/LaunchDaemons/org.macports.munin-cron/org.macports.munin-cron.plist": no such file or directory
Mar 26 20:02:38 Error: Failed to destroot munin: reinplace sed(1) failed
Mar 26 20:02:38 DEBUG: Error code: NONE
Mar 26 20:02:38 DEBUG: Backtrace: reinplace sed(1) failed
---

Guide 5.7 StartupItems didn't help.

What do these 2 lines do ?
---
        file copy ${portpath}/files/org.macports.munin-cron.plist.in \
        ${destroot}${prefix}/etc/LaunchDaemons/org.macports.munin-cron/org.macports.munin-cron.plist

---

I have no idea where this "org.macports.munin-cron.plist.in" is supposed to be coming from.
I cannot find it in the original distribution files (didn't assume it would be there) nor anywhere ele in macports.

The only "munin-cron.in" in the distribution is "./master/_bin/munin-cron.in", and that is the script to run on Linux.

Could somebody please elaborate on startup items ?

-- 
thanks,
paul.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20180326/cd62043e/attachment-0001.html>


More information about the macports-dev mailing list