Run db_sync commands as the proper users

keystone-manage db_sync creates a log file
/var/log/keystone/keystone.log (and other db_sync commands create similar
logs in their respective directories).  If run as root, the log file is
owned by root.  In some cases (keystone), this prevents services from
starting.  In other cases (e.g. glance-api), it prevents the service
from writing to its log file.  Thus, all db_sync commands were changed
to run them as the correct users for the services being configured.
Note: this does not appear to be a problem with Ubuntu, but I made the
change for all distros for consistency, since it will not harm anything
to run db_sync as the correct user on Ubuntu, even if it is not
necessary.  Feel free to -1 this if you think there should be an
OS-specific step instead.

Change-Id: Idd8ea62cf883edcc7b308d25292d8b18d2631330
Closes-Bug: #1308316
This commit is contained in:
Jeff Shantz 2014-04-15 23:26:34 -04:00
parent 5aee056419
commit 5d3bcf4502
5 changed files with 5 additions and 6 deletions

View File

@ -53,7 +53,7 @@ connection = mysql://cinder:<replaceable>CINDER_DBPASS</replaceable>@<replaceabl
<step os="ubuntu;rhel;centos;fedora;opensuse;sles"> <step os="ubuntu;rhel;centos;fedora;opensuse;sles">
<para>Create the database tables for the Block Storage <para>Create the database tables for the Block Storage
service:</para> service:</para>
<screen><prompt>#</prompt> <userinput>cinder-manage db sync</userinput></screen> <screen><prompt>#</prompt> <userinput>su -s /bin/sh -c "cinder-manage db sync" cinder</userinput></screen>
</step> </step>
<step os="rhel;centos;fedora;opensuse;sles;ubuntu"> <step os="rhel;centos;fedora;opensuse;sles;ubuntu">
<para>Create a <literal>cinder</literal> user.</para> <para>Create a <literal>cinder</literal> user.</para>

View File

@ -125,7 +125,7 @@ IDENTIFIED BY '<replaceable>GLANCE_DBPASS</replaceable>';</userinput></screen>
</step> </step>
<step os="ubuntu;rhel;centos;fedora;opensuse;sles"> <step os="ubuntu;rhel;centos;fedora;opensuse;sles">
<para>Create the database tables for the Image Service:</para> <para>Create the database tables for the Image Service:</para>
<screen><prompt>#</prompt> <userinput>glance-manage db_sync</userinput></screen> <screen><prompt>#</prompt> <userinput>su -s /bin/sh -c "glance-manage db_sync" glance</userinput></screen>
</step> </step>
<step os="rhel;centos;fedora;opensuse;sles;ubuntu"> <step os="rhel;centos;fedora;opensuse;sles;ubuntu">
<para>Create a <literal>glance</literal> user that the Image <para>Create a <literal>glance</literal> user that the Image

View File

@ -64,7 +64,7 @@ IDENTIFIED BY '<replaceable>HEAT_DBPASS</replaceable>';</userinput></screen>
</step> </step>
<step os="fedora;centos;rhel;ubuntu"> <step os="fedora;centos;rhel;ubuntu">
<para>Create the heat service tables:</para> <para>Create the heat service tables:</para>
<screen><prompt>#</prompt> <userinput>heat-manage db_sync</userinput></screen> <screen><prompt>#</prompt> <userinput>su -s /bin/sh -c "heat-manage db_sync" heat</userinput></screen>
<note> <note>
<para>Ignore <errortext>DeprecationWarning</errortext> <para>Ignore <errortext>DeprecationWarning</errortext>
errors.</para> errors.</para>

View File

@ -61,9 +61,8 @@ connection = mysql://keystone:<replaceable>KEYSTONE_DBPASS</replaceable>@<replac
</step> </step>
<step os="ubuntu;rhel;centos;fedora;opensuse;sles"> <step os="ubuntu;rhel;centos;fedora;opensuse;sles">
<para>Create the database tables for the Identity Service:</para> <para>Create the database tables for the Identity Service:</para>
<screen><prompt>#</prompt> <userinput>keystone-manage db_sync</userinput></screen> <screen><prompt>#</prompt> <userinput>su -s /bin/sh -c "keystone-manage db_sync" keystone</userinput></screen>
</step> </step>
<step os="debian"> <step os="debian">
<para>Define an authorization token to use as a shared secret <para>Define an authorization token to use as a shared secret
between the Identity Service and other OpenStack services. between the Identity Service and other OpenStack services.

View File

@ -121,7 +121,7 @@ IDENTIFIED BY '<replaceable>NOVA_DBPASS</replaceable>';</userinput></screen>
</step> </step>
<step os="ubuntu;rhel;centos;fedora;opensuse;sles"> <step os="ubuntu;rhel;centos;fedora;opensuse;sles">
<para>Create the Compute service tables:</para> <para>Create the Compute service tables:</para>
<screen><prompt>#</prompt> <userinput>nova-manage db sync</userinput></screen> <screen><prompt>#</prompt> <userinput>su -s /bin/sh -c "nova-manage db sync" nova</userinput></screen>
</step> </step>
<step os="rhel;centos;fedora;opensuse;sles;ubuntu"> <step os="rhel;centos;fedora;opensuse;sles;ubuntu">
<para>Create a <literal>nova</literal> user that Compute uses to <para>Create a <literal>nova</literal> user that Compute uses to