pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
miniircd: Fix the rc.d script
Module Name: pkgsrc-wip
Committed By: Leonardo Taccari <leot%NetBSD.org@localhost>
Pushed By: leot
Date: Fri Sep 21 19:57:31 2018 +0200
Changeset: 35ffbc627eeeb1f47e3807a26c9b3dbb3d53cef1
Modified Files:
miniircd/Makefile
miniircd/files/miniircd.sh
Removed Files:
miniircd/TODO
Log Message:
miniircd: Fix the rc.d script
Previously only `start' worked because `command_interpreter' was
not defined but it was needed in order to parse the ps(1) output.
After adjusting that `stop' worked but left the `pidfile' around so a
`stop_postcmd' function to manually remove it was added.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=35ffbc627eeeb1f47e3807a26c9b3dbb3d53cef1
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
miniircd/Makefile | 1 +
miniircd/TODO | 2 --
miniircd/files/miniircd.sh | 7 +++++++
3 files changed, 8 insertions(+), 2 deletions(-)
diffs:
diff --git a/miniircd/Makefile b/miniircd/Makefile
index dd5504f28e..be56064412 100644
--- a/miniircd/Makefile
+++ b/miniircd/Makefile
@@ -13,6 +13,7 @@ LICENSE= gnu-gpl-v2
NO_BUILD= yes
BUILD_DEFS+= VARBASE MINIIRCD_USER MINIIRCD_GROUP MINIIRCD_DIR
+FILES_SUBST+= PYTHONBIN=${PYTHONBIN}
FILES_SUBST+= MINIIRCD_USER=${MINIIRCD_USER} MINIIRCD_GROUP=${MINIIRCD_GROUP}
FILES_SUBST+= MINIIRCD_DIR=${MINIIRCD_DIR}
diff --git a/miniircd/TODO b/miniircd/TODO
deleted file mode 100644
index e9b8c6a4e2..0000000000
--- a/miniircd/TODO
+++ /dev/null
@@ -1,2 +0,0 @@
-- Test and adjust rc.d script (there are probably some issue in the pidfile
- handling!)
diff --git a/miniircd/files/miniircd.sh b/miniircd/files/miniircd.sh
index 2ae3829507..536dac5e54 100755
--- a/miniircd/files/miniircd.sh
+++ b/miniircd/files/miniircd.sh
@@ -10,9 +10,11 @@ fi
name="miniircd"
rcvar=$name
command="@PREFIX@/sbin/miniircd"
+command_interpreter="@PYTHONBIN@"
pidfile="@VARBASE@/run/${name}/pid"
command_args="-d --pid-file=${pidfile}"
start_precmd="miniircd_precmd"
+stop_postcmd="miniircd_postcmd"
miniircd_flags=${miniircd_flags-"--setuid @MINIIRCD_USER@:@MINIIRCD_GROUP@"}
@@ -25,6 +27,11 @@ miniircd_precmd()
fi
}
+miniircd_postcmd()
+{
+ @RM@ "${pidfile}"
+}
+
if [ -f /etc/rc.subr ]; then
load_rc_config $name
run_rc_command "$1"
Home |
Main Index |
Thread Index |
Old Index