pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lpjs: Clean up rc scripts



Module Name:	pkgsrc-wip
Committed By:	Jason Bacon <bacon%NetBSD.org@localhost>
Pushed By:	outpaddling
Date:		Sun Jan 23 19:13:20 2022 -0600
Changeset:	09a61db8d7ee57cbf7f73da6cf881903c46934a8

Modified Files:
	lpjs/files/lpjs_compd.sh
	lpjs/files/lpjs_dispatchd.sh

Log Message:
lpjs: Clean up rc scripts

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=09a61db8d7ee57cbf7f73da6cf881903c46934a8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 lpjs/files/lpjs_compd.sh     | 21 ++++++++++++++++++---
 lpjs/files/lpjs_dispatchd.sh | 21 ++++++++++++++++++---
 2 files changed, 36 insertions(+), 6 deletions(-)

diffs:
diff --git a/lpjs/files/lpjs_compd.sh b/lpjs/files/lpjs_compd.sh
old mode 100644
new mode 100755
index ca1eda70c0..b7e96ce608
--- a/lpjs/files/lpjs_compd.sh
+++ b/lpjs/files/lpjs_compd.sh
@@ -1,17 +1,32 @@
-#!@RCD_SCRIPTS_SHELL@
+#!/bin/sh
 # $NetBSD: lpjs_compd.sh,v 1.1 2018/04/22 21:31:09 bacon Exp $
 #
 # PROVIDE: lpjs_compd
 # REQUIRE: DAEMON munge
 # KEYWORD: shutdown
 
-. /etc/rc.subr
+$_rc_subr_loaded . /etc/rc.subr
 
 name="lpjs_compd"
 rcvar=${name}
-command="@PREFIX@/sbin/lpjs_compd --daemonize"
+command="@PREFIX@/sbin/$name"
+start_cmd="lpjs_start"
+stop_cmd="lpjs_stop"
+sig_stop="-INT"
 
 lpjs_compd_user="root"
 
+lpjs_start()
+{
+    echo "Starting $name..."
+    $command --daemonize
+}
+
+lpjs_stop()
+{
+    echo "Stopping $name..."
+    pkill $sig_stop $name
+}
+
 load_rc_config $name
 run_rc_command "$1"
diff --git a/lpjs/files/lpjs_dispatchd.sh b/lpjs/files/lpjs_dispatchd.sh
index 3f895c5724..f5c4f6638c 100644
--- a/lpjs/files/lpjs_dispatchd.sh
+++ b/lpjs/files/lpjs_dispatchd.sh
@@ -1,15 +1,30 @@
-#!@RCD_SCRIPTS_SHELL@
+#!/bin/sh
 # $NetBSD: lpjs_dispatchd.sh,v 1.1 2018/04/22 21:31:09 bacon Exp $
 #
 # PROVIDE: lpjs_dispatchd
 # REQUIRE: DAEMON munge
 # KEYWORD: shutdown
 
-. /etc/rc.subr
+$_rc_subr_loaded . /etc/rc.subr
 
 name="lpjs_dispatchd"
 rcvar=${name}
-command="@PREFIX@/sbin/lpjs_dispatchd --daemonize"
+command="@PREFIX@/sbin/$name"
+start_cmd="lpjs_start"
+stop_cmd="lpjs_stop"
+sig_stop="-INT"
+
+lpjs_start()
+{
+    echo "Starting $name..."
+    $command --daemonize
+}
+
+lpjs_stop()
+{
+    echo "Stopping $name..."
+    pkill $sig_stop $name
+}
 
 load_rc_config $name
 run_rc_command "$1"


Home | Main Index | Thread Index | Old Index