Mercurial > kallithea
annotate init.d/kallithea-upstart.conf @ 5182:0e2d450feb03
git: run external commands as list of strings so we really get correct quoting (Issue #135)
a6dfd14d4b20 from
https://bitbucket.org/conservancy/kallithea/pull-request/17/add-quotes-to-repo-urls-for-git-backend
fixed that issue but did not make it "safe". The vcs git backend still used
command strings but tried to quote them correctly ... but that approach is
almost impossible to get right.
Instead, pass a string list all the way to the subprocess module and let it do
the quoting. This also makes some of the code more simple.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Tue, 09 Jun 2015 22:53:24 +0200 |
parents | 24c0d584ba86 |
children | e285bb7abb28 |
rev | line source |
---|---|
4190
99ad9d0af1a3
Rename init scripts and fix references inside them
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
1811
diff
changeset
|
1 # kallithea - run the kallithea daemon as an upstart job |
99ad9d0af1a3
Rename init scripts and fix references inside them
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
1811
diff
changeset
|
2 # Change variables/paths as necessary and place file /etc/init/kallithea.conf |
99ad9d0af1a3
Rename init scripts and fix references inside them
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
1811
diff
changeset
|
3 # start/stop/restart as normal upstart job (ie: $ start kallithea) |
1803
96789e1b0064
Debian/Ubuntu upstart script
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff
changeset
|
4 |
4212
24c0d584ba86
General renaming to Kallithea
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
4190
diff
changeset
|
5 description "Kallithea Mercurial Server" |
1803
96789e1b0064
Debian/Ubuntu upstart script
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff
changeset
|
6 author "Matt Zuba <matt.zuba@goodwillaz.org" |
96789e1b0064
Debian/Ubuntu upstart script
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff
changeset
|
7 |
96789e1b0064
Debian/Ubuntu upstart script
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff
changeset
|
8 start on (local-filesystems and runlevel [2345]) |
96789e1b0064
Debian/Ubuntu upstart script
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff
changeset
|
9 stop on runlevel [!2345] |
96789e1b0064
Debian/Ubuntu upstart script
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff
changeset
|
10 |
96789e1b0064
Debian/Ubuntu upstart script
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff
changeset
|
11 respawn |
96789e1b0064
Debian/Ubuntu upstart script
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff
changeset
|
12 |
96789e1b0064
Debian/Ubuntu upstart script
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff
changeset
|
13 umask 0022 |
96789e1b0064
Debian/Ubuntu upstart script
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff
changeset
|
14 |
4190
99ad9d0af1a3
Rename init scripts and fix references inside them
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
1811
diff
changeset
|
15 env PIDFILE=/var/hg/kallithea/kallithea.pid |
99ad9d0af1a3
Rename init scripts and fix references inside them
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
1811
diff
changeset
|
16 env LOGFILE=/var/hg/kallithea/log/kallithea.log |
99ad9d0af1a3
Rename init scripts and fix references inside them
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
1811
diff
changeset
|
17 env APPINI=/var/hg/kallithea/production.ini |
1803
96789e1b0064
Debian/Ubuntu upstart script
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff
changeset
|
18 env HOME=/var/hg |
96789e1b0064
Debian/Ubuntu upstart script
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff
changeset
|
19 env USER=hg |
96789e1b0064
Debian/Ubuntu upstart script
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff
changeset
|
20 env GROUP=hg |
96789e1b0064
Debian/Ubuntu upstart script
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff
changeset
|
21 |
4190
99ad9d0af1a3
Rename init scripts and fix references inside them
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
1811
diff
changeset
|
22 exec /var/hg/.virtualenvs/kallithea/bin/paster serve --user=$USER --group=$GROUP --pid-file=$PIDFILE --log-file=$LOGFILE $APPINI |
1803
96789e1b0064
Debian/Ubuntu upstart script
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff
changeset
|
23 |
96789e1b0064
Debian/Ubuntu upstart script
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff
changeset
|
24 post-stop script |
1811
58df0b3ed377
Add Celery upstart file and fix post-stop for rhodecode upstart
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
1803
diff
changeset
|
25 rm -f $PIDFILE |
1803
96789e1b0064
Debian/Ubuntu upstart script
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
diff
changeset
|
26 end script |