[Pkg-samba-maint] r901 - in branches/samba4: . po
Steinar H. Gunderson
sesse at costa.debian.org
Fri Jan 6 00:47:10 UTC 2006
Author: sesse
Date: 2006-01-06 00:47:06 +0000 (Fri, 06 Jan 2006)
New Revision: 901
Added:
branches/samba4/samba-common.config
branches/samba4/samba-common.postinst
branches/samba4/samba-common.templates
Modified:
branches/samba4/po/POTFILES.in
branches/samba4/po/templates.pot
branches/samba4/samba.config
branches/samba4/samba.postinst
branches/samba4/samba.templates
Log:
Implemented (but not tested!) the new bootstrapping code.
Modified: branches/samba4/po/POTFILES.in
===================================================================
--- branches/samba4/po/POTFILES.in 2006-01-06 00:13:30 UTC (rev 900)
+++ branches/samba4/po/POTFILES.in 2006-01-06 00:47:06 UTC (rev 901)
@@ -1 +1,2 @@
[type: gettext/rfc822deb] samba.templates
+[type: gettext/rfc822deb] samba-common.templates
Modified: branches/samba4/po/templates.pot
===================================================================
--- branches/samba4/po/templates.pot 2006-01-06 00:13:30 UTC (rev 900)
+++ branches/samba4/po/templates.pot 2006-01-06 00:47:06 UTC (rev 901)
@@ -3,11 +3,12 @@
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: jelmer at samba.org\n"
-"POT-Creation-Date: 2006-01-05 18:06+0100\n"
+"POT-Creation-Date: 2006-01-06 01:46+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
"Language-Team: LANGUAGE <LL at li.org>\n"
@@ -56,13 +57,13 @@
#. Type: string
#. Description
-#: ../samba.templates:23
+#: ../samba-common.templates:3
msgid "Realm"
msgstr ""
#. Type: string
#. Description
-#: ../samba.templates:23
+#: ../samba-common.templates:3
msgid ""
"What Kerberos realm will your server be in? In many cases, this will be the "
"same as your DNS domain name (ie. YOUR.REALM)."
@@ -70,13 +71,13 @@
#. Type: string
#. Description
-#: ../samba.templates:29
+#: ../samba-common.templates:9
msgid "Domain"
msgstr ""
#. Type: string
#. Description
-#: ../samba.templates:29
+#: ../samba-common.templates:9
msgid ""
"What will be the domain of your server? This is also known as the \"workgroup"
"\" of your server, and is typically a short name without any dots (ie. "
Added: branches/samba4/samba-common.config
===================================================================
--- branches/samba4/samba-common.config 2006-01-06 00:13:30 UTC (rev 900)
+++ branches/samba4/samba-common.config 2006-01-06 00:47:06 UTC (rev 901)
@@ -0,0 +1,20 @@
+#! /bin/sh
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+db_title "Samba Server"
+
+#
+# See if we have an smb.conf. If not, we ask for realm and domain
+# so we can generate a new one.
+#
+if [ ! -f /etc/samba/smb.conf ]; then
+ db_input medium samba-common/realm || true
+ db_go || true
+
+ db_input medium samba-common/domain || true
+ db_go || true
+fi
+
Added: branches/samba4/samba-common.postinst
===================================================================
--- branches/samba4/samba-common.postinst 2006-01-06 00:13:30 UTC (rev 900)
+++ branches/samba4/samba-common.postinst 2006-01-06 00:47:06 UTC (rev 901)
@@ -0,0 +1,29 @@
+#! /bin/sh
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+if [ "$1" = "configure" ]; then
+ # Don't overwrite an existing smb.conf file.
+ if [ -f /etc/samba/smb.conf ]; then
+ exit
+ fi
+
+ db_get samba/realm || true
+ REALM="$RET"
+
+ db_get samba/domain || true
+ DOMAIN="$RET"
+
+ HOSTNAME=$( hostname -s )
+
+ if [ -n "$REALM" -a -n "$DOMAIN" ]; then
+ cat <<EOF >/etc/samba/smb.conf
+[globals]
+ netbios name = $HOSTNAME
+ workgroup = $DOMAIN
+ realm = $REALM
+EOF
+ fi
+fi
Added: branches/samba4/samba-common.templates
===================================================================
--- branches/samba4/samba-common.templates 2006-01-06 00:13:30 UTC (rev 900)
+++ branches/samba4/samba-common.templates 2006-01-06 00:47:06 UTC (rev 901)
@@ -0,0 +1,12 @@
+Template: samba-common/realm
+Type: string
+_Description: Realm
+ What Kerberos realm will your server be in? In many cases, this will be
+ the same as your DNS domain name (ie. YOUR.REALM).
+
+Template: samba-common/domain
+Type: string
+_Description: Domain
+ What will be the domain of your server? This is also known as the
+ "workgroup" of your server, and is typically a short name without any dots
+ (ie. DOMAIN).
Modified: branches/samba4/samba.config
===================================================================
--- branches/samba4/samba.config 2006-01-06 00:13:30 UTC (rev 900)
+++ branches/samba4/samba.config 2006-01-06 00:47:06 UTC (rev 901)
@@ -6,29 +6,30 @@
db_title "Samba Server"
-# See if we're upgrading from Samba 3
-if [ "$1" = "configure" -a -n "$2" ]; then
+if [ "$1" == "configure" ]; then
+ #
+ # Are we upgrading from Samba 3, and already have a configuration file?
+ # If so, the user might want to try the automatic upgrading.
+ #
if dpkg --compare-versions "$2" lt "3.9.0"; then
- db_input medium samba/upgrade-from-v3 || true
- db_go || true
-
- db_get samba/upgrade-from-v3
- if [ "$RET" = "true" ]; then
- exit
+ if [ -f /etc/samba/smb.conf ]; then
+ db_input medium samba/upgrade-from-v3 || true
+ db_go || true
fi
fi
-fi
-db_input medium samba/setup-pdc || true
-db_go || true
+ #
+ # First-time installation, perhaps? If so, the user could want to
+ # set up Samba as a PDC, if the other parameters are in place.
+ #
+ db_get samba/realm || true
+ REALM="$RET"
-db_get samba/setup-pdc
+ db_get samba/domain || true
+ DOMAIN="$RET"
-if [ "$RET" = "true" ]; then
- db_input medium samba/realm || true
- db_go || true
-
- db_input medium samba/domain || true
- db_go || true
+ if [ -z "$2" -a -n "$REALM" -a -n "$DOMAIN" ]; then
+ db_input medium samba/setup-pdc || true
+ db_go || true
+ fi
fi
-
Modified: branches/samba4/samba.postinst
===================================================================
--- branches/samba4/samba.postinst 2006-01-06 00:13:30 UTC (rev 900)
+++ branches/samba4/samba.postinst 2006-01-06 00:47:06 UTC (rev 901)
@@ -17,19 +17,17 @@
fi
else
db_get samba/setup-pdc || true
+ db_stop
if [ "$RET" = "true" ]; then
- db_get samba/realm
- REALM="$RET"
+ # add "server role = pdc" to [globals]
+ if grep -q '^\[globals\]' /etc/samba/smb.conf; then
+ grep -v '^\s*server role\s*=' /etc/samba/smb.conf |
+ sed 's/\[globals\]/&\n\tserver role = pdc/i' > /etc/samba/smb.conf.new
+ mv /etc/samba/smb.conf.new /etc/samba/smb.conf
+ fi
- db_get samba/domain
- DOMAIN="$RET"
-
- db_stop
-
- /usr/lib/samba/setup/provision --realm="$REALM" --domain="$DOMAIN"
- else
- db_stop
+ /usr/lib/samba/setup/provision
fi
fi
else
Modified: branches/samba4/samba.templates
===================================================================
--- branches/samba4/samba.templates 2006-01-06 00:13:30 UTC (rev 900)
+++ branches/samba4/samba.templates 2006-01-06 00:47:06 UTC (rev 901)
@@ -17,16 +17,3 @@
Note that even if you answer "yes", you will need to set up DNS such that
it serves the data from the zone file in that directory before you can use
your Active Directory domain.
-
-Template: samba/realm
-Type: string
-_Description: Realm
- What Kerberos realm will your server be in? In many cases, this will be
- the same as your DNS domain name (ie. YOUR.REALM).
-
-Template: samba/domain
-Type: string
-_Description: Domain
- What will be the domain of your server? This is also known as the
- "workgroup" of your server, and is typically a short name without any dots
- (ie. DOMAIN).
More information about the Pkg-samba-maint
mailing list