[systemd-devel] [PATCH] don't check ratelimit on manual start

David Strauss david at davidstrauss.net
Thu Sep 13 02:39:07 PDT 2012


On Wed, Aug 29, 2012 at 4:28 AM, Lukáš Nykrýn <lnykryn at redhat.com> wrote:
> I have here a request that systemd should not refuse to start service because of "start request repeated too quickly" when service is started manually.
> I have prepared a patch, but I am not sure about my approach.

It may be just an issue of taste, but I tend to consider bitfields
once multiple boolean parameters start appearing in the function
definition. When it's a good fit, it makes function calls easier to
read versus counting commas and referencing the function definition.
It makes further changes less disruptive, too. In this case, it makes
sense to pair the "force" option in a bitfield with an option that
overrides the start request repeat timer. They're both overrides for
protection behavior that might stop the request from being carried
out.

I also think "user_start" ought to just be "skip_start_repeat_check"
or similar. This is because the call should specify what's being
requested (no repeat check) rather than who's doing the requesting.
It's plausible that code other than that invoked by a user utility
might want to skip that check. It's also possible that a script may
call systemctl and not want to skip the check. Logic that changes
behavior because a user is directly invoking something should be on
the user utility side, not in the invoked code (which has no real
reason to know a user requested the invocation).

-- 
David Strauss
   | david at davidstrauss.net


More information about the systemd-devel mailing list