Ticket #32573: munin-initial-setup.diff

File munin-initial-setup.diff, 1.4 KB (added by raimue (Rainer Müller), 12 years ago)
  • Portfile

     
    55
    66name                munin
    77version             1.4.5
     8revision            1
    89categories          net
    910maintainers         alpha
    1011platforms           darwin
     
    7879destroot.keepdirs   ${destroot}${prefix}/var/log/munin \
    7980                    ${destroot}${prefix}/var/run/munin \
    8081                    ${destroot}${prefix}/etc/munin/plugins \
     82                    ${destroot}${prefix}/etc/munin/plugin-conf.d \
    8183                    ${destroot}${prefix}/var/munin \
    8284                    ${destroot}${prefix}/www/munin
    8385destroot.target     install-common-prime install-node-prime \
     
    133135    }
    134136}
    135137
     138post-activate {
     139    # Copy sample versions of config files into place
     140    if {![file exists ${prefix}/etc/munin/munin-node.conf]} {
     141        file copy ${prefix}/etc/munin/munin-node.conf.sample ${prefix}/etc/munin/munin-node.conf
     142    }
     143    if { [variant_isset server] } {
     144        if {![file exists ${prefix}/etc/munin/munin.conf]} {
     145            file copy ${prefix}/etc/munin/munin.conf.sample ${prefix}/etc/munin/munin.conf
     146        }
     147    }
     148}
     149
    136150notes "
    137151To detect supported Munin plugins please use the following command:
    138152
    139 sudo munin-node-configure --suggest --shell | sh
     153sudo -u munin munin-node-configure --suggest --shell | sudo sh
    140154"