summaryrefslogtreecommitdiff
path: root/gitlab-server/usr/share/gitlab-install/systemd-units
diff options
context:
space:
mode:
Diffstat (limited to 'gitlab-server/usr/share/gitlab-install/systemd-units')
-rw-r--r--gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-ci-sidekiq.service24
-rw-r--r--gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-ci-unicorn.service24
-rw-r--r--gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-sidekiq.service24
-rw-r--r--gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-unicorn.service24
-rw-r--r--gitlab-server/usr/share/gitlab-install/systemd-units/gitlab.target15
-rw-r--r--gitlab-server/usr/share/gitlab-install/systemd-units/nginx.service15
-rw-r--r--gitlab-server/usr/share/gitlab-install/systemd-units/postgres.service25
-rw-r--r--gitlab-server/usr/share/gitlab-install/systemd-units/redis.service13
8 files changed, 164 insertions, 0 deletions
diff --git a/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-ci-sidekiq.service b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-ci-sidekiq.service
new file mode 100644
index 00000000..9a1a82d2
--- /dev/null
+++ b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-ci-sidekiq.service
@@ -0,0 +1,24 @@
+#####################################################
+#
+# GitLab version : 5.x - 6.x
+# Contributors : davispuh, mtorromeo, axilleas, boeserwolf91
+# Downloaded from : https://github.com/gitlabhq/gitlab-recipes/tree/master/init/systemd
+#
+####################################################
+
+[Unit]
+Description=GitLab CI Sidekiq Worker
+
+[Service]
+Type=forking
+User=gitlab_ci
+WorkingDirectory=/home/gitlab_ci/gitlab-ci
+Environment=RAILS_ENV=production
+SyslogIdentifier=gitlab-ci-sidekiq
+PIDFile=/home/gitlab_ci/gitlab-ci/tmp/pids/sidekiq.pid
+
+ExecStart=/usr/bin/bundle exec "sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e production -P tmp/pids/sidekiq.pid -d -L log/sidekiq.log >> log/sidekiq.log 2>&1"
+ExecStop=/usr/bin/bundle exec "sidekiqctl stop /home/gitlab_ci/gitlab-ci/tmp/pids/sidekiq.pid >> /home/gitlab_ci/gitlab-ci/log/sidekiq.log 2>&1"
+
+[Install]
+WantedBy=gitlab.target
diff --git a/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-ci-unicorn.service b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-ci-unicorn.service
new file mode 100644
index 00000000..811b3fc0
--- /dev/null
+++ b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-ci-unicorn.service
@@ -0,0 +1,24 @@
+#####################################################
+#
+# GitLab version : 5.x - 6.x
+# Contributors : davispuh, mtorromeo, axilleas, boeserwolf91
+# Downloaded from : https://github.com/gitlabhq/gitlab-recipes/tree/master/init/systemd
+#
+####################################################
+
+[Unit]
+Description=GitLab CI Unicorn Server
+
+[Service]
+User=gitlab_ci
+WorkingDirectory=/home/gitlab_ci/gitlab-ci
+Environment=RAILS_ENV=production
+SyslogIdentifier=gitlab-ci-unicorn
+PIDFile=/home/gitlab_ci/gitlab-ci/tmp/pids/unicorn.pid
+
+ExecStart=/usr/bin/bundle exec "unicorn_rails -c /home/gitlab_ci/gitlab-ci/config/unicorn.rb -E production"
+ExecStop=/usr/bin/kill -QUIT $MAINPID
+ExecReload=/usr/bin/kill -USR2 $MAINPID
+
+[Install]
+WantedBy=gitlab.target
diff --git a/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-sidekiq.service b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-sidekiq.service
new file mode 100644
index 00000000..82ff78d4
--- /dev/null
+++ b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-sidekiq.service
@@ -0,0 +1,24 @@
+#####################################################
+#
+# GitLab version : 5.x - 6.x
+# Contributors : davispuh, mtorromeo, axilleas, boeserwolf91
+# Downloaded from : https://github.com/gitlabhq/gitlab-recipes/tree/master/init/systemd
+#
+####################################################
+
+[Unit]
+Description=GitLab Sidekiq Worker
+
+[Service]
+Type=forking
+User=git
+WorkingDirectory=/home/git/gitlab
+Environment=RAILS_ENV=production
+SyslogIdentifier=gitlab-sidekiq
+PIDFile=/home/git/gitlab/tmp/pids/sidekiq.pid
+
+ExecStart=/usr/bin/bundle exec "sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e production -P tmp/pids/sidekiq.pid -d -L log/sidekiq.log >> log/sidekiq.log 2>&1"
+ExecStop=/usr/bin/bundle exec "sidekiqctl stop /home/git/gitlab/tmp/pids/sidekiq.pid >> /home/git/gitlab/log/sidekiq.log 2>&1"
+
+[Install]
+WantedBy=gitlab.target
diff --git a/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-unicorn.service b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-unicorn.service
new file mode 100644
index 00000000..71e3d84d
--- /dev/null
+++ b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab-unicorn.service
@@ -0,0 +1,24 @@
+#####################################################
+#
+# GitLab version : 5.x - 6.x
+# Contributors : davispuh, mtorromeo, axilleas, boeserwolf91
+# Downloaded from : https://github.com/gitlabhq/gitlab-recipes/tree/master/init/systemd
+#
+####################################################
+
+[Unit]
+Description=GitLab Unicorn Server
+
+[Service]
+User=git
+WorkingDirectory=/home/git/gitlab
+Environment=RAILS_ENV=production
+SyslogIdentifier=gitlab-unicorn
+PIDFile=/home/git/gitlab/tmp/pids/unicorn.pid
+
+ExecStart=/usr/bin/bundle exec "unicorn_rails -c /home/git/gitlab/config/unicorn.rb -E production"
+ExecStop=/usr/bin/kill -QUIT $MAINPID
+ExecReload=/usr/bin/kill -USR2 $MAINPID
+
+[Install]
+WantedBy=gitlab.target
diff --git a/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab.target b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab.target
new file mode 100644
index 00000000..11e85441
--- /dev/null
+++ b/gitlab-server/usr/share/gitlab-install/systemd-units/gitlab.target
@@ -0,0 +1,15 @@
+###########################################################################################
+#
+# GitLab version : 5.x - 6.x
+# Contributors : davispuh, mtorromeo, axilleas, boeserwolf91
+# Downloaded from : https://github.com/gitlabhq/gitlab-recipes/tree/master/init/systemd
+#
+###########################################################################################
+
+[Unit]
+Description=GitLab - Self Hosted Git Management
+Requires=redis.service postgres.service
+After=redis.service postgres.service syslog.target network.target
+
+[Install]
+WantedBy=multi-user.target
diff --git a/gitlab-server/usr/share/gitlab-install/systemd-units/nginx.service b/gitlab-server/usr/share/gitlab-install/systemd-units/nginx.service
new file mode 100644
index 00000000..0a50c50b
--- /dev/null
+++ b/gitlab-server/usr/share/gitlab-install/systemd-units/nginx.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=The nginx HTTP and reverse proxy server
+After=syslog.target network.target remote-fs.target nss-lookup.target
+
+[Service]
+Type=forking
+PIDFile=/etc/nginx/nginx.pid
+ExecStartPre=/usr/sbin/nginx -t
+ExecStart=/usr/sbin/nginx
+ExecReload=/bin/kill -s HUP $MAINPID
+ExecStop=/bin/kill -s QUIT $MAINPID
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target
diff --git a/gitlab-server/usr/share/gitlab-install/systemd-units/postgres.service b/gitlab-server/usr/share/gitlab-install/systemd-units/postgres.service
new file mode 100644
index 00000000..ed46d965
--- /dev/null
+++ b/gitlab-server/usr/share/gitlab-install/systemd-units/postgres.service
@@ -0,0 +1,25 @@
+[Unit]
+Description=PostgreSQL database server
+After=network.target
+
+[Service]
+Type=forking
+TimeoutSec=120
+User=postgres
+Group=postgres
+
+Environment=PGROOT=/home/postgres/pgsql
+
+SyslogIdentifier=postgres
+PIDFile=/home/postgres/pgsql/data/postmaster.pid
+
+ExecStart= /usr/bin/pg_ctl -s -D ${PGROOT}/data start -w -t 120
+ExecReload=/usr/bin/pg_ctl -s -D ${PGROOT}/data reload
+ExecStop= /usr/bin/pg_ctl -s -D ${PGROOT}/data stop -m fast
+
+# Due to PostgreSQL's use of shared memory, OOM killer is often overzealous in
+# killing Postgres, so adjust it downward
+OOMScoreAdjust=-200
+
+[Install]
+WantedBy=multi-user.target
diff --git a/gitlab-server/usr/share/gitlab-install/systemd-units/redis.service b/gitlab-server/usr/share/gitlab-install/systemd-units/redis.service
new file mode 100644
index 00000000..c936f8da
--- /dev/null
+++ b/gitlab-server/usr/share/gitlab-install/systemd-units/redis.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Redis Server
+After=network.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/redis-server
+ExecStop=/bin/kill -15 $MAINPID
+PIDFile=/var/run/redis.pid
+Restart=always
+
+[Install]
+WantedBy=multi-user.target