-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit_script.html
113 lines (103 loc) · 2.96 KB
/
init_script.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link href='https://fonts.googleapis.com/css?family=Chivo:900' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="/stylesheets/stylesheet.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/stylesheets/pygment_trac.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/stylesheets/print.css" media="print" />
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<title>tpkg: Application packaging and deployment</title>
</head>
<body>
<div id="container">
<div class="sidebar">
<strong>Documents:</strong>
<ul>
<li><a href="get_started.html">Get started</a></li>
<li><a href="configure.html">Configure</a></li>
<li><a href="package.html">Package</a></li>
<li><a href="third_party.html">Package 3rd party apps</a></li>
<li><a href="deploy.html">Deploy</a></li>
<li><a href="package_server.html">Package server</a></li>
<li><a href="reporting_server.html">Reporting server</a></li>
<li><a href="production.html">Production</a></li>
<li><a href="externals.html">Externals</a></li>
<li><a href="faq.html">FAQ</a></li>
<li><a href="develop/">Develop</a></li>
</ul>
</div>
<div class="center">
<div class="inner">
<header>
<h1>tpkg</h1>
<h2>Application packaging and deployment</h2>
</header>
<hr>
<section id="main_content">
<p>
Here's an example init script for use in a tpkg. See the
<a href="package.html">packaging documentation</a> for more details about
incorporating an init script into a package.
</p>
<pre>
#!/bin/sh
case "$1" in
'start')
# Start nginx
/opt/tpkg/sbin/nginx -c /opt/tpkg/myapp/config/nginx.conf
;;
'stop')
# Stop nginx
if [ -f /opt/tpkg/var/run/nginx.pid ]
then
kill `cat /opt/tpkg/var/run/nginx.pid`
rm -f /opt/tpkg/var/run/nginx.pid
fi
;;
'restart')
$0 stop
$0 start
;;
'reload')
# Tell nginx to reload its configuration
if [ -f /opt/tpkg/var/run/nginx.pid ]
then
kill -HUP `cat /opt/tpkg/var/run/nginx.pid`
fi
;;
'status')
if [ -f /opt/tpkg/var/run/nginx.pid ]
then
pid=`cat /opt/tpkg/var/run/nginx.pid`
if ps -e | grep $pid > /dev/null 2>&1
then
echo "nginx (pid $pid) is running..."
exit 0
else
echo "nginx dead but pid file exists"
exit 1
fi
else
echo "nginx is stopped"
exit 3
fi
;;
*)
echo "Usage: $0 { start | stop | restart }"
exit 1
;;
esac
exit 0</pre>
</section>
</div>
</div>
<section id="downloads" class="clearfix">
<a href="https://github.com/tpkg" id="view-on-github" class="button"><span>View on GitHub</span></a>
</section>
</div>
</body>
</html>