aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-09-29 05:38:52 -0400
committerUnknwon <joe2010xtmf@163.com>2014-09-29 05:38:52 -0400
commitcd084dacf1108e483461f8c99a0771ce3b402dc4 (patch)
treed10b28ebc0d502bf8197ac6955dc98003a7725b8
parentac2055e33cb08f9d11fc7322739ad46a6213dd7f (diff)
parent96f4c9045affc7479e3b6081bddf1e85f010773e (diff)
downloadgitea-cd084dacf1108e483461f8c99a0771ce3b402dc4.tar.gz
gitea-cd084dacf1108e483461f8c99a0771ce3b402dc4.zip
Merge branch 'dev' of github.com:gogits/gogs into dev
-rw-r--r--scripts/init/centos/gogs92
1 files changed, 92 insertions, 0 deletions
diff --git a/scripts/init/centos/gogs b/scripts/init/centos/gogs
new file mode 100644
index 0000000000..90469498be
--- /dev/null
+++ b/scripts/init/centos/gogs
@@ -0,0 +1,92 @@
+#!/bin/sh
+#
+# /etc/rc.d/init.d/gogs
+#
+# Runs the Gogs Go Git Service.
+#
+#
+# chkconfig: - 85 15
+#
+
+### BEGIN INIT INFO
+# Provides: gogs
+# Required-Start: $remote_fs $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start gogs at boot time.
+# Description: Control gogs.
+### END INIT INFO
+
+# Source function library.
+. /etc/init.d/functions
+
+# Default values
+
+NAME=gogs
+GOGS_HOME=/home/git/gogs
+GOGS_PATH=${GOGS_HOME}/$NAME
+GOGS_USER=git
+SERVICENAME="Gogs Go Git Service"
+PID=/var/run/$NAME.pid
+LOCKFILE=/var/lock/subsys/gogs
+LOGFILE=${GOGS_HOME}/log/gogs.log
+RETVAL=0
+
+# Read configuration from /etc/sysconfig/gogs to override defaults
+[ -r /etc/sysconfig/$NAME ] && ./etc/sysconfig/$NAME
+
+# Don't do anything if nothing is installed
+[ -x ${GOGS_PATH} ] || exit 0
+
+DAEMON_OPTS=""
+
+# Set additional options, if any
+[ ! -z "$GOGS_USER" ] && DAEMON_OPTS="$DAEMON_OPTS --user=${GOGS_USER}"
+
+start() {
+ cd ${GOGS_HOME}
+ echo -n "Starting ${SERVICENAME}: "
+ daemon $DAEMON_OPTS --pidfile=${PID} "${GOGS_PATH} web 2>&1 > ${LOGFILE} &"
+ echo $! > ${PID}
+ RETVAL=$?
+ echo
+ [ $RETVAL = 0 ] && touch ${LOCKFILE}
+
+ return $RETVAL
+}
+
+stop() {
+ cd ${GOGS_HOME}
+ echo -n "Shutting down ${SERVICENAME}: "
+ killproc -p ${PID} ${NAME}
+ RETVAL=$?
+ echo
+ [ $RETVAL = 0 ] && rm -f ${LOCKFILE} ${PID}
+}
+
+case "$1" in
+ start)
+ status ${NAME} > /dev/null 2>&1 && exit 0
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ status)
+ status -p ${PID} ${NAME}
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ reload)
+ stop
+ start
+ ;;
+ *)
+ echo "Usage: ${NAME} {start|stop|status|restart}"
+ exit 1
+ ;;
+esac
+exit $RETVAL
/* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
      <fo:simple-page-master master-name="simplePM"
                    page-height="25cm"
                    page-width="20cm"
                    margin-top="1cm"
                    margin-bottom="1cm"
                    margin-left="1.5cm"
                    margin-right="1.5cm">
        <fo:region-body margin-top="3cm" margin-bottom="3cm"/>
        <fo:region-before extent="2.5cm"/>
        <fo:region-after extent="2.5cm"/>
      </fo:simple-page-master>
  </fo:layout-master-set>

  <fo:page-sequence master-reference="simplePM">
      <fo:flow flow-name="xsl-region-body">
      <fo:block>
        This is a simple fo block.
      </fo:block>
    </fo:flow>
  </fo:page-sequence>
</fo:root>