From 1c1c7d5f8f0207003b9bddbc1dce8735dda9c649 Mon Sep 17 00:00:00 2001 From: John Drago Date: Fri, 28 Aug 2015 11:23:37 -0700 Subject: [PATCH 1/4] Make restart actually work fixes #24 --- init.d/codedeploy-agent | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/init.d/codedeploy-agent b/init.d/codedeploy-agent index beecad05..62bb59d2 100755 --- a/init.d/codedeploy-agent +++ b/init.d/codedeploy-agent @@ -40,6 +40,13 @@ stop() { exit $? } +restart() { + echo -n $"Stopping $prog:" + cd $AGENT_ROOT + $BIN stop >/dev/null &1 && start + exit $? +} + status() { cd $AGENT_ROOT $BIN status # Status of the server @@ -67,8 +74,7 @@ case "$1" in stop ;; restart) - stop - start + restart ;; force-reload) stop From c988335f5fce278bbe9ad033ecba89a924314ea8 Mon Sep 17 00:00:00 2001 From: John Drago Date: Fri, 28 Aug 2015 11:39:38 -0700 Subject: [PATCH 2/4] Turns out that the agent already has a 'restart' action. --- init.d/codedeploy-agent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.d/codedeploy-agent b/init.d/codedeploy-agent index 62bb59d2..f214f738 100755 --- a/init.d/codedeploy-agent +++ b/init.d/codedeploy-agent @@ -43,7 +43,7 @@ stop() { restart() { echo -n $"Stopping $prog:" cd $AGENT_ROOT - $BIN stop >/dev/null &1 && start + $BIN restart >/dev/null &1 # Try to restart the server exit $? } From 012f4612405b33e6010386566ee0379230911037 Mon Sep 17 00:00:00 2001 From: John Drago Date: Fri, 28 Aug 2015 11:42:40 -0700 Subject: [PATCH 3/4] use nohup like others closes #24 --- init.d/codedeploy-agent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.d/codedeploy-agent b/init.d/codedeploy-agent index f214f738..75e32d6e 100755 --- a/init.d/codedeploy-agent +++ b/init.d/codedeploy-agent @@ -43,7 +43,7 @@ stop() { restart() { echo -n $"Stopping $prog:" cd $AGENT_ROOT - $BIN restart >/dev/null &1 # Try to restart the server + nohup $BIN restart >/dev/null &1 # Try to restart the server exit $? } From be6f2db6f7ec443998fbd777324f0badad15e085 Mon Sep 17 00:00:00 2001 From: John Drago Date: Fri, 28 Aug 2015 13:27:28 -0700 Subject: [PATCH 4/4] Update message from Stopping to Restarting resolves #24 --- init.d/codedeploy-agent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.d/codedeploy-agent b/init.d/codedeploy-agent index 75e32d6e..d4eadf42 100755 --- a/init.d/codedeploy-agent +++ b/init.d/codedeploy-agent @@ -41,7 +41,7 @@ stop() { } restart() { - echo -n $"Stopping $prog:" + echo -n $"Restarting $prog:" cd $AGENT_ROOT nohup $BIN restart >/dev/null &1 # Try to restart the server exit $?