pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
mackerel-agent and plugins: add RCD_SCRIPT. remove hyphen
Module Name: pkgsrc-wip
Committed By: miwarin <miwarin%gmail.com@localhost>
Pushed By: miwarin
Date: Tue Feb 13 23:51:29 2018 +0900
Changeset: d06d80abc9076616163ec29473948e4c47d07626
Modified Files:
mackerel-agent-plugins/Makefile
mackerel-agent-plugins/PLIST
mackerel-agent/Makefile
mackerel-agent/PLIST
Added Files:
mackerel-agent/files/mackerelagent.sh
Log Message:
mackerel-agent and plugins: add RCD_SCRIPT. remove hyphen
remove hyphen because /etc/rc.subr can't eval '-'.
(variable name can't has '-'.)
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=d06d80abc9076616163ec29473948e4c47d07626
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
mackerel-agent-plugins/Makefile | 4 +-
mackerel-agent-plugins/PLIST | 136 +++++++++++++++++-----------------
mackerel-agent/Makefile | 14 ++--
mackerel-agent/PLIST | 4 +-
mackerel-agent/files/mackerelagent.sh | 24 ++++++
5 files changed, 104 insertions(+), 78 deletions(-)
diffs:
diff --git a/mackerel-agent-plugins/Makefile b/mackerel-agent-plugins/Makefile
index e8657a13d2..b0425c18ef 100755
--- a/mackerel-agent-plugins/Makefile
+++ b/mackerel-agent-plugins/Makefile
@@ -15,13 +15,13 @@ GO_SRCPATH= github.com/mackerelio/${DISTNAME}
GOPATH= ${WRKDIR}
USE_TOOLS+= gmake perl
-INSTALLATION_DIRS+= libexec/mackerel-agent
+INSTALLATION_DIRS+= libexec/mackerelagent
do-build:
cd ${WRKSRC} && GOPATH=${GOPATH} PATH=${PATH}:${GOPATH}/bin ${MAKE_PROGRAM} build
do-install:
- ${INSTALL_PROGRAM} ${WRKSRC}/build/${LOWER_OPSYS}/${GOARCH}/* ${DESTDIR}${PREFIX}/libexec/mackerel-agent
+ ${INSTALL_PROGRAM} ${WRKSRC}/build/${LOWER_OPSYS}/${GOARCH}/* ${DESTDIR}${PREFIX}/libexec/mackerelagent
.include "../../lang/go/go-package.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/mackerel-agent-plugins/PLIST b/mackerel-agent-plugins/PLIST
old mode 100755
new mode 100644
index addd520b97..c9b3e74f79
--- a/mackerel-agent-plugins/PLIST
+++ b/mackerel-agent-plugins/PLIST
@@ -1,69 +1,69 @@
@comment $NetBSD$
-libexec/mackerel-agent/mackerel-plugin-accesslog
-libexec/mackerel-agent/mackerel-plugin-apache2
-libexec/mackerel-agent/mackerel-plugin-aws-cloudfront
-libexec/mackerel-agent/mackerel-plugin-aws-dynamodb
-libexec/mackerel-agent/mackerel-plugin-aws-ec2
-libexec/mackerel-agent/mackerel-plugin-aws-ec2-cpucredit
-libexec/mackerel-agent/mackerel-plugin-aws-ec2-ebs
-libexec/mackerel-agent/mackerel-plugin-aws-elasticache
-libexec/mackerel-agent/mackerel-plugin-aws-elasticsearch
-libexec/mackerel-agent/mackerel-plugin-aws-elb
-libexec/mackerel-agent/mackerel-plugin-aws-kinesis-firehose
-libexec/mackerel-agent/mackerel-plugin-aws-kinesis-streams
-libexec/mackerel-agent/mackerel-plugin-aws-lambda
-libexec/mackerel-agent/mackerel-plugin-aws-rds
-libexec/mackerel-agent/mackerel-plugin-aws-rekognition
-libexec/mackerel-agent/mackerel-plugin-aws-s3-requests
-libexec/mackerel-agent/mackerel-plugin-aws-ses
-libexec/mackerel-agent/mackerel-plugin-aws-waf
-libexec/mackerel-agent/mackerel-plugin-conntrack
-libexec/mackerel-agent/mackerel-plugin-elasticsearch
-libexec/mackerel-agent/mackerel-plugin-fluentd
-libexec/mackerel-agent/mackerel-plugin-flume
-libexec/mackerel-agent/mackerel-plugin-gcp-compute-engine
-libexec/mackerel-agent/mackerel-plugin-gearmand
-libexec/mackerel-agent/mackerel-plugin-gostats
-libexec/mackerel-agent/mackerel-plugin-graphite
-libexec/mackerel-agent/mackerel-plugin-h2o
-libexec/mackerel-agent/mackerel-plugin-haproxy
-libexec/mackerel-agent/mackerel-plugin-inode
-libexec/mackerel-agent/mackerel-plugin-jmx-jolokia
-libexec/mackerel-agent/mackerel-plugin-json
-libexec/mackerel-agent/mackerel-plugin-jvm
-libexec/mackerel-agent/mackerel-plugin-linux
-libexec/mackerel-agent/mackerel-plugin-mailq
-libexec/mackerel-agent/mackerel-plugin-mcrouter
-libexec/mackerel-agent/mackerel-plugin-memcached
-libexec/mackerel-agent/mackerel-plugin-mongodb
-libexec/mackerel-agent/mackerel-plugin-multicore
-libexec/mackerel-agent/mackerel-plugin-munin
-libexec/mackerel-agent/mackerel-plugin-murmur
-libexec/mackerel-agent/mackerel-plugin-mysql
-libexec/mackerel-agent/mackerel-plugin-nginx
-libexec/mackerel-agent/mackerel-plugin-nvidia-smi
-libexec/mackerel-agent/mackerel-plugin-openldap
-libexec/mackerel-agent/mackerel-plugin-php-apc
-libexec/mackerel-agent/mackerel-plugin-php-fpm
-libexec/mackerel-agent/mackerel-plugin-php-opcache
-libexec/mackerel-agent/mackerel-plugin-plack
-libexec/mackerel-agent/mackerel-plugin-postgres
-libexec/mackerel-agent/mackerel-plugin-proc-fd
-libexec/mackerel-agent/mackerel-plugin-rabbitmq
-libexec/mackerel-agent/mackerel-plugin-rack-stats
-libexec/mackerel-agent/mackerel-plugin-redash
-libexec/mackerel-agent/mackerel-plugin-redis
-libexec/mackerel-agent/mackerel-plugin-sidekiq
-libexec/mackerel-agent/mackerel-plugin-snmp
-libexec/mackerel-agent/mackerel-plugin-solr
-libexec/mackerel-agent/mackerel-plugin-squid
-libexec/mackerel-agent/mackerel-plugin-td-table-count
-libexec/mackerel-agent/mackerel-plugin-trafficserver
-libexec/mackerel-agent/mackerel-plugin-twemproxy
-libexec/mackerel-agent/mackerel-plugin-unicorn
-libexec/mackerel-agent/mackerel-plugin-uptime
-libexec/mackerel-agent/mackerel-plugin-uwsgi-vassal
-libexec/mackerel-agent/mackerel-plugin-varnish
-libexec/mackerel-agent/mackerel-plugin-windows-process-stats
-libexec/mackerel-agent/mackerel-plugin-windows-server-sessions
-libexec/mackerel-agent/mackerel-plugin-xentop
+libexec/mackerelagent/mackerel-plugin-accesslog
+libexec/mackerelagent/mackerel-plugin-apache2
+libexec/mackerelagent/mackerel-plugin-aws-cloudfront
+libexec/mackerelagent/mackerel-plugin-aws-dynamodb
+libexec/mackerelagent/mackerel-plugin-aws-ec2
+libexec/mackerelagent/mackerel-plugin-aws-ec2-cpucredit
+libexec/mackerelagent/mackerel-plugin-aws-ec2-ebs
+libexec/mackerelagent/mackerel-plugin-aws-elasticache
+libexec/mackerelagent/mackerel-plugin-aws-elasticsearch
+libexec/mackerelagent/mackerel-plugin-aws-elb
+libexec/mackerelagent/mackerel-plugin-aws-kinesis-firehose
+libexec/mackerelagent/mackerel-plugin-aws-kinesis-streams
+libexec/mackerelagent/mackerel-plugin-aws-lambda
+libexec/mackerelagent/mackerel-plugin-aws-rds
+libexec/mackerelagent/mackerel-plugin-aws-rekognition
+libexec/mackerelagent/mackerel-plugin-aws-s3-requests
+libexec/mackerelagent/mackerel-plugin-aws-ses
+libexec/mackerelagent/mackerel-plugin-aws-waf
+libexec/mackerelagent/mackerel-plugin-conntrack
+libexec/mackerelagent/mackerel-plugin-elasticsearch
+libexec/mackerelagent/mackerel-plugin-fluentd
+libexec/mackerelagent/mackerel-plugin-flume
+libexec/mackerelagent/mackerel-plugin-gcp-compute-engine
+libexec/mackerelagent/mackerel-plugin-gearmand
+libexec/mackerelagent/mackerel-plugin-gostats
+libexec/mackerelagent/mackerel-plugin-graphite
+libexec/mackerelagent/mackerel-plugin-h2o
+libexec/mackerelagent/mackerel-plugin-haproxy
+libexec/mackerelagent/mackerel-plugin-inode
+libexec/mackerelagent/mackerel-plugin-jmx-jolokia
+libexec/mackerelagent/mackerel-plugin-json
+libexec/mackerelagent/mackerel-plugin-jvm
+libexec/mackerelagent/mackerel-plugin-linux
+libexec/mackerelagent/mackerel-plugin-mailq
+libexec/mackerelagent/mackerel-plugin-mcrouter
+libexec/mackerelagent/mackerel-plugin-memcached
+libexec/mackerelagent/mackerel-plugin-mongodb
+libexec/mackerelagent/mackerel-plugin-multicore
+libexec/mackerelagent/mackerel-plugin-munin
+libexec/mackerelagent/mackerel-plugin-murmur
+libexec/mackerelagent/mackerel-plugin-mysql
+libexec/mackerelagent/mackerel-plugin-nginx
+libexec/mackerelagent/mackerel-plugin-nvidia-smi
+libexec/mackerelagent/mackerel-plugin-openldap
+libexec/mackerelagent/mackerel-plugin-php-apc
+libexec/mackerelagent/mackerel-plugin-php-fpm
+libexec/mackerelagent/mackerel-plugin-php-opcache
+libexec/mackerelagent/mackerel-plugin-plack
+libexec/mackerelagent/mackerel-plugin-postgres
+libexec/mackerelagent/mackerel-plugin-proc-fd
+libexec/mackerelagent/mackerel-plugin-rabbitmq
+libexec/mackerelagent/mackerel-plugin-rack-stats
+libexec/mackerelagent/mackerel-plugin-redash
+libexec/mackerelagent/mackerel-plugin-redis
+libexec/mackerelagent/mackerel-plugin-sidekiq
+libexec/mackerelagent/mackerel-plugin-snmp
+libexec/mackerelagent/mackerel-plugin-solr
+libexec/mackerelagent/mackerel-plugin-squid
+libexec/mackerelagent/mackerel-plugin-td-table-count
+libexec/mackerelagent/mackerel-plugin-trafficserver
+libexec/mackerelagent/mackerel-plugin-twemproxy
+libexec/mackerelagent/mackerel-plugin-unicorn
+libexec/mackerelagent/mackerel-plugin-uptime
+libexec/mackerelagent/mackerel-plugin-uwsgi-vassal
+libexec/mackerelagent/mackerel-plugin-varnish
+libexec/mackerelagent/mackerel-plugin-windows-process-stats
+libexec/mackerelagent/mackerel-plugin-windows-server-sessions
+libexec/mackerelagent/mackerel-plugin-xentop
diff --git a/mackerel-agent/Makefile b/mackerel-agent/Makefile
index d1981bedb1..48048ac6f0 100755
--- a/mackerel-agent/Makefile
+++ b/mackerel-agent/Makefile
@@ -21,15 +21,17 @@ MACKEREL_GROUP= mackerelagent
PKG_GROUPS= ${MACKEREL_GROUP}
PKG_USERS= ${MACKEREL_USER}:${MACKEREL_GROUP}
-INSTALLATION_DIRS+= bin share/examples/mackerel-agent
+INSTALLATION_DIRS+= bin share/examples/mackerelagent
-EGDIR= ${PREFIX}/share/examples/mackerel-agent
-CONF_FILES= ${EGDIR}/mackerel-agent.sample.conf ${PKG_SYSCONFDIR}/mackerel-agent.sample.conf
+EGDIR= ${PREFIX}/share/examples/mackerelagent
+CONF_FILES= ${EGDIR}/mackerelagent.sample.conf ${PKG_SYSCONFDIR}/mackerelagent.sample.conf
-MACKEREL_ROOTDIR= ${VARBASE}/lib/mackerel-agent
+MACKEREL_ROOTDIR= ${VARBASE}/lib/mackerelagent
MAKE_DIRS= ${MACKEREL_ROOTDIR}
MAKE_DIRS_PERMS= ${MACKEREL_ROOTDIR} ${MACKEREL_USER} ${MACKEREL_GROUP} 0755
+RCD_SCRIPTS+= mackerelagent
+
do-build:
cd ${WRKSRC} && GOPATH=${GOPATH} PATH=${PATH}:${GOPATH}/bin ${MAKE_PROGRAM} build
@@ -37,8 +39,8 @@ do-test:
cd ${WRKSRC} && GOPATH=${GOPATH} PATH=${PATH}:${GOPATH}/bin ${MAKE_PROGRAM} test
do-install:
- ${INSTALL_PROGRAM} ${WRKSRC}/build/mackerel-agent ${DESTDIR}${PREFIX}/bin
- ${INSTALL_DATA} ${WRKSRC}/mackerel-agent.sample.conf ${DESTDIR}${EGDIR}
+ ${INSTALL_PROGRAM} ${WRKSRC}/build/mackerel-agent ${DESTDIR}${PREFIX}/bin/mackerelagent
+ ${INSTALL_DATA} ${WRKSRC}/mackerel-agent.sample.conf ${DESTDIR}${EGDIR}/mackerelagent.sample.conf
.include "../../lang/go/go-package.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/mackerel-agent/PLIST b/mackerel-agent/PLIST
index 5420668200..90675af688 100644
--- a/mackerel-agent/PLIST
+++ b/mackerel-agent/PLIST
@@ -1,3 +1,3 @@
@comment $NetBSD$
-bin/mackerel-agent
-share/examples/mackerel-agent/mackerel-agent.sample.conf
+bin/mackerelagent
+share/examples/mackerelagent/mackerelagent.sample.conf
diff --git a/mackerel-agent/files/mackerelagent.sh b/mackerel-agent/files/mackerelagent.sh
new file mode 100755
index 0000000000..2f292dd2d4
--- /dev/null
+++ b/mackerel-agent/files/mackerelagent.sh
@@ -0,0 +1,24 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+#
+#
+# PROVIDE: mackerelagent
+# REQUIRE: DAEMON
+#
+# Add the following lines to /etc/rc.conf to enable this service:
+#
+# mackerelagent=YES
+
+. /etc/rc.subr
+
+name="mackerelagent"
+rcvar=$name
+command="@PREFIX@/bin/${name}"
+pidfile="@VARBASE@/run/${name}.pid"
+config="@PKG_SYSCONFDIR@/${name}.conf"
+rootdir="@VARBASE@/lib/${name}"
+command_args="supervise -conf=${config} -pidfile=${pidfile} -root=${rootdir} &"
+mackerelagent_env="PATH=$PATH:@PREFIX@/bin:@PREFIX@/libexec/${name}"
+
+load_rc_config ${name}
+run_rc_command "$1"
Home |
Main Index |
Thread Index |
Old Index