Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Add support for .path units #15

Open
nil0x42 opened this issue Apr 10, 2021 · 1 comment
Open

[FEATURE] Add support for .path units #15

nil0x42 opened this issue Apr 10, 2021 · 1 comment

Comments

@nil0x42
Copy link

nil0x42 commented Apr 10, 2021

Hi ! I liked the principle of using systemd as backend for workflow scheduling, while providing a simpler interface.

One feature i would like very much is ability to have jobs triggered on path change instead of timer.
job()'s first argument could support additional syntax such as onPathChange=/etc/passwd for example, and then geerate appropriate dependency with generated systemd .path unit

@karlicoss
Copy link
Owner

Hi! Glad you liked it :)
Yeah, interesting idea -- I haven't much application for it yet though

Probably would require changes

  • here to handle path argument(e.g. when_path_changed)

    dron/dron.py

    Lines 432 to 436 in 4b7653d

    when = j.when
    if when is None:
    continue
    t = timer(unit_name=uname, when=when)
    yield check(uname + '.timer', t)
  • might need changes around

    dron/dron.py

    Line 551 in 4b7653d

    if unit.endswith('.timer'):
    and

    dron/dron.py

    Line 575 in 4b7653d

    elif unit.endswith('.timer'):
  • and the dron monitor command is has a hard assumption of each unit having a correspondent timer I think -- might be easy to fix by filtering out the ones without timers, although the proper fix would probably be to also display the ones with paths dependencies properly

    dron/dron.py

    Line 838 in 4b7653d

    def _cmd_monitor(managed: State, *, params: MonParams):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants