Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 149 lines (123 sloc) 3.759 kb
ef7053f Stefan Hornburg (Racke) added -e flag to maintainer scripts
racke authored
1 #! /bin/sh -e
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
2 #
f7b4b4d Stefan Hornburg (Racke) fix failures of fresh Interchange installs due to postinst script trying...
racke authored
3 # Copyright 2001,2002,2003,2004,2006,2007,2009,2010 by Stefan Hornburg (Racke) <racke@linuxia.de>
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public
16 # License along with this program; if not, write to the Free
07f71a7 Peter Ajamian New Free Software Foundation Address in headers of various files
pajamian authored
17 # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
18 # MA 02110-1301 USA.
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
19
20 # Source debconf library
21 . /usr/share/debconf/confmodule
22
23 # Get interchange user and group
24 db_get interchange/user
25 USER=$RET
26 db_get interchange/group
27 GROUP=$RET
28
29 # Creating interchange group if he isn't already there
30 if ! grep -q ^$GROUP: /etc/group; then
31 echo Adding system group: $GROUP.
d3ff2cf Stefan Hornburg (Racke) merged changes 2.17 vs 2.17.4.1
racke authored
32 addgroup --system $GROUP
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
33 fi
34
35 # Creating interchange user if he isn't already there
36 if ! grep -q ^$USER: /etc/passwd; then
37 echo Adding system user: $USER.
38 adduser --system --ingroup $GROUP --home /usr/lib/interchange $USER
39 fi
40
f7b4b4d Stefan Hornburg (Racke) fix failures of fresh Interchange installs due to postinst script trying...
racke authored
41 # Ensure correct permissions for directories with log files
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
42 chown -R $USER.$GROUP /var/log/interchange
43 chmod 770 /var/log/interchange
44 chown -R $USER.$GROUP /usr/lib/cgi-bin/ic
45 chmod u+s /usr/lib/cgi-bin/ic/*
46
47 # Ensure correct permissions for catalog base directory
34b7fac Stefan Hornburg (Racke) merged changes 2.6 vs 2.6.2.1
racke authored
48 # and static HTML base directory
49
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
50 chown $USER.$GROUP /var/lib/interchange/catalogs
34b7fac Stefan Hornburg (Racke) merged changes 2.6 vs 2.6.2.1
racke authored
51 db_get interchange/docroot
4227902 Stefan Hornburg (Racke) merged changes 2.6.2.1 vs 2.6.2.2
racke authored
52 if [ -d "$RET" ]; then
53 chown $USER.$GROUP "$RET"
54 fi
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
55
7457617 Stefan Hornburg (Racke) merged changes 2.6.2.2 vs 2.6.2.3
racke authored
56 # More permissions
57
58 chown -R $USER.$GROUP /etc/interchange/usertag
a350a51 Stefan Hornburg (Racke) directory designed for adding/removing catalogs from packages introduced
racke authored
59 chown -R $USER.$GROUP /var/lib/interchange/catalog.d
7457617 Stefan Hornburg (Racke) merged changes 2.6.2.2 vs 2.6.2.3
racke authored
60
3a10e17 Stefan Hornburg (Racke) comment improved
racke authored
61 # Record debconf configuration in multiple files
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
62 # 1. Stuff needed for the init script
63
64 INITCFG=/etc/interchange/init.cfg
65 cat > $INITCFG <<EOF
66 # This file is automatically generated !
67 #
68 # YOU MAY MODIFY THIS FILE
69 # But we recommend to use dpkg-reconfigure interchange instead.
70
71 EOF
72
73 db_get interchange/mode
74 case "$RET" in
75 "unix mode") MODE=--unix;;
76 "internet mode") MODE=--inetmode;;
44ac273 Stefan Hornburg (Racke) specify unix and inet modes explicitly if user selects both
racke authored
77 "both") MODE="--unix --inetmode";;
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
78 esac
44ac273 Stefan Hornburg (Racke) specify unix and inet modes explicitly if user selects both
racke authored
79 echo MODE=\"$MODE\" >> $INITCFG
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
80 echo USER=$USER >> $INITCFG
81 echo GROUP=$GROUP >> $INITCFG
82
83 db_get interchange/docroot
84 echo DOCROOT=$RET >> $INITCFG
85
fd79b4d Stefan Hornburg (Racke) Debian packages support the selection of the GnuPG home directory
racke authored
86 db_get interchange/gpghome
60cb5cd Stefan Hornburg (Racke) fixed GPG variable misnomers
racke authored
87 echo GPGHOME=$RET >> $INITCFG
fd79b4d Stefan Hornburg (Racke) Debian packages support the selection of the GnuPG home directory
racke authored
88
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
89 # 2. Settings which influence the global configuration
90 # and make senses to be configured by debconf
91
5cf2faa Stefan Hornburg (Racke) FullURL setting now configurable from debconf
racke authored
92 db_get interchange/full_url
93 if [ "$RET" = true ]; then
94 FULL_URL=1
95 else
96 FULL_URL=0
97 fi
c2c2076 Stefan Hornburg (Racke) SOAP server selection wasn't recorded in settings.cfg
racke authored
98 db_get interchange/cansoap
99 SOAP=0
100 if [ "$RET" = true ]; then
101 db_get interchange/soap
102 if [ "$RET" = true ]; then
103 SOAP=1
104 fi
105 fi
2d38b94 Stefan Hornburg (Racke) Default traffic setting is low now.
racke authored
106 db_get interchange/traffic
107 TRAFFIC="$RET"
75968a5 Stefan Hornburg (Racke) Interchange variable MV_GETPPID_BROKEN has been added to
racke authored
108
62dd067 Stefan Hornburg (Racke) eliminated commands with absolute paths in maintainer scripts
racke authored
109 interchangeconfig FULL_URL=$FULL_URL SOAP=$SOAP TRAFFIC=$RET
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
110
ec0e042 Stefan Hornburg (Racke) recommit of changes put into the old branch
racke authored
111 # Make configuration files owned by the interchange user
112 chown -R $USER.$GROUP /etc/interchange
113
fccdd5f Stefan Hornburg (Racke) Create directory for static HTML files and grant it to the
racke authored
114 # Create directory for static HTML files and grant it to the
115 # interchange user
116 db_get interchange/docroot
117 DOCROOT="$RET"
118 if [ "$DOCROOT" ]; then
3f0de19 Stefan Hornburg (Racke) merged changes 2.21.2.1 vs 2.21.2.2
racke authored
119 mkdir -p -m 755 $DOCROOT
fccdd5f Stefan Hornburg (Racke) Create directory for static HTML files and grant it to the
racke authored
120 chown $USER.$GROUP $DOCROOT
121 fi
122
3485ca0 Stefan Hornburg (Racke) work in progress
racke authored
123 # Check if we delay the startup
ef1be7f Stefan Hornburg (Racke) restart server only once if both interchange and interchange-ui
racke authored
124 if [ -f /var/run/interchange-install ]; then
125 PACKAGES=""
126 exec 4</var/run/interchange-install
127 while read <&4 PKG; do
128 if [ ! "$PKG" = "interchange" ]; then
129 PACKAGES="$PKG $PACKAGES"
130 fi
131 done
132 if [ -z "$PACKAGES" ]; then
133 rm /var/run/interchange-install
134 else
135 exec 5>/var/run/interchange-install
136 for PKG in $PACKAGES; do
137 echo "$PKG" >&5
138 done
139 fi
140 fi
3485ca0 Stefan Hornburg (Racke) work in progress
racke authored
141
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
142 #DEBHELPER#
143
144 # Don't wait on Interchange to close file handles
145 db_stop
146
147 exit 0
148
Something went wrong with that request. Please try again.