Commit e2fcd1de74bfff61f3f166f216b93aebe623b386
1 parent
f2d34f07
Exists in
master
and in
29 other branches
Migrate relevant mongrel configs to thin
Showing
1 changed file
with
20 additions
and
0 deletions
Show diff stats
debian/noosfero.postinst
... | ... | @@ -9,6 +9,26 @@ makedir() { |
9 | 9 | chown noosfero:noosfero $1 |
10 | 10 | } |
11 | 11 | |
12 | + | |
13 | +# migrate mongrel configuration to thin | |
14 | +mongrel_config=/etc/noosfero/mongrel_cluster.yml | |
15 | +thin_config=/etc/noosfero/thin.yml | |
16 | +mongrel_orig_sha1=602c642c03f79349969c08330112a6f29d4c32aa | |
17 | +if [ -r $mongrel_config ]; then | |
18 | + mongrel_sha1=$(sha1sum $mongrel_config | awk '{print $1}') | |
19 | + if [ "$mongrel_sha1" != "$mongrel_orig_sha1" ]; then | |
20 | + port=$(awk '{ if ($1 == "port:") { print($2) } }' $mongrel_config) | |
21 | + servers=$(awk '{ if ($1 == "servers:") { print($2) } }' $mongrel_config) | |
22 | + if test -n "$port" && test "$port" -ne 50000 || test -n "$servers" && test "$servers" -ne 1 ; then | |
23 | + # mongrel configuration was changed; update thin configuration | |
24 | + # accordingly | |
25 | + sed -i -e "s/port: .*/port: $port/" $thin_config | |
26 | + sed -i -e "s/servers: .*/servers: $servers/" $thin_config | |
27 | + fi | |
28 | + fi | |
29 | + mv $mongrel_config $mongrel_config.bak | |
30 | +fi | |
31 | + | |
12 | 32 | # create user noosfero in a portable way, while creating the log directory. |
13 | 33 | # (idea taken from the postfix package) |
14 | 34 | ############################################################################## | ... | ... |