aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/immortal/Makefile47
-rw-r--r--sysutils/immortal/distinfo15
-rw-r--r--sysutils/immortal/files/immortaldir.in37
-rw-r--r--sysutils/immortal/files/www.yml10
-rw-r--r--sysutils/immortal/pkg-descr13
-rw-r--r--sysutils/immortal/pkg-plist7
7 files changed, 130 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index 64c8af4757d7..b2c7d4bf3f74 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -452,6 +452,7 @@
SUBDIR += i2c-tools
SUBDIR += i7z
SUBDIR += iat
+ SUBDIR += immortal
SUBDIR += inotify-tools
SUBDIR += installwatch
SUBDIR += intel-nvmupdate
diff --git a/sysutils/immortal/Makefile b/sysutils/immortal/Makefile
new file mode 100644
index 000000000000..09e424a491f3
--- /dev/null
+++ b/sysutils/immortal/Makefile
@@ -0,0 +1,47 @@
+# $FreeBSD$
+
+PORTNAME= immortal
+PORTVERSION= 0.10.2
+CATEGORIES= sysutils
+
+MAINTAINER= nbari@tequila.io
+COMMENT= Unix cross-platform (OS agnostic) supervisor
+
+LICENSE= BSD3CLAUSE
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+USE_RC_SUBR= immortaldir
+USES= go
+USE_GITHUB= yes
+GH_TUPLE= immortal:logrotate:3691ab5:logrotate/src/github.com/immortal/logrotate \
+ immortal:multiwriter:2555774:multiwriter/src/github.com/immortal/multiwriter \
+ immortal:natcasesort:69368b7:natcasesort/src/github.com/immortal/natcasesort \
+ immortal:xtime:fb1aca1:xtime/src/github.com/immortal/xtime \
+ nbari:violetear:502d8b0:nbari/src/github.com/nbari/violetear \
+ go-yaml:yaml:v2:yaml/src/gopkg.in/yaml.v2
+GH_SUBDIR= src/github.com/${PORTNAME}/${PORTNAME}
+
+STRIP= # stripping can break go binaries
+
+do-build:
+ @cd ${WRKSRC}/src/github.com/${GH_ACCOUNT}/${GH_PROJECT}; \
+ ${SETENV} ${BUILD_ENV} GOPATH=${WRKSRC} go build -ldflags \
+ "-X main.version=${PORTVERSION}" -o immortal cmd/immortal/main.go;
+ @cd ${WRKSRC}/src/github.com/${GH_ACCOUNT}/${GH_PROJECT}; \
+ ${SETENV} ${BUILD_ENV} GOPATH=${WRKSRC} go build -ldflags \
+ "-X main.version=${PORTVERSION}" -o immortalctl cmd/immortalctl/main.go;
+ @cd ${WRKSRC}/src/github.com/${GH_ACCOUNT}/${GH_PROJECT}; \
+ ${SETENV} ${BUILD_ENV} GOPATH=${WRKSRC} go build -ldflags \
+ "-X main.version=${PORTVERSION}" -o immortaldir cmd/immortaldir/main.go;
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/src/github.com/immortal/immortal/immortal ${STAGEDIR}${PREFIX}/bin/immortal
+ ${INSTALL_PROGRAM} ${WRKSRC}/src/github.com/immortal/immortal/immortalctl ${STAGEDIR}${PREFIX}/bin/immortalctl
+ ${INSTALL_PROGRAM} ${WRKSRC}/src/github.com/immortal/immortal/immortaldir ${STAGEDIR}${PREFIX}/bin/immortaldir
+ ${INSTALL_MAN} ${WRKSRC}/src/github.com/immortal/immortal/man/*.8 ${STAGEDIR}${MAN8PREFIX}/man/man8/
+
+post-install:
+ @${MKDIR} ${STAGEDIR}${ETCDIR}
+ ${INSTALL_DATA} ${FILESDIR}/www.yml ${STAGEDIR}${ETCDIR}/www.yml.sample
+
+.include <bsd.port.mk>
diff --git a/sysutils/immortal/distinfo b/sysutils/immortal/distinfo
new file mode 100644
index 000000000000..a663856d813e
--- /dev/null
+++ b/sysutils/immortal/distinfo
@@ -0,0 +1,15 @@
+TIMESTAMP = 1490011379
+SHA256 (immortal-immortal-0.10.2_GH0.tar.gz) = ff9db09bbc34f0554ef8971fc95ccbe83035e439d7796b32ad305970a1490115
+SIZE (immortal-immortal-0.10.2_GH0.tar.gz) = 27238
+SHA256 (immortal-logrotate-3691ab5_GH0.tar.gz) = 1e9915e41e05e43be206fa5da0ca9646feea36e8433c953fc71d7ebc6d40d8d5
+SIZE (immortal-logrotate-3691ab5_GH0.tar.gz) = 3612
+SHA256 (immortal-multiwriter-2555774_GH0.tar.gz) = 0988932d02debf79c7928e307a812027b642da7e5cad8846604577ed56220d57
+SIZE (immortal-multiwriter-2555774_GH0.tar.gz) = 3060
+SHA256 (immortal-natcasesort-69368b7_GH0.tar.gz) = d05843a6bb7429ebe0e62f34ff3e75fa19327eea810f60d335a345ea9411f9e5
+SIZE (immortal-natcasesort-69368b7_GH0.tar.gz) = 2581
+SHA256 (immortal-xtime-fb1aca1_GH0.tar.gz) = b6d7b321e2feca0ec66d19e4b2feea0be88fc2b7db31e43b7f68d6f74f1a2753
+SIZE (immortal-xtime-fb1aca1_GH0.tar.gz) = 1104
+SHA256 (nbari-violetear-502d8b0_GH0.tar.gz) = 26b1bbb59ddeb5bb82a317c6a754ab6dad0a68152612e8eaaac17f3b7dacaaf2
+SIZE (nbari-violetear-502d8b0_GH0.tar.gz) = 16272
+SHA256 (go-yaml-yaml-v2_GH0.tar.gz) = 4f214b08f5ad89644bec631ca47e20ba7c1474845731925f3b38d1ecca9cca67
+SIZE (go-yaml-yaml-v2_GH0.tar.gz) = 60702
diff --git a/sysutils/immortal/files/immortaldir.in b/sysutils/immortal/files/immortaldir.in
new file mode 100644
index 000000000000..9d98449cb041
--- /dev/null
+++ b/sysutils/immortal/files/immortaldir.in
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: immortaldir
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add these lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# immortaldir_enable (bool): Set it to "YES" to enable immortaldir
+# Default is "NO"
+#
+# immortaldir_path (str): Set the directory that will be scanned
+# Default is "/usr/local/etc/immortal"
+
+. /etc/rc.subr
+
+name=immortaldir
+rcvar=immortaldir_enable
+
+load_rc_config $name
+
+: ${immortaldir_path=%%PREFIX%%/etc/immortal}
+
+command=%%PREFIX%%/bin/${name}
+command_args=${immortaldir_path}
+start_cmd=immortaldir_run
+
+immortaldir_run()
+{
+ PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"
+ /usr/sbin/daemon -c /bin/sh -c "$command $immortaldir_path 2>&1 | logger -t immortaldir"
+}
+
+run_rc_command "$1"
diff --git a/sysutils/immortal/files/www.yml b/sysutils/immortal/files/www.yml
new file mode 100644
index 000000000000..0869f06959cd
--- /dev/null
+++ b/sysutils/immortal/files/www.yml
@@ -0,0 +1,10 @@
+# expose via web the /tmp directory by using www
+# pkg install go-www
+cmd: /usr/local/bin/www
+cwd: /tmp
+log:
+ file: /var/log/www.log
+ age: 86400 # seconds
+ num: 7 # int
+ size: 1 # MegaBytes
+user: www
diff --git a/sysutils/immortal/pkg-descr b/sysutils/immortal/pkg-descr
new file mode 100644
index 000000000000..d584ee72c602
--- /dev/null
+++ b/sysutils/immortal/pkg-descr
@@ -0,0 +1,13 @@
+A *nix cross-platform (OS agnostic) supervisor
+
+immortal runs a command or script detached from the controlling terminal
+as a Unix daemon, it will supervise and restart the service if it has
+been terminated. The service can be controlled by querying a Unix socket
+"immortal.sock", this allows to remotely have full control over the service if
+required by exposing the socket using a web server like Nginx.
+
+immortal - Starts and monitor a service
+immortaldir - Directory to scan for services *.yml
+immortalctl - Control existing services
+
+WWW: https://immortal.run
diff --git a/sysutils/immortal/pkg-plist b/sysutils/immortal/pkg-plist
new file mode 100644
index 000000000000..79346889e3e0
--- /dev/null
+++ b/sysutils/immortal/pkg-plist
@@ -0,0 +1,7 @@
+bin/immortal
+bin/immortalctl
+bin/immortaldir
+%%ETCDIR%%/www.yml.sample
+man/man8/immortal.8.gz
+man/man8/immortalctl.8.gz
+man/man8/immortaldir.8.gz