BTS

Issue1315

Title grml-debootstrap does not use the supplied hostname for /etc/mailname
Priority bug Status resolved
Superseder Nosy List sometimesfood
Assigned To Topics grml-debootstrap

Created on 2014-08-27.12:39:10 by sometimesfood, last changed 2014-10-02.10:01:21 by mika.

Messages
msg4854 (view) Author: mika Date: 2014-10-02.10:01:20
We believe that your issue has been closed by the upload of
Version 0.66 of grml-debootstrap from Michael Prokop <mika@grml.org>.
The explanation is attached below

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Thu, 02 Oct 2014 11:39:54 +0200
Source: grml-debootstrap
Binary: grml-debootstrap
Architecture: source all
Version: 0.66
Distribution: unstable
Urgency: medium
Maintainer: Grml Team <team@grml.org>
Changed-By: Michael Prokop <mika@grml.org>
Description:
 grml-debootstrap - wrapper around debootstrap for installing pure Debian
Changes:
 grml-debootstrap (0.66) unstable; urgency=medium
 .
   [ Michael Prokop ]
   * [cd8a1e5] Provide 'make shellcheck' for syntax checks, enable during
     package build
   * [6efce15] Execute wrap-and-sort on debian directory
   * [856786f] Bump Standards-Version to 3.9.6
 .
   [ Patrick Schleizer ]
   * [430c060] Adjust locale handling (LANG/LANGUAGE) to match with Debian
     wheezy defaults
 .
   [ Markus Rekkenbeil ]
   * [9b9cdfe] Add set process for /etc/mailname [Closes: issue1315]
Checksums-Sha1:
 8d3e51462fc8bc882099fd147c747a455c9905b3 1163 grml-debootstrap_0.66.dsc
 d4c0d87a3da8a7cfd04834ddd26e456274961efa 148828 grml-debootstrap_0.66.tar.xz
 ea345bb5129809866df7b20b61c598458e849ec1 121474 grml-debootstrap_0.66_all.deb
Checksums-Sha256:
 d9499abc2bacaeaf385ecc0e5e60692fe119e39d6230be87572d265b37e26b6b 1163 grml-debootstrap_0.66.dsc
 7dd3034c39a0eedf2283a542051c42d4918b37dd70af296d48a488d6ebec9209 148828 grml-debootstrap_0.66.tar.xz
 f8cb459a2b9ef797b377f1294ef1c483030a8203e88b97599228dcc9fa7951b4 121474 grml-debootstrap_0.66_all.deb
Files:
 b1e354abcf2ea92318a0f1d5dc9ea204 121474 admin optional grml-debootstrap_0.66_all.deb
 d1a8a6c83e4791a4d0d92d83135e0b5d 1163 admin optional grml-debootstrap_0.66.dsc
 cb8b42a935bd50d8b833d81e73191995 148828 admin optional grml-debootstrap_0.66.tar.xz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlQtIBsACgkQ2N9T+zficugD5ACfZjb2+YLfqo7LIgdbX8ZTgetY
u7kAnApqGuRieutQsGA//nfSTbZRkdoP
=ZWHN
-----END PGP SIGNATURE-----
msg4845 (view) Author: mika Date: 2014-08-30.19:05:11
This is fixed in Git, thanks to bionix for the fix!
msg4844 (view) Author: bionix Date: 2014-08-28.14:46:27
Thanks for the hint. I fixed the mixup @ Github.
msg4843 (view) Author: sometimesfood Date: 2014-08-28.14:17:21
Looks good to me (except for the variable name mixup; details in the pull request's 
comments section).
msg4841 (view) Author: bionix Date: 2014-08-28.11:35:16
I found a working solution to support setting the /etc/mailname,if you use the option -
-hostname in the grml-debootstrap command.
https://github.com/grml/grml-debootstrap/pull/34
Please checked it. My tests are working.
msg4840 (view) Author: bionix Date: 2014-08-27.14:19:56
Yes, the /etc/mailname is generated by postfix postinstall script.
The chroot-script from grml-debootstrap set the /etc/hosts and /etc/postfix/main.cf via 
search-and-replace (buzzword: grml).

Maybe a fix is something like this in the chroot-script file (at hostname function)...
echo `hostname -f` > /etc/mailname
msg4839 (view) Author: sometimesfood Date: 2014-08-27.13:44:05
As far as I can tell, /etc/mailname is created by the postfix postinstall script.

root@foobar ~ # debconf-get-selections | grep mailname
postfix	postfix/mailname	string	grml.mycurrentdomain.tld

I'm not sure whether the mail name should be fixed by preseeding or if it should be set 
in the hostname function in chroot-script, too.
msg4838 (view) Author: bionix Date: 2014-08-27.13:29:49
Hi,
I checked the chroot-script and the current function for setting the hostname set no 
/etc/mailname.
msg4837 (view) Author: sometimesfood Date: 2014-08-27.12:46:48
The device paths in grml-debootstrap should be /dev/vda and /dev/vda1, of course. Sorry 
about that.
msg4836 (view) Author: sometimesfood Date: 2014-08-27.12:39:10
When using grml-debootstrap to deploy wheezy on a grml 2014.03 system, the mail name in 
/etc/mailname is always set to "grml.mycurrentdomain.tld", no matter what hostname is 
supplied to grml-debootstrap via the "--host" command line option.

Steps to reproduce on a grml 2014.03 system:

root@grml ~ # echo ';' | sfdisk /dev/vda
root@grml ~ # grml-debootstrap --arch amd64 --filesystem ext4 \
    --grub /dev/sda --hostname foobar --release wheezy \
    --password secret --target /dev/sda1
# [...]
root@grml ~ # hostname
grml
root@grml ~ # mount /dev/vda1 /mnt
root@grml ~ # cat /mnt/etc/mailname
grml.mycurrentdomain.tld

What I would expect to see:

root@grml ~ # cat /mnt/etc/mailname
foobar.mycurrentdomain.tld
History
Date User Action Args
2014-10-02 10:01:21mikasetstatus: fixed-in-git -> resolved
messages: + msg4854
2014-08-30 19:05:11mikasetstatus: chatting -> fixed-in-git
messages: + msg4845
2014-08-28 14:46:27bionixsetmessages: + msg4844
2014-08-28 14:17:21sometimesfoodsetmessages: + msg4843
2014-08-28 14:16:52sometimesfoodsetmessages: - msg4842
2014-08-28 14:16:29sometimesfoodsetmessages: + msg4842
2014-08-28 11:35:16bionixsetmessages: + msg4841
2014-08-27 14:19:56bionixsetmessages: + msg4840
2014-08-27 13:44:06sometimesfoodsetmessages: + msg4839
2014-08-27 13:29:49bionixsetmessages: + msg4838
2014-08-27 12:46:48sometimesfoodsetstatus: unread -> chatting
messages: + msg4837
2014-08-27 12:39:10sometimesfoodcreate