[packages/gitlab-ce] gitlab-ctl: add star/stop commands
glen
glen at pld-linux.org
Sun Nov 19 14:16:03 CET 2017
commit 43c8ba810b960d859e99e49877546151e2294808
Author: Elan Ruusamäe <glen at pld-linux.org>
Date: Sat Nov 18 14:40:49 2017 +0200
gitlab-ctl: add star/stop commands
gitlab-ctl.sh | 38 ++++++++++++++++++++++++++++++--------
1 file changed, 30 insertions(+), 8 deletions(-)
---
diff --git a/gitlab-ctl.sh b/gitlab-ctl.sh
index 402537d..9077f2e 100755
--- a/gitlab-ctl.sh
+++ b/gitlab-ctl.sh
@@ -5,6 +5,7 @@
set -e
auto_migrations_skip_file=/etc/gitlab/skip-auto-migrations
+gitlab_services="gitlab-sidekiq gitlab-unicorn gitlab-workhorse"}
die() {
cat >&2
@@ -62,18 +63,30 @@ posttrans() {
EOF
}
-# http://docs.gitlab.com/ce/administration/restart_gitlab.html#installations-from-source
-restart() {
- local service services=${@-"gitlab-sidekiq gitlab-unicorn gitlab-workhorse"}
+start() {
+ local service services=${@-"$gitlab_services"}
for service in $services; do
- service $service stop
+ service $service start
done
+}
+
+stop() {
+ local service services=${@-"$gitlab_services"}
+
for service in $services; do
- service $service start
+ service $service stop
done
}
+# http://docs.gitlab.com/ce/administration/restart_gitlab.html#installations-from-source
+restart() {
+ local service services=${@-"$gitlab_services"}
+
+ stop $services
+ start $services
+}
+
# run tail on the logs
# https://github.com/chef/omnibus-ctl/blob/v0.3.6/lib/omnibus-ctl.rb#L427-L436
logtail() {
@@ -86,11 +99,14 @@ usage() {
Usage: $0: command (subcommand)
backup
- Create a backup of the GitLab system
+ Create a backup of the GitLab system.
http://docs.gitlab.com/ce/raketasks/backup_restore.html
upgrade
- Run migrations after a package upgrade
+ Run migrations after a package upgrade.
+
+start/stop
+ Start or stop the services.
restart
Stop the services if they are running, then start them again.
@@ -101,7 +117,7 @@ tail
EOF
}
-COMMAND=$1
+COMMAND="$1"
if [ -z "$COMMAND" ]; then
usage
@@ -122,6 +138,12 @@ backup)
upgrade)
upgrade "$@"
;;
+start)
+ start "$@"
+ ;;
+stop)
+ stop "$@"
+ ;;
restart)
restart "$@"
;;
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/gitlab-ce.git/commitdiff/43c8ba810b960d859e99e49877546151e2294808
More information about the pld-cvs-commit
mailing list