Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 130 lines (106 sloc) 3.35 kb
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
1 #! /bin/sh
2 #
a350a51 Stefan Hornburg (Racke) directory designed for adding/removing catalogs from packages introduced
racke authored
3 # Copyright 2001,2002 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
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 Stefan Hornburg (Racke) merged changes 2.6 vs 2.6.2.1
racke authored
49 # and static HTML base directory
50
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
51 chown $USER.$GROUP /var/lib/interchange/catalogs
34b7fac Stefan Hornburg (Racke) merged changes 2.6 vs 2.6.2.1
racke authored
52 db_get interchange/docroot
4227902 Stefan Hornburg (Racke) merged changes 2.6.2.1 vs 2.6.2.2
racke authored
53 if [ -d "$RET" ]; then
54 chown $USER.$GROUP "$RET"
55 fi
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
56
7457617 Stefan Hornburg (Racke) merged changes 2.6.2.2 vs 2.6.2.3
racke authored
57 # More permissions
58
59 chown -R $USER.$GROUP /etc/interchange/usertag
a350a51 Stefan Hornburg (Racke) directory designed for adding/removing catalogs from packages introduced
racke authored
60 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
61
3a10e17 Stefan Hornburg (Racke) comment improved
racke authored
62 # Record debconf configuration in multiple files
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
63 # 1. Stuff needed for the init script
64
65 INITCFG=/etc/interchange/init.cfg
66 cat > $INITCFG <<EOF
67 # This file is automatically generated !
68 #
69 # YOU MAY MODIFY THIS FILE
70 # But we recommend to use dpkg-reconfigure interchange instead.
71
72 EOF
73
74 db_get interchange/mode
75 case "$RET" in
76 "unix mode") MODE=--unix;;
77 "internet mode") MODE=--inetmode;;
78 "both") MODE="";;
79 esac
80 echo MODE=$MODE >> $INITCFG
81 echo USER=$USER >> $INITCFG
82 echo GROUP=$GROUP >> $INITCFG
83
84 db_get interchange/docroot
85 echo DOCROOT=$RET >> $INITCFG
86
fd79b4d Stefan Hornburg (Racke) Debian packages support the selection of the GnuPG home directory
racke authored
87 db_get interchange/gpghome
88 echo GPGHOME=$GPGHOME >> $INITCFG
89
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
90 # 2. Settings which influence the global configuration
91 # and make senses to be configured by debconf
92
57f92e5 Stefan Hornburg (Racke) pass debconf settings
racke authored
93 db_get interchange/debug
15f3e33 Stefan Hornburg (Racke) translate true/false
racke authored
94 if [ "$RET" = true ]; then
95 DEBUG=1
96 else
97 DEBUG=0
98 fi
57f92e5 Stefan Hornburg (Racke) pass debconf settings
racke authored
99 /usr/sbin/interchangeconfig DEBUG=$DEBUG
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
100
ec0e042 Stefan Hornburg (Racke) recommit of changes put into the old branch
racke authored
101 # Make configuration files owned by the interchange user
102 chown -R $USER.$GROUP /etc/interchange
103
3485ca0 Stefan Hornburg (Racke) work in progress
racke authored
104 # Check if we delay the startup
ef1be7f Stefan Hornburg (Racke) restart server only once if both interchange and interchange-ui
racke authored
105 if [ -f /var/run/interchange-install ]; then
106 PACKAGES=""
107 exec 4</var/run/interchange-install
108 while read <&4 PKG; do
109 if [ ! "$PKG" = "interchange" ]; then
110 PACKAGES="$PKG $PACKAGES"
111 fi
112 done
113 if [ -z "$PACKAGES" ]; then
114 rm /var/run/interchange-install
115 else
116 exec 5>/var/run/interchange-install
117 for PKG in $PACKAGES; do
118 echo "$PKG" >&5
119 done
120 fi
121 fi
3485ca0 Stefan Hornburg (Racke) work in progress
racke authored
122
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
123 #DEBHELPER#
124
125 # Don't wait on Interchange to close file handles
126 db_stop
127
128 exit 0
129
Something went wrong with that request. Please try again.