From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3EF88138330 for ; Tue, 23 Aug 2016 12:26:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 367FD21C127; Tue, 23 Aug 2016 12:26:11 +0000 (UTC) Received: from mail-oi0-f47.google.com (mail-oi0-f47.google.com [209.85.218.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 20E1221C0A9 for ; Tue, 23 Aug 2016 12:26:09 +0000 (UTC) Received: by mail-oi0-f47.google.com with SMTP id f189so193081226oig.3 for ; Tue, 23 Aug 2016 05:26:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gaikai-com.20150623.gappssmtp.com; s=20150623; h=from:in-reply-to:references:mime-version:date:message-id:subject:to; bh=kScR0Y5spfXHNpfm1OsJ8HGu/lfYwL4BDxkzFXJRv9w=; b=sUknIKJ2AS2qlueVVD77XvSvFhmWRb8sx9Rey9lhbKzG19VOQjpLFPioSwWvX75eol q1/vcAj1aXIsCr3I3m9Zh6fdI0cgMIP/556Ij2CQwkxa+suSWn32FJE45kxLY1A7u5wq 1fpC27dUTdrlCGBdrcjZW5NeqVEQE524ndMsSHj0/zzVsIhwZuulBpnrnoGPujkSXeFx Qh2L0giqCjQE4mFNZtzJ0owXto8IKFl/CgJ0w57k42FMNk/jBEVZZbexESIqrufRBN43 WV7XDN9KPoFthrile+g/GGiJF7TTMivyEURLtV9W5KpdA2dWPN+Zpw4fa+u4cKVHOMM3 Qq7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to; bh=kScR0Y5spfXHNpfm1OsJ8HGu/lfYwL4BDxkzFXJRv9w=; b=Cgvt5mLx94PxK/Sy/n9GriQkJF5j2BesKvOYT37i0N1f73MY8t/XtvMt8Xy5Qz4FMM yJ7lTgPuZhBTZXj5BK8ewCywRAYa9zEUYa5Zcr1vJasYUxTOeYlnftGmqziEzIx55/6F pvm2PuFU4DSzXJYEwGhjeQ698VT9dJAV3AHka4Cfum/MXsdXcYO3AAMaJ66waUtjz6p6 1Q2vG5OGXMO+eYKYUeh+TEAQTyicP8SddPCi7/1l5wK9LcNxTW5XyXFExYo/p66PfibA RBnSnLg2rXBjfWFu+JSXZNJ5nxb/rAfu1R6EDgLiZgRqqt0+w8JfiHXyHe6Br77w1amW kl2A== X-Gm-Message-State: AEkoouvwyNruyA9ISC7oNbvaQZgJw8KegvKukEbFTk510X1JjWuo7TKbcEFACbe2aJJDPg/8DfzMbvwAXcpzuOAQ X-Received: by 10.157.44.10 with SMTP id f10mr15481222otb.13.1471955169248; Tue, 23 Aug 2016 05:26:09 -0700 (PDT) Received: from 1058052472880 named unknown by gmailapi.google.com with HTTPREST; Tue, 23 Aug 2016 05:26:08 -0700 From: Christian Kniep In-Reply-To: References: <20160822155808.GA16219@whubbs1.gaikai.biz> <1471894124.32381.0.camel@gentoo.org> <20160822220925.GB18116@whubbs1.gaikai.biz> X-Mailer: Airmail (382) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Date: Tue, 23 Aug 2016 05:26:08 -0700 Message-ID: Subject: Re: [gentoo-dev] rfc: /etc/hostname on gentoo To: gentoo-dev@lists.gentoo.org, Rich Freeman Content-Type: multipart/alternative; boundary=94eb2c033cf2fd2076053abc4420 X-Archives-Salt: ddda52b3-719f-40db-bd2f-30565b0db565 X-Archives-Hash: c4b6cebba454f2d61bb432d2c361e350 --94eb2c033cf2fd2076053abc4420 Content-Type: text/plain; charset=UTF-8 Hey Rich, nice idea, but unfortunately this provides the hostname of the container itself. $ docker run -ti -v /proc/sys/kernel/hostname:/etc/docker-hostname:ro nginx bash root@bea048d42fc3:/# cat /etc/docker-hostname bea048d42fc3 root@bea048d42fc3:/# Without digging deep into it I reckon that the proc (and the sys) filesystems are treated differently, to be sure that each container is in a distinct /proc filesystem. Cheers Christian On 23 August 2016 at 12:01:49, Rich Freeman (rich0@gentoo.org) wrote: On Tue, Aug 23, 2016 at 2:39 AM, Daniel Campbell wrote: > > It makes a bit more sense to rely on previous configuration > (/etc/conf.d/hostname) and write a tiny 'script' that populates > /etc/hostname. bash could do it (naively) in two lines: > > source /etc/conf.d/hostname > echo "$hostname" > /etc/hostname > Seems to me that symlinking /proc/sys/kernel/hostname would be simpler. Also, more reliable, because there are other ways the hostname could be set other than from /etc/conf.d/hostname. The hostname can also change. -- Rich --94eb2c033cf2fd2076053abc4420 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Hey Rich,

nice idea, but unfortunately this provides the hostname of the container= itself.

$ docker run -ti -v /proc/sys/kernel/hostname:/etc/docker-hostna=
me:ro nginx bash
root@bea048d42fc3:/# cat /etc/docker-hostname
bea048d42fc3
root@bea048d42fc3:/#

Without digging deep into it I reckon that the proc (and the sys) filesy= stems are treated differently, to be sure that each container is in a disti= nct /proc filesystem.

Cheers Christian




On 23 August 2016= at 12:01:49, Rich Freeman (rich0@gento= o.org) wrote:

On Tue, Aug 23, 2016 at 2:39 AM, Daniel Campbell <zlg@gentoo.org> wrote:
>
> It makes a bit more sense to rely on previous configuration
> (/etc/conf.d/hostname) and write a tiny 'script' that popu= lates
> /etc/hostname. bash could do it (naively) in two lines:
>
> source /etc/conf.d/hostname
> echo "$hostname" > /etc/hostname
>

Seems to me that symlinking /proc/sys/kernel/hostname would be
simpler. Also, more reliable, because there are other ways the
hostname could be set other than from /etc/conf.d/hostname. The
hostname can also change.

-- =20
Rich

=

--94eb2c033cf2fd2076053abc4420--