You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cloudstack.apache.org by "Martijn Koster (JIRA)" <ji...@apache.org> on 2015/03/08 13:19:38 UTC

[jira] [Commented] (CLOUDSTACK-4556) "12.10. Creating a Linux Template" sethostname script problems

    [ https://issues.apache.org/jira/browse/CLOUDSTACK-4556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14352023#comment-14352023 ] 

Martijn Koster commented on CLOUDSTACK-4556:
--------------------------------------------

Pierre-Luc: this bug is rather old. I ran into problems with the current 4.4 sethostname script from the docs too; that's described in the last paragraph of http://www.greenhills.co.uk/2015/02/23/cloudstack-4.4-single-server-on-ubuntu-14.04.1-with-kvm.html

>  "12.10. Creating a Linux Template" sethostname script problems
> ---------------------------------------------------------------
>
>                 Key: CLOUDSTACK-4556
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-4556
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: Doc
>    Affects Versions: 4.1.1
>            Reporter: Martijn Koster
>            Assignee: Pierre-Luc Dion
>
> In the nightly build doc http://jenkins.cloudstack.org/view/master/job/build-docs-admin-master/lastSuccessfulBuild/artifact/Apache_CloudStack-4.2.0-Admin_Guide-en-US.pdf
> section "12.10. Creating a Linux Template", there is a sethostname script, which has several issues:
> The script appears to assume that it is called once, and that at that time the dhcp leases file has info in it.
> What I've seen happen is that the first time it is invoked, the leases file is empty, and the script then destroys
> /etc/hosts and /etc/hostname because it does no checking, and the second time when the leases file has the required info, the hostname is no longer "localhost", so the script is skipped. And this approach is strange anyway: the script goes through effort to extract values from the leases file, but it doesn't need to -- they are passed in by dhclient.
> It calls "dpkg-reconfig" on https://github.com/apache/cloudstack/blob/922ef76224d4a8534f67f47b97cf664e5c65ecba/docs/en-US/prepare-linux-template.xml#L104 which should be "dpkg-reconfigure" on my ubuntu 12.04 instance:
> root@test3:~# which dpkg-reconfig
> root@test3:~# which dpkg-reconfigure
> /usr/sbin/dpkg-reconfigure
> root@test3:~# uname -a
> Linux test3 3.5.0-23-generic #35~precise1-Ubuntu SMP Fri Jan 25 17:13:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
> It would also be nice to set DEBIAN_FRONTEND=noninteractive such that dpkg-reconfigure doesn't cause debconf frontend warnings in the log.
> In https://github.com/apache/cloudstack/blob/922ef76224d4a8534f67f47b97cf664e5c65ecba/docs/en-US/prepare-linux-template.xml#L108 it sets user/group execute permissions for the script, but that is not required. dhclient-script(8) documents "invoked using the ´.´ command", and the other scripts in the /etc/dhcp/dhclient-exit-hooks.d/ directory have mode 644.
> I'm working on an alternative in https://gist.github.com/makuk66/6379642 which appears to work but could do with some more testing.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)