added message and rc.d service script
This commit is contained in:
parent
3d9a0211fa
commit
3211e146e1
@ -37,4 +37,15 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}Jinja2>0:devel/py-Jinja2@${PY_FLAVOR} \
|
|||||||
|
|
||||||
BUILD_DEPENDS= git:devel/git
|
BUILD_DEPENDS= git:devel/git
|
||||||
|
|
||||||
|
USE_RC_SUBR= isso
|
||||||
|
|
||||||
|
PLIST_FILES= "etc/isso.conf.sample"
|
||||||
|
|
||||||
|
post-patch:
|
||||||
|
@${REINPLACE_CMD} -e 's|/etc/isso.conf|/usr/local/etc/isso.conf|g' ${WRKSRC}/isso/__init__.py
|
||||||
|
|
||||||
|
post-install:
|
||||||
|
@${MKDIR} ${STAGEDIR}${PREFIX}/etc
|
||||||
|
${CP} ${WRKSRC}/share/isso.conf ${STAGEDIR}${PREFIX}/etc/isso.conf.sample
|
||||||
|
|
||||||
.include <bsd.port.mk>
|
.include <bsd.port.mk>
|
||||||
|
|||||||
61
www/py-isso/files/isso.in
Executable file
61
www/py-isso/files/isso.in
Executable file
@ -0,0 +1,61 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# $FreeBSD$
|
||||||
|
#
|
||||||
|
# PROVIDE: isso
|
||||||
|
# REQUIRE: DAEMON
|
||||||
|
# KEYWORD: shutdown
|
||||||
|
#
|
||||||
|
# isso_enable="YES"
|
||||||
|
#
|
||||||
|
|
||||||
|
. /etc/rc.subr
|
||||||
|
|
||||||
|
name=isso
|
||||||
|
rcvar=isso_enable
|
||||||
|
desc="isso commenting service"
|
||||||
|
|
||||||
|
load_rc_config ${name}
|
||||||
|
|
||||||
|
: ${isso_enable:=NO}
|
||||||
|
: ${isso_config=/usr/local/etc/isso.conf}
|
||||||
|
|
||||||
|
logfile=/var/log/isso.log
|
||||||
|
pidfile=/var/run/isso.pid
|
||||||
|
command=/usr/local/bin/isso
|
||||||
|
start_cmd=isso_start
|
||||||
|
stop_cmd=isso_stop
|
||||||
|
procname=/usr/sbin/daemon
|
||||||
|
|
||||||
|
is_process_running="[ -f $pidfile ] && procstat $(cat $pidfile) >/dev/null 2>&1"
|
||||||
|
|
||||||
|
isso_start()
|
||||||
|
{
|
||||||
|
if is_process_running; then
|
||||||
|
echo "isso is already running (pid=$(cat $pidfile))"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
export USER=www
|
||||||
|
export HOME=$(echo ~www)
|
||||||
|
touch $logfile
|
||||||
|
chmod 640 $logfile
|
||||||
|
/usr/sbin/daemon -P $pidfile -u www /usr/local/bin/isso -c ${isso_config} run >>$logfile 2>&1
|
||||||
|
if is_process_running; then
|
||||||
|
echo "started isso (pid=$(cat $pidfile))"
|
||||||
|
else
|
||||||
|
echo "failed to start isso"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
isso_stop()
|
||||||
|
{
|
||||||
|
if is_process_running; then
|
||||||
|
local pid=$(cat $pidfile)
|
||||||
|
echo "stopping isso (pid=$pid)"
|
||||||
|
kill -- -$pid
|
||||||
|
else
|
||||||
|
echo "isso isn't running"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
run_rc_command "$1"
|
||||||
14
www/py-isso/pkg-message
Normal file
14
www/py-isso/pkg-message
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
message: <<EOM
|
||||||
|
to run isso you need to copy and customize the file isso.conf.sample
|
||||||
|
in the configuration directory /usr/local/etc to isso.conf.
|
||||||
|
EOM
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type: remove
|
||||||
|
message: <<EOM
|
||||||
|
you might want to remove /usr/local/etc/isso.conf if present.
|
||||||
|
EOM
|
||||||
|
}
|
||||||
|
]
|
||||||
Loading…
x
Reference in New Issue
Block a user