summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a478c23)
raw | patch | inline | side by side (parent: a478c23)
author | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 16 Sep 2008 16:25:56 +0000 (16:25 +0000) | ||
committer | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 16 Sep 2008 16:25:56 +0000 (16:25 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@12490 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/debian/gosa-si-server.postinst | patch | blob | history | |
gosa-si/debian/rules | patch | blob | history | |
gosa-si/debian/templates | patch | blob | history |
index ccbf8c3c942fbdc3ea6d21b613cc3dfea3f7f66e..cae8615a6d6164aac92dbdf6c5116de23dd03c71 100644 (file)
#!/bin/sh
+set -e
+
+. /usr/share/debconf/confmodule
+
+db_version 2.0
+
+for i in hostname database username password rootpw; do
+ db_get gosa-si/db$i || true
+ eval db$i'="$RET"'
+done
+
+dbhost="127.0.0.1"
+
#DEBHELPER#
# We exit unless the package is being configured
*) exit 0;
esac
+# Setup database
+/usr/bin/mysqladmin -u root --password="$rootpw" create "$database" &> /dev/null
+/usr/bin/mysql -u root --password="$rootpw" -e "GRANT ALL PRIVILEGES ON $database.* to \'$username\'@\'127.0.0.1\' identified by '$password'"
+
# Fix permission
[ -f /etc/gosa-si/server.conf ] && chmod go-rwx /etc/gosa-si/server.conf
+# Apply DB settings to config file
+if [ -w /etc/gosa-si/server.conf ]; then
+ for i in database username password host; do
+ eval 'val=$'$i
+ grep -E "$i" /etc/gosa-si/server.conf | grep -vE '^ *#'
+ if [ $? -eq 0 ]; then
+ sed -i "/\[server\]/,/\[/s/mysql-$i\s*=\s*\(.*\)$/mysql-$i = $val/g" /etc/gosa-si/server.conf
+ else
+ sed -i "
+ /\[server\]/ a\
+mysql-$i = $val" /etc/gosa-si/server.conf
+ fi
+ done
+fi
+
# Restart daemon
invoke-rc.d gosa-si restart
diff --git a/gosa-si/debian/rules b/gosa-si/debian/rules
index 892de833cbcea10e684d584719876dd7e1926dcd..96893b185366688526863212f821378c9a409ed6 100755 (executable)
--- a/gosa-si/debian/rules
+++ b/gosa-si/debian/rules
dh_installchangelogs
dh_installman
dh_installlogrotate
- #dh_installdebconf
+ dh_installdebconf
dh_installinit --init-script=gosa-si -- start 00 2 3 4 5 . stop 29 1 .
chmod 640 debian/gosa-si-server/etc/gosa-si/server.conf debian/gosa-si-client/etc/gosa-si/client.conf
index 369fd97435708fb77a650427effa6fa0b8fa562a..119524367fb92bba28f5b920c31e317d3ba61501 100644 (file)
--- a/gosa-si/debian/templates
+++ b/gosa-si/debian/templates
+Template: gosa-si/hostname
+Type: string
+Default: 127.0.0.1
+Description: Hostname or IP of the MySQL-Server
+ Please enter the full-qualified hostname or IP Address of the desired MySQL Host.
+
Template: gosa-si/database
Type: string
Default: gosa_si
-_Description: Name of the GOsa-SI Database
+Description: Name of the GOsa-SI Database
Please choose a name for the gosa-si database.
-Template: gosa-si/host
-Type: boolean
-Default: true
-_Description: Does the database server run on this host?
- Please choose if the database server runs on this host or not.
-
-Template: gosa-si/automagic
-Type: boolean
-Default: true
-_Description: Should the database be created?
- Please choose if you want the setup to create the gosa-si database
- and a privileged user account.
-
Template: gosa-si/username
Type: string
Default: gosa_si
-_Description: Name of the GOsa-SI Database User
+Description: Name of the GOsa-SI Database User
Please choose a name for the gosa-si database user.
Template: gosa-si/password
Type: password
-_Description: Password for the GOsa-SI Database User
+Description: Password for the GOsa-SI Database User
Please enter a password for the gosa-si database user.
+
+Template: gosa-si/rootpw
+Type: password
+Description: Password for the Database Administrator 'root'
+ In order to create the privileged account, setup needs the password of the
+ database administrator. Please enter the password of the database user 'root'.