summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Jeremy Hansen <jebrhansen+github@gmail.com>2024-03-22 21:21:13 -0700
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2024-03-23 20:29:36 +0700
commit509e12cf3214eb375a47fe9d02dffe7619b2ea7c (patch)
tree0eb6b10ffbe16f933d719b0ca8a1678511b3860e
parent07ea90f807ccf04f10db313d071c91c9ab64e0c3 (diff)
downloadslackbuilds-509e12cf3.tar.gz
slackbuilds-509e12cf3.tar.xz
multimedia/sickchill: Tweak shutdown/startup/restart for rc file
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--multimedia/sickchill/rc.sickchill12
1 files changed, 8 insertions, 4 deletions
diff --git a/multimedia/sickchill/rc.sickchill b/multimedia/sickchill/rc.sickchill
index 28fa0050d0..f36eb79604 100644
--- a/multimedia/sickchill/rc.sickchill
+++ b/multimedia/sickchill/rc.sickchill
@@ -97,6 +97,7 @@ status()
start()
{
if [ $STATUS == "stopped" ]; then
+ echo -n "Starting $PROG: "
if su "$USERNAME" -s /bin/sh -c "/usr/bin/${PROG} --daemon --pidfile=${PIDFILE} --datadir=${DATADIR} --port=${PORT} &> /dev/null"; then
echo "Startup Successful"
else
@@ -121,11 +122,12 @@ stop()
echo "Please run as root"
exit 1
fi
- echo -n $"Shutting down $PROG: "
- curl -s http://localhost:"$PORT"/home/shutdown/?pid="$(cat "$PIDFILE")" | grep -q "shutting down"
# sickchill can take some time to properly shut down.
- #Give it 10 seconds before forcing it to close.
- TIMEOUT=10
+ # It takes more than 10 seconds on my system top properly close.
+ # If it doesn't close by the timeout, force close it.
+ TIMEOUT=15
+ echo -n $"Giving $PROG $TIMEOUT seconds to shut down: "
+ curl -s http://localhost:"$PORT"/home/shutdown/?pid="$(cat "$PIDFILE")" | grep -q "shutting down"
for (( COUNT=0; COUNT <= TIMEOUT; COUNT++ )); do
if pgrep -f "$FULLPROG.*$PORT" > /dev/null; then
SHUTDOWN=success
@@ -155,6 +157,8 @@ case "$1" in
restart)
check
stop
+ sleep 1
+ check
start
;;
status)