Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-31 Thread Daniel Campbell
On 08/28/2016 11:15 AM, William Hubbs wrote: > Ok all, > > here is what openrc-0.22 is going to do in terms of setting the host > name. > > If /etc/hostname exists, the first word of that file will be used as the > host name. > Otherwise, if the value is set in /etc/conf.d/hostname it will be

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-28 Thread William Hubbs
Ok all, here is what openrc-0.22 is going to do in terms of setting the host name. If /etc/hostname exists, the first word of that file will be used as the host name. Otherwise, if the value is set in /etc/conf.d/hostname it will be used. Otherwise, OpenRC will not touch the hostname. One

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-28 Thread Rich Freeman
On Sun, Aug 28, 2016 at 11:29 AM, Patrick Lauer wrote: > > (and what abuse? it did exactly what it was supposed to do quite nicely, > until it stopped doing that. Now you need to track state and hope you > don't have race conditions ... ) > You were tracking state before; in

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-28 Thread Patrick Lauer
On 08/28/2016 04:21 PM, Michał Górny wrote: > On Sun, 28 Aug 2016 14:34:20 +0200 > Patrick Lauer wrote: > >> On 08/28/2016 08:30 AM, Daniel Campbell wrote: >>> On 08/24/2016 09:42 AM, Zac Medico wrote: On 08/24/2016 09:33 AM, Michael Orlitzky wrote: > * no

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-28 Thread Michał Górny
On Sun, 28 Aug 2016 14:34:20 +0200 Patrick Lauer wrote: > On 08/28/2016 08:30 AM, Daniel Campbell wrote: > > On 08/24/2016 09:42 AM, Zac Medico wrote: > >> On 08/24/2016 09:33 AM, Michael Orlitzky wrote: > >>> * no benefit put forth so far, other than that it's the same

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-28 Thread Rich Freeman
On Sun, Aug 28, 2016 at 8:34 AM, Patrick Lauer wrote: > > Then tools forgot to properly update mtab because hurr why u no symlink > to /proc/mounts (oh wait, /proc/self/mounts ) > > So everyone migrated to /etc/mtab as a symlink (even OpenRC, because > everyone does it) > I

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-28 Thread Patrick Lauer
On 08/28/2016 08:30 AM, Daniel Campbell wrote: > On 08/24/2016 09:42 AM, Zac Medico wrote: >> On 08/24/2016 09:33 AM, Michael Orlitzky wrote: >>> * no benefit put forth so far, other than that it's the same file that >>> systemd uses, which is true but not beneficial as far as I can tell >>

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-28 Thread Zac Medico
On 08/27/2016 11:30 PM, Daniel Campbell wrote: > On 08/24/2016 09:42 AM, Zac Medico wrote: >> On 08/24/2016 09:33 AM, Michael Orlitzky wrote: >>> * no benefit put forth so far, other than that it's the same file that >>> systemd uses, which is true but not beneficial as far as I can tell >>

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-28 Thread Daniel Campbell
On 08/27/2016 11:48 PM, Michał Górny wrote: > On Sat, 27 Aug 2016 23:30:09 -0700 > Daniel Campbell wrote: > >> On 08/24/2016 09:42 AM, Zac Medico wrote: >>> On 08/24/2016 09:33 AM, Michael Orlitzky wrote: * no benefit put forth so far, other than that it's the same file

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-28 Thread M. J. Everitt
On 28/08/16 07:30, Daniel Campbell wrote: > On 08/24/2016 09:42 AM, Zac Medico wrote: >> On 08/24/2016 09:33 AM, Michael Orlitzky wrote: >>> * no benefit put forth so far, other than that it's the same file that >>> systemd uses, which is true but not beneficial as far as I can tell >> It's

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-28 Thread Michał Górny
On Sat, 27 Aug 2016 23:30:09 -0700 Daniel Campbell wrote: > On 08/24/2016 09:42 AM, Zac Medico wrote: > > On 08/24/2016 09:33 AM, Michael Orlitzky wrote: > >> * no benefit put forth so far, other than that it's the same file that > >> systemd uses, which is true but not

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-28 Thread Daniel Campbell
On 08/24/2016 09:42 AM, Zac Medico wrote: > On 08/24/2016 09:33 AM, Michael Orlitzky wrote: >> * no benefit put forth so far, other than that it's the same file that >> systemd uses, which is true but not beneficial as far as I can tell > > It's a de facto standard. Being different for the

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-24 Thread Cédric Krier
On 2016-08-24 22:23, Consus wrote: > On 09:42 Wed 24 Aug, Zac Medico wrote: > > On 08/24/2016 09:33 AM, Michael Orlitzky wrote: > > > * no benefit put forth so far, other than that it's the same file that > > > systemd uses, which is true but not beneficial as far as I can tell > > > > It's

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-24 Thread Consus
On 09:42 Wed 24 Aug, Zac Medico wrote: > On 08/24/2016 09:33 AM, Michael Orlitzky wrote: > > * no benefit put forth so far, other than that it's the same file that > > systemd uses, which is true but not beneficial as far as I can tell > > It's a de facto standard. Being different for the

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-24 Thread Zac Medico
On 08/24/2016 09:33 AM, Michael Orlitzky wrote: > * no benefit put forth so far, other than that it's the same file that > systemd uses, which is true but not beneficial as far as I can tell It's a de facto standard. Being different for the sake of being different is not a virtue in cases

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-24 Thread Michael Orlitzky
On 08/24/2016 12:22 PM, Zac Medico wrote: > > Seems like something we could automate in pkg_posinst of the openrc > ebuild, but probably also deserves a news item. > Or in the systemd ebuild =P I'll drop this, I've made my peace: * adding another configuration file is inconsistent with

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-24 Thread Zac Medico
On 08/24/2016 09:06 AM, Michael Orlitzky wrote: > On 08/24/2016 11:49 AM, Mike Gilbert wrote: >> >> You're right that the orignal purpose of the change has been debunked. >> >> So, starting over: one real benefit would be cross-compatibility with >> systemd. It's one less thing people would need

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-24 Thread Michael Orlitzky
On 08/24/2016 11:49 AM, Mike Gilbert wrote: > > You're right that the orignal purpose of the change has been debunked. > > So, starting over: one real benefit would be cross-compatibility with > systemd. It's one less thing people would need to reconfigure when > migrating to/from openrc. > I

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-24 Thread Mike Gilbert
On Wed, Aug 24, 2016 at 7:42 AM, Michael Orlitzky wrote: > On 08/24/2016 07:37 AM, Daniel Campbell wrote: >> >> I imagine _someone_ out there wants it, otherwise we wouldn't be >> discussing it. > > The thread started out proposing it as a solution to a docker problem > that, it

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-24 Thread Rich Freeman
On Wed, Aug 24, 2016 at 7:42 AM, Michael Orlitzky wrote: > On 08/24/2016 07:37 AM, Daniel Campbell wrote: >> >> I imagine _someone_ out there wants it, otherwise we wouldn't be >> discussing it. > > The thread started out proposing it as a solution to a docker problem > that, it

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-24 Thread Michael Orlitzky
On 08/24/2016 07:37 AM, Daniel Campbell wrote: > > I imagine _someone_ out there wants it, otherwise we wouldn't be > discussing it. The thread started out proposing it as a solution to a docker problem that, it turns out, isn't a problem. Why are we still trying to fixing something that isn't

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-24 Thread Daniel Campbell
On 08/24/2016 04:17 AM, Michael Orlitzky wrote: > On 08/24/2016 03:12 AM, Daniel Campbell wrote: >>> >> That seems like a fair compromise. Those who want /etc/hostname get to >> use it, those who don't won't need to change anything. >> > > Does anyone want it? This feels like a legacy backwards

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-24 Thread Michael Orlitzky
On 08/24/2016 03:12 AM, Daniel Campbell wrote: >> > That seems like a fair compromise. Those who want /etc/hostname get to > use it, those who don't won't need to change anything. > Does anyone want it? This feels like a legacy backwards compatibility hack that we're adding after it's obsolete,

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-24 Thread Rich Freeman
On Wed, Aug 24, 2016 at 2:52 AM, Christian Kniep wrote: > Hey there, > > as for the /etc/hostname when sharing /etc/ as a volume… This ain’t a > problem as /etc/hostname is taken care of by the docker-engine (in previous > versions they used it to discover other hosts). >

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-24 Thread Daniel Campbell
On 08/23/2016 12:57 PM, William Hubbs wrote: > On Tue, Aug 23, 2016 at 02:45:20PM -0400, Rich Freeman wrote: >> Symlinking /proc into /etc/hostname is still useful because it not >> only handles container hostnames (keep in mind that two containers >> could share the same /etc), but it also covers

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-24 Thread Christian Kniep
On second thought I put in the —hostname flags, to make it clearer. Before it was a digest from the container-id, which was not telling in the example… $ docker run -d -v /etc/ --name host1 --hostname host1 ubuntu tail -f /dev/null 6a85473421368051efec9b6f55991a5c3b4150c575a0724695cdad99f7a26e06

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-24 Thread Christian Kniep
Hey there, as for the /etc/hostname when sharing /etc/ as a volume… This ain’t a problem as /etc/hostname is taken care of by the docker-engine (in previous versions they used it to discover other hosts). As you can see in the snippet below, /etc/hostname is local, while it is possible to create

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-23 Thread William Hubbs
On Tue, Aug 23, 2016 at 04:25:30PM -0400, Rich Freeman wrote: > On Tue, Aug 23, 2016 at 3:57 PM, William Hubbs wrote: > > > > I am planning to change the logic in /etc/init.d/hostname so that if > > /etc/hostname exists, the first word out of that file will be used as > > the

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-23 Thread Rich Freeman
On Tue, Aug 23, 2016 at 3:57 PM, William Hubbs wrote: > > I am planning to change the logic in /etc/init.d/hostname so that if > /etc/hostname exists, the first word out of that file will be used as > the hostname rather than any setting in /etc/conf.d/hostname. If you >

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-23 Thread Marc Schiffbauer
* Rich Freeman schrieb am 22.08.16 um 20:29 Uhr: > On Mon, Aug 22, 2016 at 1:51 PM, Sven Vermeulen wrote: > > > > Yes, wouldn't the Docker project be happy to take on a patch that uses > > gethostname() or so? > > > > This might be another option: symlink to

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-23 Thread William Hubbs
On Tue, Aug 23, 2016 at 02:45:20PM -0400, Rich Freeman wrote: > Symlinking /proc into /etc/hostname is still useful because it not > only handles container hostnames (keep in mind that two containers > could share the same /etc), but it also covers cases where the > hostname changes, and it

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-23 Thread Rich Freeman
On Tue, Aug 23, 2016 at 8:26 AM, Christian Kniep wrote: > Hey Rich, > > nice idea, but unfortunately this provides the hostname of the container > itself. > As it should. /etc/hostname inside a container should contain the hostname of the container. It shouldn't actually be

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-23 Thread Michael Orlitzky
My mental model is wrong so I'm probably about to say something stupid. I'm not familiar with the way docker works so bear with me... On 08/23/2016 03:01 AM, Christian Kniep wrote: > > ### > $ docker service create --name nginx --mode=global -e > SERVICE_HOSTNAME=$(hostname -f) nginx > ###

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-23 Thread Christian Kniep
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

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-23 Thread Michael Orlitzky
On 08/22/2016 06:09 PM, William Hubbs wrote: > > Someone here at the office was wanting a cross-platform way to find out > the hostname of the host the container is running on inside the > container. We made another suggestion for that, so forget about the > docker angle on this for now. > >

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-23 Thread Rich Freeman
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 >

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-23 Thread Christian Kniep
Hey y’all, just to elaborate on the problem and clear up the fuzz I made. I am facing to be distro-agnostic, thus I do not know in advance if I am running on DockerForMac (which uses Alpine Linux), some weird Ubuntu vagrant setup of mine or a fleet of gentoo hosts. Docker Service schedules the

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-22 Thread William Hubbs
On Mon, Aug 22, 2016 at 09:28:44PM +0200, Hans de Graaff wrote: > On Mon, 2016-08-22 at 10:58 -0500, William Hubbs wrote: > > All, > > > > it looks like app-emulation/docker expects /etc/hostname to exist. > > Is there a bug for this? docker seems to work fine for me on a system > without this

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-22 Thread William Hubbs
On Mon, Aug 22, 2016 at 09:28:44PM +0200, Hans de Graaff wrote: > On Mon, 2016-08-22 at 10:58 -0500, William Hubbs wrote: > > All, > > > > it looks like app-emulation/docker expects /etc/hostname to exist. > > Is there a bug for this? docker seems to work fine for me on a system > without this

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-22 Thread Hans de Graaff
On Mon, 2016-08-22 at 10:58 -0500, William Hubbs wrote: > All, > > it looks like app-emulation/docker expects /etc/hostname to exist. Is there a bug for this? docker seems to work fine for me on a system without this file present. Hans signature.asc Description: This is a digitally signed

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-22 Thread Dirkjan Ochtman
On Mon, Aug 22, 2016 at 5:58 PM, William Hubbs wrote: > On Gentoo, this file does not exist, so I'm wondering how we can make it > exist? Not sure if/how related, but when I have: djc@enrai ~ $ cat /etc/conf.d/hostname # Set to the hostname of this machine hostname="enrai"

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-22 Thread Rich Freeman
On Mon, Aug 22, 2016 at 1:51 PM, Sven Vermeulen wrote: > > Yes, wouldn't the Docker project be happy to take on a patch that uses > gethostname() or so? > This might be another option: symlink to /proc/sys/kernel/hostname I'm not sure if somebody can find a flaw in this. It

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-22 Thread Matthew Thode
On 08/22/2016 10:58 AM, William Hubbs wrote: > All, > > it looks like app-emulation/docker expects /etc/hostname to exist. > > On Gentoo, this file does not exist, so I'm wondering how we can make it > exist? > > I know in OpenRC I can read it and use the value there as the hostname > instead

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-22 Thread Sven Vermeulen
On Mon, Aug 22, 2016 at 01:28:50PM -0400, Michael Orlitzky wrote: > On 08/22/2016 11:58 AM, William Hubbs wrote: > > All, > > > > it looks like app-emulation/docker expects /etc/hostname to exist. > > > > Isn't there some kind of portable operating system standard that says > how to do these

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-22 Thread Matthew Thode
On 08/22/2016 10:58 AM, William Hubbs wrote: > All, > > it looks like app-emulation/docker expects /etc/hostname to exist. > > On Gentoo, this file does not exist, so I'm wondering how we can make it > exist? > > I know in OpenRC I can read it and use the value there as the hostname > instead

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-22 Thread Rich Freeman
On Mon, Aug 22, 2016 at 1:03 PM, William Hubbs wrote: > > I'm not sure about putting this in /run for a couple of reasons: > > The contents of this file is a setting, like /etc/conf.d/hostname, which > will be set by the user. There is no reason a script can't populate /run

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-22 Thread Michael Orlitzky
On 08/22/2016 11:58 AM, William Hubbs wrote: > All, > > it looks like app-emulation/docker expects /etc/hostname to exist. > Isn't there some kind of portable operating system standard that says how to do these things?

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-22 Thread William Hubbs
On Mon, Aug 22, 2016 at 12:39:03PM -0400, Rich Freeman wrote: > On Mon, Aug 22, 2016 at 12:11 PM, M. J. Everitt wrote: > > On 22/08/16 16:58, William Hubbs wrote: > >> > >> it looks like app-emulation/docker expects /etc/hostname to exist. > >> > >> On Gentoo, this file does

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-22 Thread Rich Freeman
On Mon, Aug 22, 2016 at 12:11 PM, M. J. Everitt wrote: > On 22/08/16 16:58, William Hubbs wrote: >> >> it looks like app-emulation/docker expects /etc/hostname to exist. >> >> On Gentoo, this file does not exist, so I'm wondering how we can make it >> exist? >> >> I know in

Re: [gentoo-dev] rfc: /etc/hostname on gentoo

2016-08-22 Thread M. J. Everitt
On 22/08/16 16:58, William Hubbs wrote: > All, > > it looks like app-emulation/docker expects /etc/hostname to exist. > > On Gentoo, this file does not exist, so I'm wondering how we can make it > exist? > > I know in OpenRC I can read it and use the value there as the hostname > instead of