LoginSignup
1
1

More than 5 years have passed since last update.

git daemonのrcスクリプト

Last updated at Posted at 2012-12-31
#!/bin/sh

PIDFILE=/var/run/git-daemon.pid
REPODIR=/var/git

case $1 in
    start)
        git daemon --detach --export-all --enable=receive-pack --pid-file=${PIDFILE} --base-path=${REPODIR}
        ;;

    stop)
        if [ -f ${PIDFILE} ]; then kill `cat ${PIDFILE}` && rm ${PIDFILE}; fi
        ;;

    restart)
        $0 stop && $0 start
        ;;
esac

exit 0
  • これを /etc/init.d/git-daemonとかに保存する。
  • サーバ起動時に自動的に起動させたいなら、/etc/rc3.d/S99gitとかにシンボリックリンクを保存する
  • 起動ユーザとかリポジトリディレクトリのパーミッションとかは適宜調整
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1