All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Ohly <patrick.ohly@intel.com>
To: Jonathan Liu <net147@gmail.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: systemd + run-postinsts.service
Date: Tue, 24 Mar 2015 08:59:36 +0100	[thread overview]
Message-ID: <1427183976.3412.96.camel@intel.com> (raw)
In-Reply-To: <551094C1.8020507@gmail.com>

On Tue, 2015-03-24 at 09:33 +1100, Jonathan Liu wrote:
> I am not sure how well systemd works with executing systemctl to 
> manipulate services from within a service that is starting...
>
> What is the definition of foobar.service?

Manipulating services within a service works. You were on the right
track when suspecting a dependency deadlock.

> foobar.service may depend on other services/mounts/targets to start 
> before it but since "systemctl start" is blocking, those dependencies 
> may not be satisfied yet until sometime after run-postinsts.service 
> which can result in a circular dependency deadlock. See 
> DefaultDependencies, After, Before in 
> http://www.freedesktop.org/software/systemd/man/systemd.unit.html.
> 
> Things to try:
> 1. Refactor foobar.service and your image recipe to not require calling 
> systemctl from within a systemd service
> 2. Change "systemctl start foobar" to "systemctl start --no-block 
> foobar" to let the startup continue without waiting until foobar is started

"--no-block" did indeed help. The recipe uses only the default
dependencies, but that already seems enough to prevent starting it at
the time when run-postinsts.service runs.

I guess the situation hasn't come up before. But when it does, it
probably breaks systemd.bbclass for most services. I wonder whether
--no-block should be added unconditionally to systemd.bblcass'
"systemctl start" invocation?

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.





      reply	other threads:[~2015-03-24  7:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23 21:57 systemd + run-postinsts.service Patrick Ohly
2015-03-23 22:33 ` Jonathan Liu
2015-03-24  7:59   ` Patrick Ohly [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1427183976.3412.96.camel@intel.com \
    --to=patrick.ohly@intel.com \
    --cc=net147@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.