1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-27 10:03:20 +00:00

Add immortal 0.10.2, unix cross-platform (OS agnostic) supervisor.

PR:		217947
Submitted by:	nbari@tequila.io
This commit is contained in:
Vanilla I. Shu 2017-03-20 13:03:28 +00:00
parent 27d3b4848c
commit 353cfbbe61
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=436539
7 changed files with 130 additions and 0 deletions

View File

@ -452,6 +452,7 @@
SUBDIR += i2c-tools
SUBDIR += i7z
SUBDIR += iat
SUBDIR += immortal
SUBDIR += inotify-tools
SUBDIR += installwatch
SUBDIR += intel-nvmupdate

View File

@ -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>

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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