Bug 1380160 - Type=notify unable to honor sd-notify processes
Summary: Type=notify unable to honor sd-notify processes
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: runc
Version: 7.3
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Lokesh Mandvekar
QA Contact: atomic-bugs@redhat.com
Yoana Ruseva
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-28 19:40 UTC by Qian Cai
Modified: 2017-08-01 19:43 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 19:43:57 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Qian Cai 2016-09-28 19:40:19 UTC
Description of problem:
Trying to add Type=notify to system containers unit file in order to catch errors from runc start.

# cat /etc/systemd/system/etcd.service 
[Unit]
Description=Etcd Server
After=network.target
After=network-online.target
Wants=network-online.target

[Service]
Type=notify
ExecStart=/bin/runc start 'etcd'
ExecStop=/bin/runc kill 'etcd'
Restart=on-failure
WorkingDirectory=/sysroot/ostree/deploy/rhel-atomic-host/var/lib/containers/atomic/etcd.0
RuntimeDirectory=etcd

[Install]
WantedBy=multi-user.target

However, it ends up with "systemctl start etcd" hang. Steps to reproduce below,

# atomic uninstall etcd
# runc delete etcd
# atomic install --system --name=etcd brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888/rhel7/etcd:latest
# systemctl start etcd

Only thing seems to get it working is to append -d to runc start in the unit file, but that causes both runc list and atomic containers list not correctly list the running containers.

# rpm -q runc atomic
runc-0.1.1-6.el7.x86_64
atomic-1.12.5-2.el7.x86_64

Developer confirmed that etcd is a sd-notify process, and the original etcd rpm uses Type=notify as well.

# cat /usr/lib/systemd/system/etcd.service 
[Unit]
Description=Etcd Server
After=network.target
After=network-online.target
Wants=network-online.target

[Service]
Type=notify
WorkingDirectory=/var/lib/etcd/
EnvironmentFile=-/etc/etcd/etcd.conf
User=etcd
# set GOMAXPROCS to number of processors
ExecStart=/bin/bash -c "GOMAXPROCS=$(nproc) /usr/bin/etcd --name=\"${ETCD_NAME}\" --data-dir=\"${ETCD_DATA_DIR}\" --listen-client-urls=\"${ETCD_LISTEN_CLIENT_URLS}\""
Restart=on-failure
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target

Comment 3 Qian Cai 2017-01-26 14:54:47 UTC
This one is still broken with the latest bits. Any progress?

Comment 4 Mrunal Patel 2017-02-06 22:49:17 UTC
See https://github.com/opencontainers/runc/pull/1308

Comment 5 Qian Cai 2017-03-14 19:42:06 UTC
Lokesh, this patch is now merged upstream, how do you think of rebasing runc in 7.3.4?

Comment 6 Lokesh Mandvekar 2017-03-14 19:43:57 UTC
sure thing, I"ll rebase


Note You need to log in before you can comment on or make changes to this bug.