pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Add rc.subr script.
Module Name: pkgsrc-wip
Committed By: youri <youri%NetBSD.org@localhost>
Pushed By: youri
Date: Mon Feb 29 14:24:20 2016 +0100
Changeset: 69d9d13952e5d8d0f9b7a8c8d444990b35404e82
Modified Files:
phabricator/Makefile
Added Files:
phabricator/files/phd.sh
Log Message:
Add rc.subr script.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=69d9d13952e5d8d0f9b7a8c8d444990b35404e82
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
phabricator/Makefile | 2 +
phabricator/files/phd.sh | 109 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 111 insertions(+)
diffs:
diff --git a/phabricator/Makefile b/phabricator/Makefile
index 4166bf9..34fcb59 100644
--- a/phabricator/Makefile
+++ b/phabricator/Makefile
@@ -71,6 +71,8 @@ REPLACE_BASH+= scripts/install/install_rhel-derivs.sh \
NO_BUILD= yes
+RCD_SCRIPTS= phd
+
PHABRICATOR_DIR= share/phabricator
INSTALLATION_DIRS+= ${PHABRICATOR_DIR}
diff --git a/phabricator/files/phd.sh b/phabricator/files/phd.sh
new file mode 100644
index 0000000..f5c9b9f
--- /dev/null
+++ b/phabricator/files/phd.sh
@@ -0,0 +1,109 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: phd.sh,v 1.1 2015/01/14 21:01:19 adam Exp $
+#
+# Phabricator rc.d control script
+#
+# PROVIDE: phd
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+#
+# You will need to set some variables in /etc/rc.conf to start PostgreSQL:
+#
+# phd=YES
+# do initdb?
+
+if [ -f /etc/rc.subr ]; then
+ . /etc/rc.subr
+fi
+
+name="phd"
+rcvar=${name}
+command="@PREFIX@/share/phabricator/bin/phd"
+extra_commands="reload status list log"
+
+start_cmd="phd_start"
+restart_cmd="phd_restart"
+stop_cmd="phd_stop"
+reload_cmd="phd_reload"
+status_cmd="phd_status"
+list_cmd="phd_list"
+log_cmd="phd_log"
+
+if [ -f /etc/rc.subr -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then
+ load_rc_config $name
+elif [ -f /etc/rc.conf ]; then
+ . /etc/rc.conf
+fi
+
+phd_start()
+{
+ @ECHO@ "Starting ${name}."
+ ${command} start
+}
+
+phd_restart()
+{
+ @ECHO@ "Restarting ${name}."
+ ${command} restart
+}
+
+phd_stop()
+{
+ @ECHO@ "Stopping ${name}."
+ ${command} stop
+}
+
+phd_reload()
+{
+ @ECHO@ "Reloading ${name}."
+ ${command} reload
+}
+
+phd_status()
+{
+ ${command} status
+}
+
+phd_list()
+{
+ ${command} list
+}
+
+phd_log()
+{
+ ${command} log
+}
+
+if [ -f /etc/rc.subr -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then
+ run_rc_command "$1"
+else
+ case "$1" in
+ #initdb)
+ #eval ${initdb_cmd}
+ #;;
+ restart)
+ eval ${restart_precmd}
+ eval ${restart_cmd}
+ ;;
+ stop)
+ eval ${stop_cmd}
+ ;;
+ reload)
+ eval ${reload_cmd}
+ ;;
+ status)
+ eval ${status_cmd}
+ ;;
+ list)
+ eval ${list_cmd}
+ ;;
+ log)
+ eval ${log_cmd}
+ ;;
+ *)
+ eval ${start_precmd}
+ eval ${start_cmd}
+ ;;
+ esac
+fi
Home |
Main Index |
Thread Index |
Old Index