Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Suykov <alex.suykov@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [RFC 01/11] common service startup files
Date: Sun, 22 Mar 2015 14:39:14 +0200	[thread overview]
Message-ID: <20150322123914.GB21403@vostro> (raw)
In-Reply-To: <550E057E.2030605@mind.be>

Sun, Mar 22, 2015 at 12:57:50AM +0100, Arnout Vandecappelle wrote:

Thanks for extensive review, a lot of good points which I skip in
this reply because they should go directly into the code.

> Missing SoB, but perhaps that's intentional because it's not ready for inclusion?
Well, partially, and partially I just forgot -s when re-splitting commits.

> > files may set $(PKG)_INIT = KEY:value KEY:value ..., which will be
> > handled by install-run. The substitutions will be applied to sysv
> > and systemd files.
> 
>  I don't see why this is needed, and it probably makes the install-run script
> more complicated.
> 
BR2_PACKAGE_GPSD_DEVICES, and keeping it a variable in the resulting initscript.
Or maybe in /etc/default.
If sed substitutiions are ok, this can be done much simplier of course:

    sed s!DEVICES!/dev/ttyS1! package/gpsd/gpsd.run > build/gpsd-.../gpsd.run
    support/init/install-run build/gpsd-.../gpsd.run

> BTW, shouldn't tmpdirs be handled for sysv as well? Typically, the init script
> will create the tmpdir...
I saw this as systemd-specific.
Looking at the packages, yes, makes sense to have some kind of generic tmpdir
variable.

>  - The script should only handle cases that are actually used. So start with
> something extremely simple that covers a few interesting cases, and leave the
> others to use the old initscripts system.
Why I was trying handle as many packages as possible: I'm pretty sure something
like 80% of them will work immediately with only the basic support,
but it would be really bad to find a show-stopper among the remaining 20%.
Something that would require changing the way the whole thing works.

Perhaps it's ok to drop bad cases for now, leave them as initscripts-only
and expect the users do something about the unsupported cases themselves.

>  - Use existing infrastructure where possible. For instance, you could change
> the .run format into .ini format and use configparser, or you could use the
> shlex module for parsing.
Regarding ini files, I was thinking about using a kind of extended/simplified
.service format. Systemd being systemd, it would cover all cases, and it's got
some documentation already.

The problem is that there are pretty long shell scripts that do not fit well
within .ini files. Examples: sunxi-mali, ti-gfx, am33-cm3 and maybe some others.
That's why I tried to keep .run files looking somewhat like shell scripts.

Well, that and I don't like systemd documentation all that much.

> This bypass syntax is hard to understand IMHO. Can you find something
> simpler/clearer and more verbose? If you would switch to ini format, it could be
> something like
> 
> [initscripts]
> cp = package/foo/S10start
>      /etc/init.d/S10start
> 
> [systemd]
> cp-ln = package/foo/foo.service
>         /usr/lib/systemd/system/foo.service
>         /etc/systemd/system/multi-user.target.wants

The primary goal of the whole changeset is to separate package-specific
and init-system-specific things, moving the latter out of packages,
so that a change in systemd directory layout (for instance) would not require
patching all the packages.

This is why I try to specify startup ordering (priority 10 or multi-user.target
in this case) indirectly, and why I try to avoid explicit paths.
I see this as a part of init config format, not a part of service configuration.

The package does not need to know where to put those and how to name them.
All it needs is to have its process started, at some point.

  reply	other threads:[~2015-03-22 12:39 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-21 18:26 [Buildroot] [RFC 00/11] common init infrastructure Alex Suykov
2015-03-21 18:27 ` [Buildroot] [RFC 01/11] common service startup files Alex Suykov
2015-03-21 23:57   ` Arnout Vandecappelle
2015-03-22 12:39     ` Alex Suykov [this message]
2015-03-22 13:49       ` Arnout Vandecappelle
2015-03-22 13:51       ` Arnout Vandecappelle
2015-03-22 11:45   ` Yann E. MORIN
2015-03-22 13:41     ` Arnout Vandecappelle
2015-03-21 18:27 ` [Buildroot] [RFC 02/11] per-package .users and .files lists Alex Suykov
2015-03-22 14:35   ` Arnout Vandecappelle
2015-03-24 20:43     ` Alex Suykov
2015-03-21 18:28 ` [Buildroot] [RFC 03/11] init/finalize script Alex Suykov
2015-03-21 18:29 ` [Buildroot] [RFC 04/11] help entries for Init system config menu Alex Suykov
2015-03-21 18:30 ` [Buildroot] [RFC 05/11] bare bb init configuration Alex Suykov
2015-03-21 18:30 ` [Buildroot] [RFC 06/11] ptp: new init infrastructure Alex Suykov
2015-03-21 18:31 ` [Buildroot] [RFC 07/11] upmpcli: " Alex Suykov
2015-03-21 18:31 ` [Buildroot] [RFC 08/11] acpid: " Alex Suykov
2015-03-21 18:32 ` [Buildroot] [RFC 09/11] am33x-cm3: " Alex Suykov
2015-03-21 18:34 ` [Buildroot] [RFC 10/11] postgresql: " Alex Suykov
2015-03-21 18:35 ` [Buildroot] [RFC 11/11] openvpn: " Alex Suykov
2015-03-21 20:41 ` [Buildroot] [RFC 00/11] common " Arnout Vandecappelle
2015-03-22 10:30   ` Alex Suykov
2015-03-22 11:28 ` Yann E. MORIN
2015-03-22 13:23   ` Alex Suykov
2015-03-22 13:34     ` Arnout Vandecappelle

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=20150322123914.GB21403@vostro \
    --to=alex.suykov@gmail.com \
    --cc=buildroot@busybox.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox