Code Monkey home page Code Monkey logo

Comments (7)

gdraheim avatar gdraheim commented on June 22, 2024

What's missing here is a testcase however.

from docker-systemctl-replacement.

gdraheim avatar gdraheim commented on June 22, 2024

I have tried to find a definition of the include-syntax but the sytemd documentation is silent about that.

https://www.freedesktop.org/software/systemd/man/systemd.syntax.html

from docker-systemctl-replacement.

avidspartan1 avatar avidspartan1 commented on June 22, 2024

The only indications I've found that .include syntax is official are:

  1. systemd-analyze verify <service-name> does not report any issues when you use .include, but fails if you don't use .include. Take the following example:

/etc/systemd/system/postgresql-9.6.service:

.include /var/lib/systemd/system/postgresql-9.6.service

/var/lib/systemd/system/postgresql-9.6.service:

ExecStart=<command_to_start_database>
...

Given those two files, if you don't include the one from /var/lib/systemd/system, the verify command will fail because the file that defines the ExecStart (and whatever other directives a service requires to be verified) is not read. However, if you use .include, it works because the .include directive reads the file.

  1. This article: https://www.certdepot.net/rhel-7-systemd-unit-file-customization/

I ran across this issue when trying to use the postgresql Puppet module from Puppetlabs. In their template for /etc/systemd/system/postgresql-<version>.service, they use the '.include' directive. It seems to be a "hidden" feature?

UPDATE: after quick grep through the systemd source code, it appears that .include is implemented, but considered deprecated and to be removed in a future version of systemd. See https://github.com/systemd/systemd/blob/master/man/systemd.unit.xml, line 184 for details. I will submit a ticket to the Puppet module project I referenced earlier for them to update their unit file to be a drop-in .conf file instead. For now, could we keep this feature so that my current version of the module works? :)

from docker-systemctl-replacement.

gdraheim avatar gdraheim commented on June 22, 2024

Yes, we will keep this feature. A recursive call is actually a simple solution that is "safe and sound".

I will open a bug ticket on systemd to notify them. They should actually mention the old feature in their documentation somewhere as officially "deprecated". I guess they did simply forget about it - as "systemd-analyze" does not mark any problems about it.

from docker-systemctl-replacement.

gdraheim avatar gdraheim commented on June 22, 2024

Systemd is about to mark it officially as "deprecated".

keszybz/systemd@37d5c10

However systemd will continue to support the syntax - with a warning.
Possibly systemctl.py should also print a warning message when coming across that feature.

from docker-systemctl-replacement.

gdraheim avatar gdraheim commented on June 22, 2024

I have done so, adding an error-message but not breaking the parsing step itself.

As this feature is deprecated I do not care for a testcase. That allows to close the issue.

Thanks for your help, I do really appreciate that.

from docker-systemctl-replacement.

avidspartan1 avatar avidspartan1 commented on June 22, 2024

You're very welcome--thanks for authoring this awesome tool!

from docker-systemctl-replacement.

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.