Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 158 lines (131 sloc) 4.021 kB
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
1 #! /bin/sh
2 #
c2c2076 @racke SOAP server selection wasn't recorded in settings.cfg
racke authored
3 # Copyright 2001,2002,2003,2004 by Stefan Hornburg (Racke) <racke@linuxia.de>
b31a690 @jonjensen 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
17 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18 # MA 02111-1307 USA.
19
20 # Source debconf library
21 . /usr/share/debconf/confmodule
22
acf5157 @racke record threaded perl
racke authored
23 # Check for thread enabled Perl
24 PERLTHREADS=`perl -MConfig -e 'print $Config{usethreads} || $Config{useithreads} || $Config{use5005threads}'`
25
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
26 # Get interchange user and group
27 db_get interchange/user
28 USER=$RET
29 db_get interchange/group
30 GROUP=$RET
31
32 # Creating interchange group if he isn't already there
33 if ! grep -q ^$GROUP: /etc/group; then
34 echo Adding system group: $GROUP.
35 addgroup $GROUP
36 fi
37
38 # Creating interchange user if he isn't already there
39 if ! grep -q ^$USER: /etc/passwd; then
40 echo Adding system user: $USER.
41 adduser --system --ingroup $GROUP --home /usr/lib/interchange $USER
42 fi
43
44 # Ensure correct permissions for directories with log files resp. PID file
45 chown -R $USER.$GROUP /var/log/interchange
46 chmod 770 /var/log/interchange
47 chown -R $USER.$GROUP /var/run/interchange
48 chown -R $USER.$GROUP /usr/lib/cgi-bin/ic
49 chmod u+s /usr/lib/cgi-bin/ic/*
50
51 # Ensure correct permissions for catalog base directory
34b7fac @racke merged changes 2.6 vs 2.6.2.1
racke authored
52 # and static HTML base directory
53
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
54 chown $USER.$GROUP /var/lib/interchange/catalogs
34b7fac @racke merged changes 2.6 vs 2.6.2.1
racke authored
55 db_get interchange/docroot
4227902 @racke merged changes 2.6.2.1 vs 2.6.2.2
racke authored
56 if [ -d "$RET" ]; then
57 chown $USER.$GROUP "$RET"
58 fi
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
59
7457617 @racke merged changes 2.6.2.2 vs 2.6.2.3
racke authored
60 # More permissions
61
62 chown -R $USER.$GROUP /etc/interchange/usertag
a350a51 @racke directory designed for adding/removing catalogs from packages introduced
racke authored
63 chown -R $USER.$GROUP /var/lib/interchange/catalog.d
7457617 @racke merged changes 2.6.2.2 vs 2.6.2.3
racke authored
64
3a10e17 @racke comment improved
racke authored
65 # Record debconf configuration in multiple files
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
66 # 1. Stuff needed for the init script
67
68 INITCFG=/etc/interchange/init.cfg
69 cat > $INITCFG <<EOF
70 # This file is automatically generated !
71 #
72 # YOU MAY MODIFY THIS FILE
73 # But we recommend to use dpkg-reconfigure interchange instead.
74
75 EOF
76
77 db_get interchange/mode
78 case "$RET" in
79 "unix mode") MODE=--unix;;
80 "internet mode") MODE=--inetmode;;
44ac273 @racke specify unix and inet modes explicitly if user selects both
racke authored
81 "both") MODE="--unix --inetmode";;
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
82 esac
44ac273 @racke specify unix and inet modes explicitly if user selects both
racke authored
83 echo MODE=\"$MODE\" >> $INITCFG
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
84 echo USER=$USER >> $INITCFG
85 echo GROUP=$GROUP >> $INITCFG
86
87 db_get interchange/docroot
88 echo DOCROOT=$RET >> $INITCFG
89
fd79b4d @racke Debian packages support the selection of the GnuPG home directory
racke authored
90 db_get interchange/gpghome
60cb5cd @racke fixed GPG variable misnomers
racke authored
91 echo GPGHOME=$RET >> $INITCFG
fd79b4d @racke Debian packages support the selection of the GnuPG home directory
racke authored
92
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
93 # 2. Settings which influence the global configuration
94 # and make senses to be configured by debconf
75968a5 @racke Interchange variable MV_GETPPID_BROKEN has been added to
racke authored
95 # Additionally we place a variable to help Interchange
96 # running on installations with threaded Perls.
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
97
57f92e5 @racke pass debconf settings
racke authored
98 db_get interchange/debug
15f3e33 @racke translate true/false
racke authored
99 if [ "$RET" = true ]; then
100 DEBUG=1
101 else
102 DEBUG=0
103 fi
5cf2faa @racke FullURL setting now configurable from debconf
racke authored
104 db_get interchange/full_url
105 if [ "$RET" = true ]; then
106 FULL_URL=1
107 else
108 FULL_URL=0
109 fi
c2c2076 @racke SOAP server selection wasn't recorded in settings.cfg
racke authored
110 db_get interchange/cansoap
111 SOAP=0
112 if [ "$RET" = true ]; then
113 db_get interchange/soap
114 if [ "$RET" = true ]; then
115 SOAP=1
116 fi
117 fi
2d38b94 @racke Default traffic setting is low now.
racke authored
118 db_get interchange/traffic
119 TRAFFIC="$RET"
75968a5 @racke Interchange variable MV_GETPPID_BROKEN has been added to
racke authored
120
121 if [ "$PERLTHREADS" ]; then
122 HASTHREADS=1
123 else
124 HASTHREADS=0
125 fi
126
c2c2076 @racke SOAP server selection wasn't recorded in settings.cfg
racke authored
127 /usr/sbin/interchangeconfig DEBUG=$DEBUG FULL_URL=$FULL_URL SOAP=$SOAP TRAFFIC=$RET MV_GETPPID_BROKEN=$HASTHREADS
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
128
ec0e042 @racke recommit of changes put into the old branch
racke authored
129 # Make configuration files owned by the interchange user
130 chown -R $USER.$GROUP /etc/interchange
131
3485ca0 @racke work in progress
racke authored
132 # Check if we delay the startup
ef1be7f @racke restart server only once if both interchange and interchange-ui
racke authored
133 if [ -f /var/run/interchange-install ]; then
134 PACKAGES=""
135 exec 4</var/run/interchange-install
136 while read <&4 PKG; do
137 if [ ! "$PKG" = "interchange" ]; then
138 PACKAGES="$PKG $PACKAGES"
139 fi
140 done
141 if [ -z "$PACKAGES" ]; then
142 rm /var/run/interchange-install
143 else
144 exec 5>/var/run/interchange-install
145 for PKG in $PACKAGES; do
146 echo "$PKG" >&5
147 done
148 fi
149 fi
3485ca0 @racke work in progress
racke authored
150
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
151 #DEBHELPER#
152
153 # Don't wait on Interchange to close file handles
154 db_stop
155
156 exit 0
157
Something went wrong with that request. Please try again.