diff options
author | ehaupt <ehaupt@FreeBSD.org> | 2019-02-19 05:52:28 +0800 |
---|---|---|
committer | ehaupt <ehaupt@FreeBSD.org> | 2019-02-19 05:52:28 +0800 |
commit | 640c62f9715906a393ffe6eaed7445d86eb49dd0 (patch) | |
tree | 078436e80bbd4e6138f36e4a382179f94788ee6a | |
parent | 971cdfbf21aea7e296c24aaa177337f80d9bd319 (diff) | |
download | freebsd-ports-gnome-640c62f9715906a393ffe6eaed7445d86eb49dd0.tar.gz freebsd-ports-gnome-640c62f9715906a393ffe6eaed7445d86eb49dd0.tar.zst freebsd-ports-gnome-640c62f9715906a393ffe6eaed7445d86eb49dd0.zip |
- Provide a startup script
- Provide a sample config
-rw-r--r-- | sysutils/digdag/Makefile | 15 | ||||
-rw-r--r-- | sysutils/digdag/files/digdag.conf.sample | 55 | ||||
-rw-r--r-- | sysutils/digdag/files/digdag.in | 37 | ||||
-rw-r--r-- | sysutils/digdag/pkg-plist | 4 |
4 files changed, 110 insertions, 1 deletions
diff --git a/sysutils/digdag/Makefile b/sysutils/digdag/Makefile index 74cc74517249..e98e5d9d993f 100644 --- a/sysutils/digdag/Makefile +++ b/sysutils/digdag/Makefile @@ -3,6 +3,7 @@ PORTNAME= digdag DISTVERSION= 0.9.33 +PORTREVISION= 1 CATEGORIES= sysutils java MASTER_SITES= https://dl.bintray.com/digdag/maven/ \ LOCAL/ehaupt @@ -14,6 +15,7 @@ COMMENT= Workload Automation System LICENSE= APACHE20 USE_JAVA= yes +USE_RC_SUBR= ${PORTNAME} JAVA_RUN= yes JAVA_VENDOR= openjdk @@ -22,7 +24,13 @@ JAVA_VERSION= 1.8+ NO_BUILD= yes NO_ARCH= yes -PLIST_SUB= VERSION=${DISTVERSION} +USERS= digdag + +SUB_LIST= PORTNAME=${PORTNAME} USERS=${USERS} JAVA=${JAVA} +PLIST_SUB= VERSION=${DISTVERSION} USERS=${USERS} + +VARLOG= /var/log/${PORTNAME} +VARRUN= /var/run/${PORTNAME} do-extract: @${MKDIR} ${WRKSRC} @@ -35,6 +43,11 @@ do-install: ${INSTALL_DATA} ${DISTDIR}/${DISTFILES} \ ${STAGEDIR}${JAVAJARDIR}/${PORTNAME}/ ${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin + ${INSTALL_DATA} ${FILESDIR}/${PORTNAME}.conf.sample \ + ${STAGEDIR}${PREFIX}/etc + + @${MKDIR} ${STAGEDIR}${VARLOG} + @${MKDIR} ${STAGEDIR}${VARRUN} cklatest: @${ECHO} "Port: ${DISTVERSION}" diff --git a/sysutils/digdag/files/digdag.conf.sample b/sysutils/digdag/files/digdag.conf.sample new file mode 100644 index 000000000000..b372d58c6660 --- /dev/null +++ b/sysutils/digdag/files/digdag.conf.sample @@ -0,0 +1,55 @@ +# In the config file, following parameters are available +# See https://docs.digdag.io/command_reference.html#server-mode-commands +# +#server.bind (ip address) +#server.port (integer) +#server.admin.bind (ip address) +#server.admin.port (integer) +#server.access-log.path (string. same with –access-log) +#server.access-log.pattern (string, “json”, “combined” or “common”) +#server.http.io-threads (number of HTTP IO threads in integer. default: available CPU cores or 2, whichever is greater) +#server.http.worker-threads (number of HTTP worker threads in integer. default: server.http.io-threads * 8) +#server.http.no-request-timeout (maximum allowed time for clients to keep a connection open without sending requests or receiving responses in seconds. default: 60) +#server.http.request-parse-timeout (maximum allowed time of reading a HTTP request in seconds. this doesn’t affect on reading request body. default: 30) +#server.http.io-idle-timeout (maximum allowed idle time of reading HTTP request and writing HTTP response in seconds. default: 300) +#server.http.enable-http2 (enable HTTP/2. default: false) +#server.http.headers.KEY = VALUE (HTTP header to set on API responses) +#server.jmx.port (port to listen JMX in integer. default: JMX is disabled) +#database.type (enum, “h2” or “postgresql”) +#database.user (string) +#database.password (string) +#database.host (string) +#database.port (integer) +#database.database (string) +#database.loginTimeout (seconds in integer, default: 30) +#database.socketTimeout (seconds in integer, default: 1800) +#database.ssl (boolean, default: false) +#database.connectionTimeout (seconds in integer, default: 30) +#database.idleTimeout (seconds in integer, default: 600) +#database.validationTimeout (seconds in integer, default: 5) +#database.maximumPoolSize (integer, default: available CPU cores * 32) +#archive.type (type of project archiving, “db” or “s3”. default: “db”) +#archive.s3.endpoint (string. default: “s3.amazonaws.com”) +#archive.s3.bucket (string) +#archive.s3.path (string) +#archive.s3.credentials.access-key-id (string. default: instance profile) +#archive.s3.credentials.secret-access-key (string. default: instance profile) +#archive.s3.path-style-access (boolean. default: false) +#log-server.type (type of log storage, “local” , “null”, or “s3”. default: “null”. This parameter will be overwritten with “local” if -O, --task-log DIR is set.) +#log-server.s3.endpoint (string, default: “s3.amazonaws.com”) +#log-server.s3.bucket (string) +#log-server.s3.path (string) +#log-server.s3.direct_download (boolean. default: false) +#log-server.s3.credentials.access-key-id (string. default: instance profile) +#log-server.s3.credentials.secret-access-key (string. default: instance profile) +#log-server.s3.path-style-access (boolean. default: false) +#digdag.secret-encryption-key = (base64 encoded 128-bit AES encryption key) +#executor.task_ttl (string. default: 1d. A task is killed if it is running longer than this period.) +#executor.attempt_ttl (string. default: 7d. An attempt is killed if it is running longer than this period.) +#api.max_attempts_page_size (integer. The max number of rows of attempts in api response) +#api.max_sessions_page_size (integer. The max number of rows of sessions in api response) + +server.bind=127.0.0.1 +# generate with: +# openssl rand -base64 16 +#digdag.secret-encryption-key=<base64 key> diff --git a/sysutils/digdag/files/digdag.in b/sysutils/digdag/files/digdag.in new file mode 100644 index 000000000000..2f3301d54c48 --- /dev/null +++ b/sysutils/digdag/files/digdag.in @@ -0,0 +1,37 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: digdag +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# digdag_enable (bool): Set to NO by default. +# Set it to YES to enable it. +# digdag_user: The user account the digdag daemon runs as. +# It uses 'digdag' user by default. +# Do not sets it as empty or it will run as root. +# digdag_conf: The configuration file digdag uses. +# Default: %%PREFIX%%/etc/digdag.conf +# digdag_logfile: The log file digdag uses. +# Default: /var/log/digdag/digdag.log + +. /etc/rc.subr +name="digdag" +rcvar="${name}_enable" +load_rc_config ${name} + +: ${digdag_enable:="NO"} +: ${digdag_user:="digdag"} +: ${digdag_conf:="%%PREFIX%%/etc/digdag.conf"} +: ${digdag_logfile="/var/log/digdag/digdag.log"} + +command="/usr/sbin/daemon" +pidfile=/var/run/digdag/digdag.pid +procname="%%JAVA%%" +digdag_flags="-f -p ${pidfile} ${name} server --log ${digdag_logfile} --config ${digdag_conf}" + +run_rc_command "$1" diff --git a/sysutils/digdag/pkg-plist b/sysutils/digdag/pkg-plist index 52b6e3e190f6..d7a4da5f3de4 100644 --- a/sysutils/digdag/pkg-plist +++ b/sysutils/digdag/pkg-plist @@ -1,2 +1,6 @@ +@sample etc/digdag.conf.sample %%JAVAJARDIR%%/digdag/digdag-%%VERSION%%.jar bin/digdag +@owner %%USERS%% +@dir /var/log/digdag +@dir /var/run/digdag |