init: add register command to easily register under proper user
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 31 Aug 2017 11:41:38 +0000 (14:41 +0300)
committerElan Ruusamäe <glen@pld-linux.org>
Thu, 31 Aug 2017 11:41:45 +0000 (14:41 +0300)
gitlab-ci-multi-runner.init

index 9b4d037..e54cab8 100755 (executable)
@@ -81,6 +81,11 @@ condrestart() {
        start
 }
 
+# run gitlab-runner register with proper uid/gid
+register() {
+       runuser -u "$USER" -g "$GROUP" gitlab-runner "$@"
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -100,12 +105,15 @@ case "$1" in
   force-reload)
        condrestart 7
        ;;
+  register)
+       register "$@"
+       ;;
   status)
        status --pidfile $PIDFILE $NAME
        RETVAL=$?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|register|status}"
        exit 3
 esac
 
This page took 0.082036 seconds and 4 git commands to generate.