pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/net/arti
Module Name: pkgsrc
Committed By: nikita
Date: Thu Mar 9 18:19:40 UTC 2023
Modified Files:
pkgsrc/net/arti: Makefile
pkgsrc/net/arti/files: arti.in
Log Message:
arti: make rc service use daemonize, fix it.
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 pkgsrc/net/arti/Makefile
cvs rdiff -u -r1.2 -r1.3 pkgsrc/net/arti/files/arti.in
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/net/arti/Makefile
diff -u pkgsrc/net/arti/Makefile:1.3 pkgsrc/net/arti/Makefile:1.4
--- pkgsrc/net/arti/Makefile:1.3 Thu Mar 2 07:49:22 2023
+++ pkgsrc/net/arti/Makefile Thu Mar 9 18:19:40 2023
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.3 2023/03/02 07:49:22 nikita Exp $
+# $NetBSD: Makefile,v 1.4 2023/03/09 18:19:40 nikita Exp $
PKGNAME= arti-1.1.2
DISTNAME= arti-arti-v${PKGVERSION_NOREV}
+PKGVERSION= 1
CATEGORIES= net
# TODO: modify gitlab fetch to allow hosted gitlab instances
MASTER_SITES= https://gitlab.torproject.org/tpo/core/arti/-/archive/arti-v${PKGVERSION_NOREV}/
@@ -46,6 +47,10 @@ MAKE_ENV+= OPENSSL_DIR=${BUILDLINK_PREF
INSTALLATION_DIRS= ${EGDIR}
+.if ${INIT_SYSTEM} == "rc.d"
+DEPENDS+= daemonize-[0-9]*:../../sysutils/daemonize
+.endif
+
# TODO: as well as this...
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/target/release/${PKGBASE} ${DESTDIR}${PREFIX}/bin
Index: pkgsrc/net/arti/files/arti.in
diff -u pkgsrc/net/arti/files/arti.in:1.2 pkgsrc/net/arti/files/arti.in:1.3
--- pkgsrc/net/arti/files/arti.in:1.2 Wed Mar 8 22:28:07 2023
+++ pkgsrc/net/arti/files/arti.in Thu Mar 9 18:19:40 2023
@@ -1,6 +1,6 @@
#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: arti.in,v 1.2 2023/03/08 22:28:07 nikita Exp $
+# $NetBSD: arti.in,v 1.3 2023/03/09 18:19:40 nikita Exp $
#
# PROVIDE: arti
# REQUIRE: DAEMON NETWORKING
@@ -16,35 +16,34 @@ then
fi
name="arti"
-rcvar=$name
-command="@PREFIX@/bin/${name}"
-command_args="proxy --config @PKG_SYSCONFDIR@/${name}.toml"
+rcvar=${name}
+command="@PREFIX@/sbin/daemonize"
+procname="@PREFIX@/bin/${name}"
+proc_args="proxy --config @PKG_SYSCONFDIR@/${name}.toml"
required_files="@PKG_SYSCONFDIR@/${name}.toml"
-start_cmd="arti_start"
-stop_cmd="arti_stop"
pidfile="@PKG_HOME@/${name}.pid"
-restart_cmd="arti_stop ; arti_start"
-extra_commands="reload"
-arti_env="PATH=${PATH} HOME=@PKG_HOME@ USER=@ARTI_USER@"
+start_precmd="arti_precmd"
+command_args="${command_args} -p ${pidfile}"
+command_args="${command_args} -o @PKG_HOME@/log/stdout.log"
+command_args="${command_args} -e @PKG_HOME@/log/stderr.log"
+command_args="${command_args} -u @ARTI_USER@"
+command_args="${command_args} -E HOME=@PKG_HOME@"
+command_args="${command_args} ${procname} ${proc_args}"
-# FIXME: This does not detach to the background.
-arti_start ()
+arti_precmd()
{
- @ECHO@ "Starting ${name}."
- doit="@SU@ -m @ARTI_USER@ -c '${arti_env} ${command} ${command_args}'"
- eval $doit
+ if [ ! -d @PKG_HOME@/log ]; then
+ @MKDIR@ @PKG_HOME@/log
+ @CHMOD@ 0750 @PKG_HOME@/log
+ @CHOWN@ @ARTI_USER@:@ARTI_GROUP@ @PKG_HOME@/log
+ fi
+ if [ -f @PKG_HOME@/log/stdout.log ]; then
+ @CHOWN@ @ARTI_USER@:@ARTI_GROUP@ @PKG_HOME@/log/stdout.log
+ fi
+ if [ -f @PKG_HOME@/log/stderr.log ]; then
+ @CHOWN@ @ARTI_USER@:@ARTI_GROUP@ @PKG_HOME@/log/stderr.log
+ fi
}
-arti_stop()
-{
- echo "Stopping ${name}."
- kill `cat ${pidfile}` 2>/dev/null
-}
-
-if [ -f /etc/rc.subr -a -f /etc/rc.conf -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]
-then
- load_rc_config $name
- run_rc_command "$1"
-else
- eval ${start_cmd}
-fi
+load_rc_config $name
+run_rc_command "$1"
Home |
Main Index |
Thread Index |
Old Index