[systemd-devel] Adding a Timer section to .service files

One Infinite Loop 6pozmo at gmail.com
Fri Jul 8 16:34:48 UTC 2016


As I said before, I don't want to replace .service+.timer combination. I
just think there are cases when .service file (containing, for example,
ExecStart followed by many ExecStartPost) can have a [Crontab] section with
.timer syntax. The two formats (service+timer and [Crontab] inside a
service file) can coexist. It's just a suggestion.

On Fri, Jul 8, 2016 at 7:16 PM, Lennart Poettering <lennart at poettering.net>
wrote:

> On Fri, 08.07.16 16:35, One Infinite Loop (6pozmo at gmail.com) wrote:
>
> > A few usecases:
> > 1) I want to delete specific files once a day
>
> For this you probably should be using tmpfiles' "aging" logic, and not
> define your own timer.
>
> > 2)I want to free RAM using sync command and `echo 3 >
> > /proc/sys/vm/drop_caches` every 15 seconds
>
> Uh. Oh. I don't see why anyone would want to do this...
>
> > 3)I want to make sure certain processes always run using a specific nice
> > value like -15. I know control groups are invented but it's not the same
> > thing.
>
> Doing this with a service timer appears very strange to me. Simply set
> "Nice=-15" in the unit file starting your service and the nice level will
> be properly inherited by all processes of your services.
>
> But, in general, you could do all of the above with a combination of
> .timer and .service file just fine already. These usecases are
> perfectly covered, the only difference between what you are proposing
> and what has been implemented is whether it's adding two unit files
> per item instead of one, which I don't think is too bad...
>
> Lennart
>
> --
> Lennart Poettering, Red Hat
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160708/0f9f8227/attachment.html>


More information about the systemd-devel mailing list