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

2016-07-08 Thread One Infinite Loop
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 <lenn...@poettering.net>
wrote:

> On Fri, 08.07.16 16:35, One Infinite Loop (6po...@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
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2016-07-08 Thread One Infinite Loop
No, I understand perfectly why 2 files are needed. All I am saying is that,
in some cases, a section like [Crontab] in a .service file (where you set a
few commands to run every 15 seconds) would be very useful.

On Fri, Jul 8, 2016 at 6:54 PM, Lennart Poettering <lenn...@poettering.net>
wrote:

> On Fri, 08.07.16 16:03, One Infinite Loop (6po...@gmail.com) wrote:
>
> > If you want to disable timer alone or do something else, then you could
> use
> > .timer file. If not, instead of [Install] section in  .service file, you​
> > could have a [Timer] section.
>
> The reason timer definitions and service definitions are separate is
> that timers may be in effect independently of the services they
> trigger, and services may be active independently of any timers they
> are triggered by. Thus, as the lifecycle of both is pretty much
> independent of each other, and independent object should have their
> own 1:1 unit files on disk we chose to have the timer and service unit
> files separate on disk too.
>
> Why I do acknowledge your PoV on this, and can see why it appears
> suprising at first why you have to have two files on disk for this
> instead of just one, I think ultimately it's more uniform and easier
> to grok if independent objects with independent lifecycles map to
> independent files on disk.
>
> Hope that makes sense.
>
> (Also, your email/quoting program appears very broken)
>
> Lennart
>
> --
> Lennart Poettering, Red Hat
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2016-07-08 Thread One Infinite Loop
I want crontab gone and I want to delete specific files once a day and 6
minutes after I opened my computer.

My Ubuntu 16.04 runs just fine, thanks for your concern.

I want like my browser processes, for example, to run at a nice value of
-15. That's why I want to run '/usr/bin/zsh -c '/usr/bin/renice -15 -p
$(/usr/bin/pgrep -f /opt/google/chrome/chrome)'` every 15 seconds, for
example.

On Fri, Jul 8, 2016 at 5:06 PM, Mantas Mikulėnas <graw...@gmail.com> wrote:

> On Fri, Jul 8, 2016 at 4:35 PM, One Infinite Loop <6po...@gmail.com>
> wrote:
>
>> A few usecases:
>> 1) I want to delete specific files once a day
>>
>
> The existing cronjobs and .timer units work well enough for that. Also,
> systemd even ships with a predefined daily systemd-tmpfiles-clean.timer,
> see the "r" and "R" types in `man tmpfiles.d`.
>
>
>> 2)I want to free RAM using sync command and `echo 3 >
>> /proc/sys/vm/drop_caches` every 15 seconds
>>
>
> Why would you do that? There are better ways to make a computer slower.
>
>
>> 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.
>>
>
> That's a service option. It's not related to timers.
>
> I don't know how to quote and how to reply because it's my first time when
>> I use a mailing list.
>>
>
> Surely not the first time using Gmail though. Press 'a' or click "Reply to
> all".
>
> --
> Mantas Mikulėnas <graw...@gmail.com>
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2016-07-08 Thread One Infinite Loop
OK, I have a new idea: let's not call the section [Timer] but [Crontab].

Of course, the manual page will explain what is its purpose. I expect
feedback.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2016-07-08 Thread One Infinite Loop
A few usecases:
1) I want to delete specific files once a day
2)I want to free RAM using sync command and `echo 3 >
/proc/sys/vm/drop_caches` every 15 seconds
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.

I know crontab was invented too but I wanna learn only one syntax: systemd
syntax.

I don't know how to quote and how to reply because it's my first time when
I use a mailing list.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2016-07-08 Thread One Infinite Loop
Why would you create another one? Why are there always people who try to
complicate things?
The same way you read and edit your sudoers files, your fstab file, you
will read & edit the .service file that your distro is shipping to you.
Let's not forget about the manual page that will document the change.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2016-07-08 Thread One Infinite Loop
There are cases when you don't need .timer files but only a [Timer]
section. With a well written manual page, systemd users will understand why
is useful to have a [Timer] section inside a .service file.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2016-07-07 Thread One Infinite Loop
systemctl start foo.service
systemctl enable foo.service

systemd tools must be modified/adjusted​ too

On Fri, Jul 8, 2016 at 8:08 AM, Mantas Mikulėnas <graw...@gmail.com> wrote:

> On Fri, Jul 8, 2016 at 7:52 AM, One Infinite Loop <6po...@gmail.com>
> wrote:
>
>> Instead of having a .service file and a .timer file why not having a
>> [Timer] section inside a .service file? It would be much more manageable as
>> one file.
>>
>
> More manageable? How would you actually activate/deactivate it without
> being able to 'systemctl start foo.timer'?
>
> --
> Mantas Mikulėnas <graw...@gmail.com>
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2016-07-07 Thread One Infinite Loop
Instead of having a .service file and a .timer file why not having a
[Timer] section inside a .service file? It would be much more manageable as
one file.

Of course, if there are users who prefer having .timer files, .timer files
will continue to exist.

I use systemd 229.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Scheduling emptyings of specific directories

2016-06-03 Thread One Infinite Loop
It would be great if I could empty directories (creating a .conf file
in /etc/tmpfiles.d) but not at boot time, but before shutting
down/rebooting the pc. I am using systemd 229. Thanks in advance.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel