Giter Site home page Giter Site logo

Comments (6)

ctheune avatar ctheune commented on June 12, 2024 2

Relevant code places:

  • using supervisord will trigger a Service component (supervisord.py:227)
  • the Service component is "Abstract" as it needs a platform-specific hookup with init.d or systemd
  • batou_ext has the nixos platform integration: (https://github.com/flyingcircusio/batou_ext/blob/master/src/batou_ext/nix.py#L182)
  • however, there is no way to pass in customizations AFAICT and IMHO restart=always should be the default anyways

from batou.

elikoga avatar elikoga commented on June 12, 2024 1

All uses of Service(...) I can find already set systemd=dict(...Restart='always'...)

Setting this as default and mentioning it in the docs should be reasonable

from batou.

ctheune avatar ctheune commented on June 12, 2024

@sweh is interested in the fix for this

from batou.

elikoga avatar elikoga commented on June 12, 2024

customizing systemd service parameters works, as far as I can replicate; here is an example file that creates and modifies a systemd service with unit file modifications:

from batou.component import Component
from batou.lib.file import File
from batou.lib.service import Service
import batou_ext.nix


class Tick(Component):
    def configure(self):
        self += File(
            "tick.sh",
            mode="rwxr-xr-x",
            content="""\
#!/bin/bash
while true; do
  date
  sleep 1
done
""",
        )
        self += Service("tick.sh", systemd=dict(
                Restart="always",
                Type="simple"
                ))

I will be setting Restart=always in a PR on batou_ext in a bit

from batou.

elikoga avatar elikoga commented on June 12, 2024

Not sure what is meant by customizing systemd parameters seems broken

from batou.

elikoga avatar elikoga commented on June 12, 2024

@sweh could you elaborate what's going wrong? Or is the code snippet enough to explain systemd behaviour on the fc nixos platform

from batou.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.