From: Lennart Poettering <mzerqung@0pointer.de>
To: Development discussions related to Fedora
<devel@lists.fedoraproject.org>
Cc: fedora-devel-list@redhat.com,
cg-manager-developers@lists.fedorahosted.org, dwalsh@redhat.com,
duffy@redhat.com, containers@lists.osdl.org
Subject: Re: new cg-manager gui tool for managin cgroups
Date: Fri, 22 Jul 2011 02:32:08 +0200 [thread overview]
Message-ID: <20110722003208.GB16928@tango.0pointer.de> (raw)
In-Reply-To: <20110721230836.GM22568@nb.net.home>
On Fri, 22.07.11 01:08, Karel Zak (kzak@redhat.com) wrote:
>
> On Thu, Jul 21, 2011 at 06:11:25PM +0200, Lennart Poettering wrote:
> > I'd expect people to just tell systemd about their preferred grouping
> > (if the default of sticking each service into a group of its own is not
> > good enough) using the ControlGroup= setting in unit files. This is
> > trivial to do, and will put things right from the beginning with no
> > complex moving around.
>
> It would be nice to have a shared library (or D-BUS interface) to
> talk with systemd, then it would be possible to (on-the-fly)
> create/modify services and execute processes by systemd from another
> daemons (like crond).
You can actually do that, and there are a couple of hooks provided to
make this pretty:
a) Your app can just place a simple unit file in /run/systemd/system, and
issue Reload() on the manager D-Bus object. Then, you can start it
via D-Bus, and stop it, and introspect it, and all other
operations. When you want to get rid of it again, stop it, then
remove the file, issue another Reload().
b) Write a "generator". This are small binaries you can drop into
/lib/systemd/system-generators. They are spawned in parallel every
time systemd loads its configuration. These generators can
dynamically generate unit files from other configuration, and place
them in a special dir in /run/systemd. We currently use this to
create the appropriate units for /etc/crypttab, or to generate a
getty on the kernel console if the kernel was booted with a special
one. Eventually we'll probably rip the currently built-in SysV compat
code in systemd out and make a generator out of it. So that we just
dynamically create a systemd unit file from each SysV script. These
generators must be very simple, as they are started very early at
boot. They may not do IPC and they may not access any files outside
of the root dir. They are primarily useful to dynamically translate
foreign configuration into systemd unit files.
c) In case you have a number of very similar dynamic services to run use
a template. i.e. as part of your package drop yourservice@.service
into /lib/systemd/system. Then, when you dynamically need an instance
of this, just start "yourservice@someparam.service". In that unit
file you can then access "someparam" with %i. If you need to change
more than one parameter this won't be useful to you, however.
Lennart
--
Lennart Poettering - Red Hat, Inc.
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
next prev parent reply other threads:[~2011-07-22 0:32 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-20 19:20 new cg-manager gui tool for managin cgroups Jason Baron
2011-07-20 20:28 ` Lennart Poettering
2011-07-20 20:42 ` Vivek Goyal
2011-07-20 21:07 ` Lennart Poettering
2011-07-20 21:26 ` Vivek Goyal
2011-07-20 21:41 ` Lennart Poettering
2011-07-20 20:59 ` Vivek Goyal
2011-07-20 21:11 ` Lennart Poettering
2011-07-21 14:20 ` Jason Baron
2011-07-21 15:08 ` Vivek Goyal
2011-07-21 16:11 ` Lennart Poettering
2011-07-21 23:08 ` Karel Zak
2011-07-22 0:32 ` Lennart Poettering [this message]
2011-07-22 10:13 ` Karel Zak
[not found] ` <20110721142053.GA2454-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-07-21 17:23 ` Tomas Mraz
[not found] ` <1311268987.6273.18.camel-ToA8MW0H8sPg+ylLNZCgDw@public.gmane.org>
2011-07-21 17:55 ` Lennart Poettering
2011-07-22 1:38 ` Ben Boeckel
2011-07-20 23:01 ` Matthias Clasen
2011-07-21 10:03 ` Daniel P. Berrange
2011-07-21 14:36 ` Jason Baron
[not found] ` <20110721143622.GB2454-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-07-21 14:52 ` Daniel P. Berrange
2011-07-21 15:28 ` Vivek Goyal
2011-07-21 15:36 ` Daniel P. Berrange
[not found] ` <20110721153620.GO17632-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-07-21 15:53 ` Lennart Poettering
2011-07-21 20:15 ` Jason Baron
2011-07-21 20:32 ` Vivek Goyal
2011-07-22 10:01 ` Daniel P. Berrange
[not found] ` <20110721152845.GD12373-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-07-21 16:36 ` Lennart Poettering
2011-08-02 14:04 ` Vivek Goyal
2011-07-21 16:17 ` Lennart Poettering
2011-07-21 20:58 ` Vivek Goyal
2011-07-22 10:07 ` Daniel P. Berrange
[not found] ` <20110720192029.GD2482-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-07-21 15:30 ` Daniel P. Berrange
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=20110722003208.GB16928@tango.0pointer.de \
--to=mzerqung@0pointer.de \
--cc=cg-manager-developers@lists.fedorahosted.org \
--cc=containers@lists.osdl.org \
--cc=devel@lists.fedoraproject.org \
--cc=duffy@redhat.com \
--cc=dwalsh@redhat.com \
--cc=fedora-devel-list@redhat.com \
/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.