Actions
Submit #2700
closedrcreload
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
Actions