RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1263077 - add default options to etcd ExecStart in etcd.service
Summary: add default options to etcd ExecStart in etcd.service
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: etcd
Version: 7.1
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Jan Chaloupka
QA Contact: atomic-bugs@redhat.com
Depends On:
TreeView+ depends on / blocked
Reported: 2015-09-15 06:04 UTC by Guohua Ouyang
Modified: 2016-02-16 16:40 UTC (History)
2 users (show)

Fixed In Version: etcd-2.2.2-3.el7_2
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2016-02-16 16:40:00 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:0231 0 normal SHIPPED_LIVE etcd bug fix and enhancement update 2016-02-16 21:39:11 UTC

Description Guohua Ouyang 2015-09-15 06:04:05 UTC
Description of problem:
Current etcd run without any options at the command line, user have no idea what options is etcd running by checking the status of the service.

Add these default arguments to it like below, it will be very clear by then.
ExecStart=/bin/bash -c "GOMAXPROCS=$(nproc) /usr/bin/etcd --name=${ETCD_NAME} --data-dir=${ETCD_DATA_DIR} --listen-client-urls=${ETCD_LISTEN_CLIENT_URLS} --advertise-client-urls=${ETCD_ADVERTISE_CLIENT_URLS}"

# status etcd -l
etcd.service - Etcd Server
   Loaded: loaded (/usr/lib/systemd/system/etcd.service; enabled)
   Active: active (running) since Tue 2015-09-15 13:57:26 CST; 3min 53s ago
 Main PID: 22047 (etcd)
   CGroup: /system.slice/etcd.service
           └─22047 /usr/bin/etcd --name=default --data-dir=/var/lib/etcd/default.etcd --listen-client-urls=http://localhost:2379, --advertise-client-urls=http://localhost:2379,

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:

Actual results:

Expected results:

Additional info:

Comment 2 Jan Chaloupka 2015-09-15 07:34:22 UTC
Hi Guohua,

there is a lot of arguments that etcd supports. Which would be the primary? All of them? /etc/etcd/etcd.conf consists of environment variables which etcd reads. So this will work. However, it will duplicate what etcd already does.

I suppose reading from /proc/22047/environ is not user friendly and can be done only by root.

Comment 3 Guohua Ouyang 2015-09-15 08:19:23 UTC
Hi Jan,

I'm intending to only add those uncommented arguments in /etc/etcd/etcd.conf at first, after review the file again, I'd like to add those arguments which has URL, the list I want to see is:

# [member]


# if you use different ETCD_NAME (e.g. test), set ETCD_INITIAL_CLUSTER value for this name, i.e. "test=http://..."

How do you think?

Comment 4 Jan Chaloupka 2015-09-15 08:54:49 UTC
I see one problem. If a user decides to comment out ETCD_INITIAL_CLUSTER_STATE for example, etcd will get empty --initial-cluster-state option. It will not get set to default "new". It will need something like this:

etcd ... --initial-cluster-state=${ETCD_INITIAL_CLUSTER_STATE:-new} ...

The same for the remaining options.

Another problem is when default values will change. This will require awareness of a packager and continuous checking default and available values.

Otherwise don't see any other problem ATM.

Comment 5 Jan Chaloupka 2015-09-15 08:57:10 UTC
$ echo ${A:-http://localhost:2379}

works as expected as well.

Comment 6 Guohua Ouyang 2015-09-15 09:08:32 UTC
ah, that's a problem. users use default conf file will fail in many situation with these cluster arguments.

I'd like to fall back to these uncomment out arguments, only support these I added in the example.

Comment 7 Guohua Ouyang 2015-09-23 05:34:56 UTC
I tested that by adding these arguments in etcd.service, it cannot run proxy mode properly with or without --advertise-client-urls set.

Without --advertise-client-urls set, the error looks like below:
invalid value "" for flag -advertise-client-urls: URL scheme must be http or https:

With --advertise-client-urls set, etcdserver will try to set up the cluster with the advertised urls, which should not be presenting in proxy mode.

etcdserver: could not get cluster response from Get dial tcp connection refused

There maybe more different situations out there when proxy and cluster argument involved in.

I'd like to close this request at the moment.

Comment 8 Guohua Ouyang 2015-09-23 05:51:19 UTC
ah, it would be safe to add "--name=${ETCD_NAME} --data-dir=${ETCD_DATA_DIR} --listen-client-urls=${ETCD_LISTEN_CLIENT_URLS}".

It's helpful and looks enough to me.

Comment 11 Joy Pu 2016-01-08 13:11:12 UTC
Checked with following steps and seems it is fixed in etcd-2.2.2-5.el7

1. check the etcd.service file
 # cat /usr/lib/systemd/system/etcd.service |grep ExecStart
ExecStart=/bin/bash -c "GOMAXPROCS=$(nproc) /usr/bin/etcd --name=\"${ETCD_NAME}\" --data-dir=\"${ETCD_DATA_DIR}\" --listen-client-urls=\"${ETCD_LISTEN_CLIENT_URLS}\""

2. start etcd service and check the status with:
# systemctl status etcd -l
● etcd.service - Etcd Server
   Loaded: loaded (/usr/lib/systemd/system/etcd.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2016-01-08 05:41:38 EST; 10h ago
 Main PID: 885 (etcd)
   CGroup: /system.slice/etcd.service
           └─885 /usr/bin/etcd --name=default --data-dir=/var/lib/etcd/default.etcd --listen-client-urls=http://localhost:2379

So update this one to VERIFIED

Comment 13 errata-xmlrpc 2016-02-16 16:40:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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