xaizek / rocketgit (License: AGPLv3+) (since 2018-12-09)
Light and fast Git hosting solution suitable to serve both as a hub or as a personal code storage with its tickets, pull requests, API and much more.
Commit f10bf48646859f1b111004e7c879358ddcc7b1c1

Provide sysvinit init script for rocketgit-fpm
Author: xaizek
Author date (UTC): 2018-12-08 22:21
Committer name: xaizek
Committer date (UTC): 2018-12-08 22:21
Parent(s): e4f3f04e1fdcc791432effd8a14771cf97ab88ee
Signing key: 99DC5E4DB05F6BE2
Tree: d2598f33a88f9798ba9b8dfdfe15d3ec4b153921
File Lines added Lines deleted
Makefile.in 2 0
samples/rocketgit-fpm 68 0
File Makefile.in changed (mode: 100644) (index 1d0f43c..5065c2a)
... ... install: all
41 41 cp -vd --no-clobber samples/config.php $(I_ETC)/$(PRJ)/ cp -vd --no-clobber samples/config.php $(I_ETC)/$(PRJ)/
42 42 cp -vd --no-clobber samples/php-fpm.conf $(I_ETC)/$(PRJ)/ cp -vd --no-clobber samples/php-fpm.conf $(I_ETC)/$(PRJ)/
43 43 cp -vd --no-clobber samples/pool.conf $(I_ETC)/$(PRJ)/ cp -vd --no-clobber samples/pool.conf $(I_ETC)/$(PRJ)/
44 @mkdir -pv $(I_ETC)/init.d/
45 cp -vd samples/rocketgit-fpm $(I_ETC)/init.d/
44 46 @mkdir -pv $(I_USR)/lib/systemd/system/ @mkdir -pv $(I_USR)/lib/systemd/system/
45 47 cp -vd samples/rocketgit-fpm.service $(I_USR)/lib/systemd/system/rocketgit-fpm.service cp -vd samples/rocketgit-fpm.service $(I_USR)/lib/systemd/system/rocketgit-fpm.service
46 48 @ @
File samples/rocketgit-fpm added (mode: 100755) (index 0000000..b61b778)
1 #!/bin/bash
2 # rocketgit-fpm daemon
3 # chkconfig: 345 20 80
4 # description: light and fast Git hosting solution.
5
6 ### BEGIN INIT INFO
7 # Provides: rocketgit-fpm
8 # Required-Start: $remote_fs $syslog
9 # Required-Stop: $remote_fs $syslog
10 # Default-Start: 2 3 4 5
11 # Default-Stop: 0 1 6
12 # Short-Description: Light and fast Git hosting solution.
13 # Description: Light and fast Git hosting solution.
14 ### END INIT INFO
15
16 DAEMON="php-fpm7.0"
17 DAEMONOPTS="--fpm-config /etc/rocketgit/php-fpm.conf"
18
19 NAME=rocketgit-fpm
20 PIDFILE=/var/run/$NAME.pid
21 SCRIPTNAME=/etc/init.d/$NAME
22
23 case "$1" in
24 start)
25 printf "%-50s" "Starting $NAME..."
26 mkdir -p /run/rocketgit-fpm/
27 PID=`$DAEMON $DAEMONOPTS > /dev/null 2>&1 & echo \$!`
28 if [ -z "$PID" ]; then
29 echo "Fail"
30 else
31 echo "$PID" > $PIDFILE
32 echo "Ok"
33 fi
34 ;;
35 status)
36 printf "%-50s" "Checking $NAME..."
37 if [ -f $PIDFILE ]; then
38 PID=`cat $PIDFILE`
39 if [ -z "`ps axf | grep ${PID} | grep -v grep`" ]; then
40 echo "Process dead but pidfile exists"
41 else
42 echo "Running"
43 fi
44 else
45 echo "Service not running"
46 fi
47 ;;
48 stop)
49 printf "%-50s" "Stopping $NAME"
50 PID=`cat $PIDFILE`
51 if [ -f $PIDFILE ]; then
52 kill $PID
53 echo "Ok"
54 rm -f $PIDFILE
55 else
56 echo "pidfile not found"
57 fi
58 ;;
59
60 restart)
61 $0 stop
62 $0 start
63 ;;
64
65 *)
66 echo "Usage: $0 {status|start|stop|restart}"
67 exit 1
68 esac
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/rocketgit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/rocketgit

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master