Re: [atomic-devel] Container runs under `runc` but not when wrapped by systemd

2018-02-05 Thread Derek Carter
Turns out my issue is with the version of ocitools that's installed.


On Mon, Feb 5, 2018 at 11:00 AM, Stephen Milner  wrote:
> On Mon, Feb 5, 2018 at 12:30 PM, Derek Carter  wrote:
>>> No problem! A quick side note: If postgresql-server isn't installed on
>>> the host system /var/run/postgresql won't exist. You may want to use a
>>> tmpfiles.template (and add it to the Dockerfile COPY) to make sure
>>> that the directory is present in that case :-)
>>
>> Yeah, I need to fix that.
>>
>> Also, system-buildah needs to bump the version of the config.json.template.
>>
>> --
>> Derek
>> aka goozbach
>>
>
> I realized there were some updates that hadn't been tagged for release
> so I've tagged 0.0.9
> (https://github.com/ashcrow/system-buildah/releases/tag/0.0.9).
> However, there wasn't any changes with the generated
> config.json.template. When you have some time please open up an issue
> against the repo with some more info an I'll be happy to look into
> fixing what you noticed.
>
> Let us know if you hit any more snags!
>
> --
> Thanks,
> Steve Milner
>
> Atomic | Red Hat | http://projectatomic.io/



Re: [atomic-devel] Container runs under `runc` but not when wrapped by systemd

2018-02-05 Thread Stephen Milner
On Mon, Feb 5, 2018 at 12:30 PM, Derek Carter  wrote:
>> No problem! A quick side note: If postgresql-server isn't installed on
>> the host system /var/run/postgresql won't exist. You may want to use a
>> tmpfiles.template (and add it to the Dockerfile COPY) to make sure
>> that the directory is present in that case :-)
>
> Yeah, I need to fix that.
>
> Also, system-buildah needs to bump the version of the config.json.template.
>
> --
> Derek
> aka goozbach
>

I realized there were some updates that hadn't been tagged for release
so I've tagged 0.0.9
(https://github.com/ashcrow/system-buildah/releases/tag/0.0.9).
However, there wasn't any changes with the generated
config.json.template. When you have some time please open up an issue
against the repo with some more info an I'll be happy to look into
fixing what you noticed.

Let us know if you hit any more snags!

-- 
Thanks,
Steve Milner

Atomic | Red Hat | http://projectatomic.io/



Re: [atomic-devel] Container runs under `runc` but not when wrapped by systemd

2018-02-05 Thread Derek Carter
> No problem! A quick side note: If postgresql-server isn't installed on
> the host system /var/run/postgresql won't exist. You may want to use a
> tmpfiles.template (and add it to the Dockerfile COPY) to make sure
> that the directory is present in that case :-)

Yeah, I need to fix that.

Also, system-buildah needs to bump the version of the config.json.template.

--
Derek
aka goozbach



Re: [atomic-devel] Container runs under `runc` but not when wrapped by systemd

2018-02-05 Thread Stephen Milner
On Mon, Feb 5, 2018 at 11:35 AM, Derek Carter  wrote:
> On Mon, Feb 5, 2018 at 7:30 AM, Stephen Milner  wrote:
>> From 
>> https://github.com/goozbach-atomic/postgres-9.4/blob/master/config.json.template#L4
>>
>> "terminal": true,
>>
>> On Mon, Feb 5, 2018 at 9:25 AM, Giuseppe Scrivano  
>> wrote:
>>> Hi Derek,
>>>
>>> it looks like the container is trying to use a terminal.
>>>
>>> Do you have "terminal": false in your config.json file?
>>>
>>> Regards,
>>> Giuseppe
>
> That was it!!!
>
> Thanks ya'll!
>
> --
> Derek
> aka goozbach
>

No problem! A quick side note: If postgresql-server isn't installed on
the host system /var/run/postgresql won't exist. You may want to use a
tmpfiles.template (and add it to the Dockerfile COPY) to make sure
that the directory is present in that case :-)

-- 
Thanks,
Steve Milner

Atomic | Red Hat | http://projectatomic.io/



Re: [atomic-devel] Container runs under `runc` but not when wrapped by systemd

2018-02-05 Thread Derek Carter
On Mon, Feb 5, 2018 at 7:30 AM, Stephen Milner  wrote:
> From 
> https://github.com/goozbach-atomic/postgres-9.4/blob/master/config.json.template#L4
>
> "terminal": true,
>
> On Mon, Feb 5, 2018 at 9:25 AM, Giuseppe Scrivano  wrote:
>> Hi Derek,
>>
>> it looks like the container is trying to use a terminal.
>>
>> Do you have "terminal": false in your config.json file?
>>
>> Regards,
>> Giuseppe

That was it!!!

Thanks ya'll!

--
Derek
aka goozbach



Re: [atomic-devel] Container runs under `runc` but not when wrapped by systemd

2018-02-05 Thread Stephen Milner
>From 
>https://github.com/goozbach-atomic/postgres-9.4/blob/master/config.json.template#L4

"terminal": true,

On Mon, Feb 5, 2018 at 9:25 AM, Giuseppe Scrivano  wrote:
> Hi Derek,
>
> it looks like the container is trying to use a terminal.
>
> Do you have "terminal": false in your config.json file?
>
> Regards,
> Giuseppe
>
>
>
> Derek Carter  writes:
>
>> I've created a container for postgres:
>> https://github.com/goozbach-atomic/postgres-9.4
>> I built it using system-buildah; it builds just fine, imports just
>> fine, and runs if I do the runc command directly:
>>
>> cd /var/lib/containers/atomic/postgres.0/ && runc --systemd-cgroup run
>> 'postgres'
>>
>> however if I use the systemd service to attempt to start it, it fails:
>>
>> (log here: https://gist.github.com/goozbach/614404f58a7a1ffaef0675bbd4d70f2c 
>> )
>>
>> I've turned SELinux to permissive to see if that was the issue (it wasn't).
>>
>> Here's the generated systemd unit file:
>>
>>
>> # cat /etc/systemd/system/postgres.service
>> [Unit]
>> Description=UNKNOWN
>>
>> [Service]
>> ExecStart=/bin/runc --systemd-cgroup run 'postgres'
>> ExecStop=/bin/runc --systemd-cgroup kill 'postgres'
>> Restart=on-failure
>> WorkingDirectory=/var/lib/containers/atomic/postgres.0
>>
>> [Install]
>> WantedBy=multi-user.target
>>
>>
>> I'm pretty well stumped at this point.
>>
>> Any ideas?
>>
>> --
>> Derek
>> aka goozbach
>



-- 
Thanks,
Steve Milner

Atomic | Red Hat | http://projectatomic.io/



Re: [atomic-devel] Container runs under `runc` but not when wrapped by systemd

2018-02-05 Thread Giuseppe Scrivano
Hi Derek,

it looks like the container is trying to use a terminal.

Do you have "terminal": false in your config.json file?

Regards,
Giuseppe



Derek Carter  writes:

> I've created a container for postgres:
> https://github.com/goozbach-atomic/postgres-9.4
> I built it using system-buildah; it builds just fine, imports just
> fine, and runs if I do the runc command directly:
>
> cd /var/lib/containers/atomic/postgres.0/ && runc --systemd-cgroup run
> 'postgres'
>
> however if I use the systemd service to attempt to start it, it fails:
>
> (log here: https://gist.github.com/goozbach/614404f58a7a1ffaef0675bbd4d70f2c )
>
> I've turned SELinux to permissive to see if that was the issue (it wasn't).
>
> Here's the generated systemd unit file:
>
>
> # cat /etc/systemd/system/postgres.service
> [Unit]
> Description=UNKNOWN
>
> [Service]
> ExecStart=/bin/runc --systemd-cgroup run 'postgres'
> ExecStop=/bin/runc --systemd-cgroup kill 'postgres'
> Restart=on-failure
> WorkingDirectory=/var/lib/containers/atomic/postgres.0
>
> [Install]
> WantedBy=multi-user.target
>
>
> I'm pretty well stumped at this point.
>
> Any ideas?
>
> --
> Derek
> aka goozbach