Project

General

Profile

Actions

Submit #2700

closed

rcreload

Added by zcrownover over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:

Description

A couple people have mentioned a curiosity about a reload feature in the
recent past with regard to our rc system, and until I tried to rcreload my
postgresql system, I didn't know we didn't have it in there. I added it to
the man page and the rc script support by copying the format of the restart
case. I've tested it to ensure it works.

diff --git a/sbin/rcrun/Makefile b/sbin/rcrun/Makefile
index a2e7f3d..51da196 100644
--- a/sbin/rcrun/Makefile
+++ b/sbin/rcrun/Makefile
@ -1,10 +1,12 @ # $DragonFly: src/sbin/rcrun/Makefile,v 1.3 2007/10/13 23:51:32 swildner
Exp $
+# $DragonFly: src/sbin/rcrun/Makefile,v 1.4 2014/07/16 13:50:05 zcrownover
Exp $

SCRIPTS=rcrun.sh
SYMLINKS= \
rcrun ${BINDIR}/rcstart \
rcrun ${BINDIR}/rcstop \
rcrun ${BINDIR}/rcrestart \
+ rcrun ${BINDIR}/rcreload \
rcrun ${BINDIR}/rcvar \
rcrun ${BINDIR}/rclist \
rcrun ${BINDIR}/rcforce \
@ -21,6 +23,7 @ MLINKS= rcrun.8 rcdisable.8 \
rcrun.8 rcone.8 \
rcrun.8 rclist.8 \
rcrun.8 rcrestart.8 \
+ rcrun.8 rcreload.8 \
rcrun.8 rcstart.8 \
rcrun.8 rcstop.8 \
rcrun.8 rcvar.8
diff --git a/sbin/rcrun/rcrun.8 b/sbin/rcrun/rcrun.8
index 49b579a..1bab120 100644
--- a/sbin/rcrun/rcrun.8
++ b/sbin/rcrun/rcrun.8
@ -28,7 +28,7 @
.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd October 13, 2007
.Dd July 16, 214
.Dt RCRUN 8
.Os
.Sh NAME
@ -39,6 +39,7 @
.Nm rcone ,
.Nm rcstop ,
.Nm rcrestart ,
.Nm rcreload ,
.Nm rcvar ,
.Nm rcdisable ,
.Nm rcenable ,
@ -59,6 +60,8 @
.Ar script ...
.Nm rcrestart
.Ar script ...
.Nm rcreload
.Ar script ...
.Nm rcvar
.Ar script ...
.Nm rcdisable
@ -81,6 +84,7 @ The
.Cm onestart ,
.Cm stop ,
.Cm restart ,
.Cm reload ,
and
.Cm rcvar
commands are just passed to the scripts.
@ -121,6 +125,7 @ If no argument is specified, the status of all scripts
is shown.
.Nm rcone ,
.Nm rcstop ,
.Nm rcrestart ,
.Nm rcreload ,
.Nm rcvar ,
.Nm rcdisable ,
.Nm rcenable
diff --git a/sbin/rcrun/rcrun.sh b/sbin/rcrun/rcrun.sh
index 485f4bf..903ece1 100644
-- a/sbin/rcrun/rcrun.sh
++ b/sbin/rcrun/rcrun.sh
@ -128,6 +128,9 @ rcstop)
rcrestart)
arg=restart
;;
rcreload)
arg=reload
+ ;;
rcvar)
arg=rcvar
;;
@ -193,6 +196,17 @ restart)
fi
done
;;
reload)
for tgt in $; do
+ buildrclist $tgt
+ dep=`echo "$rclist" | tail -1`
+ if [ X$dep = X ]; then
+ echo "Unable to find keyword $tgt"
+ else
+ (sh $dep reload)
+ fi
+ done
+ ;;
disable|enable)
if [ "$arg" = "enable" ]; then
mode=YES
@ 249,7 263,7 @@ list)
*)
echo "usage: rcrun action rcscript1 ..."
echo " where 'action' is one of:"
echo " start|stop|restart|rcvar|list|forcestart|faststart|onestart"
- echo " disable|enable"
echo " start|stop|restart|reload|rcvar|list|forcestart|faststart"
+ echo " onestart|disable|enable"
;;
esac

--
Sincerely,

Zachary Crownover


Files

0001-Added-support-for-rcreload.patch (2.94 KB) 0001-Added-support-for-rcreload.patch git patch zcrownover, 07/17/2014 05:14 AM
Actions #1

Updated by zcrownover over 10 years ago

I was just informed the year is 2014, not 214, I'm glad someone caught that because I missed that. Also in following our current plans, when modifying files that have CVS tags from before DragonFly was using git, we remove the CVS id tag. I've updated the changes to reflect both of those, and removing the leading whitespace in the file with the CVS id tags as the first lines.

diff --git a/sbin/rcrun/Makefile b/sbin/rcrun/Makefile
index a2e7f3d..020bce8 100644
--- a/sbin/rcrun/Makefile
++ b/sbin/rcrun/Makefile
@ -1,10 +1,9 @
# $DragonFly: src/sbin/rcrun/Makefile,v 1.3 2007/10/13 23:51:32 swildner Exp $

SCRIPTS=rcrun.sh
SYMLINKS= \
rcrun ${BINDIR}/rcstart \
rcrun ${BINDIR}/rcstop \
rcrun ${BINDIR}/rcrestart \
rcrun ${BINDIR}/rcreload \
rcrun ${BINDIR}/rcvar \
rcrun ${BINDIR}/rclist \
rcrun ${BINDIR}/rcforce \
@ -21,6 +20,7 @ MLINKS= rcrun.8 rcdisable.8 \
rcrun.8 rcone.8 \
rcrun.8 rclist.8 \
rcrun.8 rcrestart.8 \
+ rcrun.8 rcreload.8 \
rcrun.8 rcstart.8 \
rcrun.8 rcstop.8 \
rcrun.8 rcvar.8
diff --git a/sbin/rcrun/rcrun.8 b/sbin/rcrun/rcrun.8
index 49b579a..89dd088 100644
--- a/sbin/rcrun/rcrun.8
++ b/sbin/rcrun/rcrun.8
@ -28,7 +28,7 @
.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd October 13, 2007
.Dd July 16, 2014
.Dt RCRUN 8
.Os
.Sh NAME
@ -39,6 +39,7 @
.Nm rcone ,
.Nm rcstop ,
.Nm rcrestart ,
.Nm rcreload ,
.Nm rcvar ,
.Nm rcdisable ,
.Nm rcenable ,
@ -59,6 +60,8 @
.Ar script ...
.Nm rcrestart
.Ar script ...
.Nm rcreload
.Ar script ...
.Nm rcvar
.Ar script ...
.Nm rcdisable
@ -81,6 +84,7 @ The
.Cm onestart ,
.Cm stop ,
.Cm restart ,
.Cm reload ,
and
.Cm rcvar
commands are just passed to the scripts.
@ -121,6 +125,7 @ If no argument is specified, the status of all scripts is shown.
.Nm rcone ,
.Nm rcstop ,
.Nm rcrestart ,
.Nm rcreload ,
.Nm rcvar ,
.Nm rcdisable ,
.Nm rcenable
diff --git a/sbin/rcrun/rcrun.sh b/sbin/rcrun/rcrun.sh
index 485f4bf..903ece1 100644
-- a/sbin/rcrun/rcrun.sh
++ b/sbin/rcrun/rcrun.sh
@ -128,6 +128,9 @ rcstop)
rcrestart)
arg=restart
;;
rcreload)
arg=reload
+ ;;
rcvar)
arg=rcvar
;;
@ -193,6 +196,17 @ restart)
fi
done
;;
reload)
for tgt in $; do
+ buildrclist $tgt
+ dep=`echo "$rclist" | tail -1`
+ if [ X$dep = X ]; then
+ echo "Unable to find keyword $tgt"
+ else
+ (sh $dep reload)
+ fi
+ done
+ ;;
disable|enable)
if [ "$arg" = "enable" ]; then
mode=YES
@ 249,7 263,7 @@ list)
*)
echo "usage: rcrun action rcscript1 ..."
echo " where 'action' is one of:"
echo " start|stop|restart|rcvar|list|forcestart|faststart|onestart"
- echo " disable|enable"
echo " start|stop|restart|reload|rcvar|list|forcestart|faststart"
+ echo " onestart|disable|enable"
;;
esac

Actions #3

Updated by zcrownover over 10 years ago

  • Assignee set to swildner
  • Target version set to 3.9.x
  • % Done changed from 0 to 100

This ticket can be closed, swildner applied the patch.

http://lists.dragonflybsd.org/pipermail/commits/2014-July/270455.html

commit 958ca0fd984abaaa7354ae30aabedc25ff6671c7

Actions #4

Updated by zcrownover over 10 years ago

  • Status changed from New to Feedback

If no one has seen any issues with this or has any reason as to why this can't be closed, let me know, otherwise this can be closed.

Actions #5

Updated by zcrownover over 10 years ago

  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF