Skip to content
Newer
Older
100644 120 lines (99 sloc) 3.06 KB
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
1 #! /bin/sh
2 #
3 # Copyright 2001 by Stefan Hornburg (Racke) <racke@linuxia.de>
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
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.
32 addgroup $GROUP
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
41 # Ensure correct permissions for directories with log files resp. PID file
42 chown -R $USER.$GROUP /var/log/interchange
43 chmod 770 /var/log/interchange
44 chown -R $USER.$GROUP /var/run/interchange
45 chown -R $USER.$GROUP /usr/lib/cgi-bin/ic
46 chmod u+s /usr/lib/cgi-bin/ic/*
47
48 # Ensure correct permissions for catalog base directory
34b7fac @racke merged changes 2.6 vs 2.6.2.1
racke authored
49 # and static HTML base directory
50
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
51 chown $USER.$GROUP /var/lib/interchange/catalogs
34b7fac @racke merged changes 2.6 vs 2.6.2.1
racke authored
52 db_get interchange/docroot
53 chown $USER.$GROUP "$RET"
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
54
3a10e17 @racke comment improved
racke authored
55 # Record debconf configuration in multiple files
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
56 # 1. Stuff needed for the init script
57
58 INITCFG=/etc/interchange/init.cfg
59 cat > $INITCFG <<EOF
60 # This file is automatically generated !
61 #
62 # YOU MAY MODIFY THIS FILE
63 # But we recommend to use dpkg-reconfigure interchange instead.
64
65 EOF
66
67 db_get interchange/mode
68 case "$RET" in
69 "unix mode") MODE=--unix;;
70 "internet mode") MODE=--inetmode;;
71 "both") MODE="";;
72 esac
73 echo MODE=$MODE >> $INITCFG
74 echo USER=$USER >> $INITCFG
75 echo GROUP=$GROUP >> $INITCFG
76
77 db_get interchange/docroot
78 echo DOCROOT=$RET >> $INITCFG
79
80 # 2. Settings which influence the global configuration
81 # and make senses to be configured by debconf
82
57f92e5 @racke pass debconf settings
racke authored
83 db_get interchange/debug
15f3e33 @racke translate true/false
racke authored
84 if [ "$RET" = true ]; then
85 DEBUG=1
86 else
87 DEBUG=0
88 fi
57f92e5 @racke pass debconf settings
racke authored
89 /usr/sbin/interchangeconfig DEBUG=$DEBUG
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
90
ec0e042 @racke recommit of changes put into the old branch
racke authored
91 # Make configuration files owned by the interchange user
92 chown -R $USER.$GROUP /etc/interchange
93
3485ca0 @racke work in progress
racke authored
94 # Check if we delay the startup
ef1be7f @racke restart server only once if both interchange and interchange-ui
racke authored
95 if [ -f /var/run/interchange-install ]; then
96 PACKAGES=""
97 exec 4</var/run/interchange-install
98 while read <&4 PKG; do
99 if [ ! "$PKG" = "interchange" ]; then
100 PACKAGES="$PKG $PACKAGES"
101 fi
102 done
103 if [ -z "$PACKAGES" ]; then
104 rm /var/run/interchange-install
105 else
106 exec 5>/var/run/interchange-install
107 for PKG in $PACKAGES; do
108 echo "$PKG" >&5
109 done
110 fi
111 fi
3485ca0 @racke work in progress
racke authored
112
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
113 #DEBHELPER#
114
115 # Don't wait on Interchange to close file handles
116 db_stop
117
118 exit 0
119
Something went wrong with that request. Please try again.