* [PATCH] systemd: Use ${ROOT_HOME} instead of /root
@ 2014-09-03 19:57 Dan McGregor
2014-09-05 9:14 ` Burton, Ross
0 siblings, 1 reply; 7+ messages in thread
From: Dan McGregor @ 2014-09-03 19:57 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
From: Dan McGregor <dan.mcgregor@usask.ca>
systemd avoids using nss lookups for the root user, so
naturally it assumes that root's home directory is /root.
In OE that's not the case, and it can lead to long delays when
shutting down due to user shutdown unit failures.
Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
---
meta/recipes-core/systemd/systemd_216.bb | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/meta/recipes-core/systemd/systemd_216.bb
b/meta/recipes-core/systemd/systemd_216.bb
index a7fd71e..e6b79d2 100644
--- a/meta/recipes-core/systemd/systemd_216.bb
+++ b/meta/recipes-core/systemd/systemd_216.bb
@@ -97,6 +97,10 @@ do_configure_prepend() {
cp -r ${S}/units ${S}/units.pre_sed
fi
sed -i -e 's:=/root:=${ROOT_HOME}:g' ${S}/units/*.service*
+ sed -i -e 's:"/root":"${ROOT_HOME}":g' \
+ ${S}/src/core/unit-printf.c \
+ ${S}/src/nspawn/nspawn.c \
+ ${S}/src/shared/util.c
sed -i '/ln --relative --help/d' ${S}/configure.ac
sed -i -e 's:\$(LN_S) --relative -f:lnr:g' ${S}/Makefile.am
sed -i -e 's:\$(LN_S) --relative:lnr:g' ${S}/Makefile.am
--
1.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] systemd: Use ${ROOT_HOME} instead of /root
2014-09-03 19:57 [PATCH] systemd: Use ${ROOT_HOME} instead of /root Dan McGregor
@ 2014-09-05 9:14 ` Burton, Ross
2014-09-05 14:55 ` Dan McGregor
0 siblings, 1 reply; 7+ messages in thread
From: Burton, Ross @ 2014-09-05 9:14 UTC (permalink / raw)
To: Dan McGregor; +Cc: Patches and discussions about the oe-core layer
On 3 September 2014 20:57, Dan McGregor <danismostlikely@gmail.com> wrote:
> sed -i -e 's:=/root:=${ROOT_HOME}:g' ${S}/units/*.service*
> + sed -i -e 's:"/root":"${ROOT_HOME}":g' \
> + ${S}/src/core/unit-printf.c \
> + ${S}/src/nspawn/nspawn.c \
> + ${S}/src/shared/util.c
Sedding service files is one thing, but entire C files is another.
Can you please sent this change as a patch to the source? FWIW for
patches where the context isn't that relevant I've started using
patches without the context lines so there's more chance of them
applying in future releases.
Ross
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] systemd: Use ${ROOT_HOME} instead of /root
2014-09-05 9:14 ` Burton, Ross
@ 2014-09-05 14:55 ` Dan McGregor
2014-09-05 15:27 ` Burton, Ross
0 siblings, 1 reply; 7+ messages in thread
From: Dan McGregor @ 2014-09-05 14:55 UTC (permalink / raw)
To: Burton, Ross; +Cc: Patches and discussions about the oe-core layer
On 5 September 2014 03:14, Burton, Ross <ross.burton@intel.com> wrote:
> On 3 September 2014 20:57, Dan McGregor <danismostlikely@gmail.com> wrote:
>> sed -i -e 's:=/root:=${ROOT_HOME}:g' ${S}/units/*.service*
>> + sed -i -e 's:"/root":"${ROOT_HOME}":g' \
>> + ${S}/src/core/unit-printf.c \
>> + ${S}/src/nspawn/nspawn.c \
>> + ${S}/src/shared/util.c
>
> Sedding service files is one thing, but entire C files is another.
> Can you please sent this change as a patch to the source? FWIW for
> patches where the context isn't that relevant I've started using
> patches without the context lines so there's more chance of them
> applying in future releases.
I thought that myself, but ${ROOT_HOME} is a variable. I think to do
that a patch would
need to make the root home directory configurable, and not simply
hardcode it. That shouldn't
be too hard to do. I'll do that later tonight.
>
> Ross
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] systemd: Use ${ROOT_HOME} instead of /root
2014-09-05 14:55 ` Dan McGregor
@ 2014-09-05 15:27 ` Burton, Ross
2014-09-05 15:31 ` Mark Hatle
0 siblings, 1 reply; 7+ messages in thread
From: Burton, Ross @ 2014-09-05 15:27 UTC (permalink / raw)
To: Dan McGregor; +Cc: Patches and discussions about the oe-core layer
On 5 September 2014 15:55, Dan McGregor <danismostlikely@gmail.com> wrote:
> On 5 September 2014 03:14, Burton, Ross <ross.burton@intel.com> wrote:
>> On 3 September 2014 20:57, Dan McGregor <danismostlikely@gmail.com> wrote:
>>> sed -i -e 's:=/root:=${ROOT_HOME}:g' ${S}/units/*.service*
>>> + sed -i -e 's:"/root":"${ROOT_HOME}":g' \
>>> + ${S}/src/core/unit-printf.c \
>>> + ${S}/src/nspawn/nspawn.c \
>>> + ${S}/src/shared/util.c
>>
>> Sedding service files is one thing, but entire C files is another.
>> Can you please sent this change as a patch to the source? FWIW for
>> patches where the context isn't that relevant I've started using
>> patches without the context lines so there's more chance of them
>> applying in future releases.
>
> I thought that myself, but ${ROOT_HOME} is a variable. I think to do
> that a patch would
> need to make the root home directory configurable, and not simply
> hardcode it. That shouldn't
> be too hard to do. I'll do that later tonight.
Sed the patch? :)
Creative solutions welcome, I'm just wary of such loose seds in source
code. If the only sane way is to sed then that's what we'll have to
do.
Ross
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] systemd: Use ${ROOT_HOME} instead of /root
2014-09-05 15:27 ` Burton, Ross
@ 2014-09-05 15:31 ` Mark Hatle
2014-09-05 15:53 ` Burton, Ross
0 siblings, 1 reply; 7+ messages in thread
From: Mark Hatle @ 2014-09-05 15:31 UTC (permalink / raw)
To: openembedded-core
On 9/5/14, 10:27 AM, Burton, Ross wrote:
> On 5 September 2014 15:55, Dan McGregor <danismostlikely@gmail.com> wrote:
>> On 5 September 2014 03:14, Burton, Ross <ross.burton@intel.com> wrote:
>>> On 3 September 2014 20:57, Dan McGregor <danismostlikely@gmail.com> wrote:
>>>> sed -i -e 's:=/root:=${ROOT_HOME}:g' ${S}/units/*.service*
>>>> + sed -i -e 's:"/root":"${ROOT_HOME}":g' \
>>>> + ${S}/src/core/unit-printf.c \
>>>> + ${S}/src/nspawn/nspawn.c \
>>>> + ${S}/src/shared/util.c
>>>
>>> Sedding service files is one thing, but entire C files is another.
>>> Can you please sent this change as a patch to the source? FWIW for
>>> patches where the context isn't that relevant I've started using
>>> patches without the context lines so there's more chance of them
>>> applying in future releases.
>>
>> I thought that myself, but ${ROOT_HOME} is a variable. I think to do
>> that a patch would
>> need to make the root home directory configurable, and not simply
>> hardcode it. That shouldn't
>> be too hard to do. I'll do that later tonight.
>
> Sed the patch? :)
>
> Creative solutions welcome, I'm just wary of such loose seds in source
> code. If the only sane way is to sed then that's what we'll have to
> do.
I'd prefer a patch that used a define myself. I don't like seds of source or
patches...
--Mark
> Ross
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-09-05 18:09 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-03 19:57 [PATCH] systemd: Use ${ROOT_HOME} instead of /root Dan McGregor
2014-09-05 9:14 ` Burton, Ross
2014-09-05 14:55 ` Dan McGregor
2014-09-05 15:27 ` Burton, Ross
2014-09-05 15:31 ` Mark Hatle
2014-09-05 15:53 ` Burton, Ross
2014-09-05 18:09 ` Dan McGregor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox