git 安装目录与服务的暂停与启动
生活随笔
收集整理的這篇文章主要介紹了
git 安装目录与服务的暂停与启动
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
git 安裝目錄:
drwxr-xr-x 14 root root 4096 Oct 13 21:17 apache drwxr-xr-x 10 root root 4096 Jan 2 23:50 gitlab drwxr-xr-x 2 root root 4096 May 8 2017 IBM drwx------. 2 root root 16384 May 4 2014 lost+found drwxr-xr-x 2 root root 4096 Oct 13 22:00 rsync_log drwxrwx--x 3 root root 4096 May 5 2014 symantec drwxr-xr-x 3 root root 4096 Oct 13 21:17 zabbix [root@ opt]# cd gitlab/ [root@ gitlab]# [root@ gitlab]# ll total 1880 drwxr-xr-x 2 root root 4096 Oct 27 19:17 bin drwxr-xr-x 19 root root 4096 Nov 21 09:30 embedded drwxr-xr-x 4 root root 4096 Nov 21 09:30 etc drwxr-xr-x 2 root root 4096 Oct 27 19:36 init -rw-r--r-- 1 root root 1858327 Mar 8 2017 LICENSE drwxr-xr-x 2 root root 4096 Oct 27 19:17 LICENSES drwxr-xr-x 2 root root 4096 Oct 27 19:36 service drwxr-xr-x 8 root root 4096 Oct 27 19:36 sv drwxr-xr-x 3 root root 4096 Oct 27 19:36 var -rw-r--r-- 1 root root 19560 Mar 8 2017 version-manifest.json -rw-r--r-- 1 root root 8696 Mar 8 2017 version-manifest.txt [root@ gitlab]# [root@ gitlab]# [root@ gitlab]# cd bin [root@ bin]# ll total 20 -rwxr-xr-x 1 root root 1262 Mar 8 2017 gitlab-ctl -rwxr-xr-x 1 root root 250 Mar 8 2017 gitlab-healthcheck -rwxr-xr-x 1 root root 629 Mar 8 2017 gitlab-psql -rwxr-xr-x 1 root root 1226 Mar 8 2017 gitlab-rails -rwxr-xr-x 1 root root 1225 Mar 8 2017 gitlab-rake [root@ bin]# ls gitlab-ctl gitlab-healthcheck gitlab-psql gitlab-rails gitlab-rake進入bin下面:
gitlab-ctl腳本是sh? #!/bin/bash # # Copyright:: Copyright (c) 2012 Opscode, Inc. # Copyright:: Copyright (c) 2014 GitLab.com # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ## Ensure the calling environment (disapproval look Bundler) does not infect our # Ruby environment if gitlab-ctl is called from a Ruby script. for ruby_env_var in RUBYOPT \BUNDLE_BIN_PATH \BUNDLE_GEMFILE \GEM_PATH \GEM_HOME dounset $ruby_env_var done# This bumps the default svwait timeout from 7 seconds to 30 seconds # As documented at http://smarden.org/runit/sv.8.html export SVWAIT=30/opt/gitlab/embedded/bin/omnibus-ctl gitlab /opt/gitlab/embedded/service/omnibus-ctl $@
gitlab-rail:
#!/bin/sh# Unset ENV variables that might interfere with # omnibus-gitlab ruby env (looking at you rvm) for ruby_env_var in RUBYOPT \BUNDLE_BIN_PATH \BUNDLE_GEMFILE \GEM_PATH \GEM_HOME dounset $ruby_env_var doneerror_echo() {echo "$1" 2>& 1 }gitlab_rails_rc='/opt/gitlab/etc/gitlab-rails/gitlab-rails-rc' if ! [ -f ${gitlab_rails_rc} ] ; thenerror_echo "$0 error: could not load ${gitlab_rails_rc}"error_echo "Either you are not allowed to read the file, or it does not exist yet."error_echo "You can generate it with: sudo gitlab-ctl reconfigure"exit 1 fi. ${gitlab_rails_rc}cd /opt/gitlab/embedded/service/gitlab-railsif [ -n "$NO_PRIVILEGE_DROP" ]; thenprivilege_drop='' elif [ "$(id -n -u)" = "${gitlab_user}" ] ; then# We are already running at the intended privilege; don't try to drop# privileges again because only root can do that (and we are apparently not# root!).privilege_drop='' elseprivilege_drop="-u ${gitlab_user}" fiexec /opt/gitlab/embedded/bin/chpst -e /opt/gitlab/etc/gitlab-rails/env ${privilege_drop} -U ${gitlab_user} /opt/gitlab/embedded/bin/bundle exec rails "$@"
# Start all GitLab components
sudo gitlab-ctl start
# Stop all GitLab components
sudo gitlab-ctl stop
# Restart all GitLab components
sudo gitlab-ctl restart
git 安裝的數據或者配置 被根目錄下var有映射:
[root@ ~]# cd /var [root@ var]# ll total 84 drwxr-xr-x. 2 root root 4096 May 4 2014 account drwxr-xr-x. 10 root root 4096 Jul 24 2014 cache drwxr-xr-x. 2 root root 4096 Sep 1 08:27 crash drwxr-xr-x. 4 root root 4096 May 8 2017 db drwxr-xr-x. 3 root root 4096 May 4 2014 empty drwxr-xr-x. 2 root root 4096 Jun 28 2011 games drwxr-xr-x. 27 root root 4096 May 7 2015 lib drwxr-xr-x. 2 root root 4096 Jun 28 2011 local drwxrwxr-x. 5 root lock 4096 Jan 3 03:14 lock drwxr-xr-x. 6 root root 4096 Jan 1 03:47 log drwx------. 2 root root 16384 May 4 2014 lost+found lrwxrwxrwx. 1 root root 10 May 4 2014 mail -> spool/mail drwxr-xr-x. 2 root root 4096 Jun 28 2011 nis drwxr-xr-x. 3 root root 4096 Oct 27 19:41 opt drwxr-xr-x. 2 root root 4096 Jun 28 2011 preserve drwxr-xr-x. 22 root root 4096 Dec 28 19:32 run drwxr-xr-x. 12 root root 4096 May 4 2014 spool drwxrwxrwt. 2 root root 4096 Dec 28 19:32 tmp drwxr-xr-x. 2 root root 4096 Jun 28 2011 yp [root@ var]# cd opt/ [root@ opt]# ll total 4 drwxr-xr-x 12 root root 4096 Nov 21 09:31 gitlab [root@ opt]# cd gitlab/ [root@ gitlab]# ll total 44 drwx------ 2 git git 4096 Dec 4 19:38 backups -rw------- 1 root root 38 Oct 27 19:42 bootstrapped drwx------ 3 git git 4096 Oct 26 11:01 git-data drwxr-xr-x 3 git git 4096 Oct 27 19:41 gitlab-ci drwxr-xr-x 9 git git 4096 Nov 21 09:31 gitlab-rails drwx------ 2 git root 4096 Nov 21 09:31 gitlab-shell drwxr-x--- 2 git gitlab-www 4096 Jan 3 15:57 gitlab-workhorse drwx------ 3 root root 4096 Jan 3 16:07 logrotate drwxr-x--- 9 root gitlab-www 4096 Jan 3 15:57 nginx drwxr-x--- 2 gitlab-redis git 4096 Jan 3 15:57 redis -rw-r--r-- 1 root root 40 Oct 27 19:42 trusted-certs-directory-hash [root@ gitlab]#應用的日志被存儲在/var/log下面
其他路徑:
[root@ gitlab]# cd backups/ [root@ backups]# ll total 0 -rw-r--r-- 1 git git 0 Oct 26 10:37 1 -rw-r--r-- 1 git git 0 Dec 4 19:38 2 [root@ backups]# [root@ backups]# [root@ backups]# cd .. [root@ gitlab]# cd git-data/ [root@ git-data]# ll total 4 drwxrws--- 5 git git 4096 Dec 4 14:45 repositories [root@ git-data]# cd repositories/ [root@ repositories]# ll total 12 drwxrwx--- 4 git git 4096 Nov 21 09:05 16020099 drwxrwx--- 4 git git 4096 Dec 4 14:45 liuhaitao drwxrwx--- 95 git git 4096 Dec 4 19:17 test1 [root@ repositories]# cd .. [root@ git-data]# cd .. [root@ gitlab]# cd gitlab-ci You have new mail in /var/spool/mail/root [root@ gitlab-ci]# ll total 4 drwx------ 2 git git 4096 Oct 20 15:40 builds [root@ gitlab-ci]# ls builds [root@ gitlab-ci]# cd builds/ [root@ builds]# ls [root@ builds]# ll total 0 [root@ builds]# cd .. [root@ gitlab-ci]# cd .. [root@ gitlab]# cd gitlab-rails/ [root@ gitlab-rails]# ll total 40 drwx------ 2 git root 4096 Jan 3 15:54 etc -rw-r--r-- 1 root root 8 Oct 27 19:42 REVISION -rw-r--r-- 1 root root 58 Oct 27 19:42 RUBY_VERSION drwxr-x--x 5 git gitlab-www 4096 Oct 26 11:53 shared drwxr-x--- 2 git gitlab-www 4096 Jan 3 15:57 sockets drwx------ 3 git root 4096 Nov 12 18:16 tmp drwx------ 2 git root 4096 Oct 27 19:42 upgrade-status drwx------ 2 git git 4096 Oct 20 15:40 uploads -rw-r--r-- 1 root root 7 Oct 27 19:42 VERSION drwx------ 2 git root 4096 Oct 27 19:42 working [root@ gitlab-rails]# cd etc [root@ etc]# ll total 48 -rw-r--r-- 1 root root 399 Oct 27 19:42 database.yml -rw-r--r-- 1 root root 129 Oct 27 19:42 gitlab_shell_secret -rw-r--r-- 1 root root 45 Oct 27 19:42 gitlab_workhorse_secret -rw-r--r-- 1 root root 14577 Nov 21 09:31 gitlab.yml -rw-r--r-- 1 root root 1383 Oct 27 19:42 rack_attack.rb -rw-r--r-- 1 root root 51 Oct 27 19:42 resque.yml -rw-r--r-- 1 root root 619 Oct 27 19:42 secrets.yml -rw-r--r-- 1 root root 666 Oct 27 19:42 smtp_settings.rb -rw-r--r-- 1 root root 1612 Jan 3 15:54 unicorn.rb [root@ etc]# 在 gitlab-rails下面的etc中存放這配置文件和git ruby 配置文件,比如unicorn.rb文件,database.yml文件;gitlab.yml文件等 [root@ gitlab-rails]# cd .. [root@ gitlab]# ll total 44 drwx------ 2 git git 4096 Dec 4 19:38 backups -rw------- 1 root root 38 Oct 27 19:42 bootstrapped drwx------ 3 git git 4096 Oct 26 11:01 git-data drwxr-xr-x 3 git git 4096 Oct 27 19:41 gitlab-ci drwxr-xr-x 9 git git 4096 Nov 21 09:31 gitlab-rails drwx------ 2 git root 4096 Nov 21 09:31 gitlab-shell drwxr-x--- 2 git gitlab-www 4096 Jan 3 15:57 gitlab-workhorse drwx------ 3 root root 4096 Jan 3 16:07 logrotate drwxr-x--- 9 root gitlab-www 4096 Jan 3 15:57 nginx drwxr-x--- 2 gitlab-redis git 4096 Jan 3 15:57 redis -rw-r--r-- 1 root root 40 Oct 27 19:42 trusted-certs-directory-hash [root@sncdpreweb73 gitlab]# cd gitlab-shell/ [root@sncdpreweb73 gitlab-shell]# ll total 4 -rw-r--r-- 1 root root 1567 Oct 27 19:42 config.yml [root@ gitlab-shell]# cd .. [root@ gitlab]# cd gitlab-workhorse/ [root@ gitlab-workhorse]# ll total 4 srwxrwxrwx 1 git git 0 Jan 3 15:57 socket -rw-r--r-- 1 root root 40 Oct 27 19:42 VERSION [root@ gitlab-workhorse]# cd .. [root@ gitlab]# cd logrotate/ [root@ logrotate]# ll total 12 -rw-r--r-- 1 root root 425 Oct 27 19:42 logrotate.conf drwx------ 2 root root 4096 Nov 21 09:31 logrotate.d -rw-r--r-- 1 root root 842 Jan 3 16:07 logrotate.status [root@ logrotate]# cd .. [root@ gitlab]#
總結
以上是生活随笔為你收集整理的git 安装目录与服务的暂停与启动的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SLAM 技术是什么?(背后的核心技术是
- 下一篇: 微软移动端必应聊天迎来大更新:增加识别网