Giter VIP home page Giter VIP logo

Comments (5)

FlorianHeigl avatar FlorianHeigl commented on July 24, 2024

@baby-gnu using DNS_HOSTNAME the network has to be up before the hostname can be found.
I played around with a systemd unit for the context, and the best working version did:
After=network
Before=ssh

This avoids some major race conditions but even then you can have apache or databases start up with an invalid hostname.
I left the 'service network restart' in the network context intact for this reason.
Haven't seen bad consequences like this anymore.

The second part (multi-user) is very desirable, yeah.

from addon-context-linux.

baby-gnu avatar baby-gnu commented on July 24, 2024

I made some tests and I have the following .service for contextualisation:

[Unit]
# Remove default dependencies or it will not work
DefaultDependencies=no

# We wants network-pre.target as we are a provider
# See man systemd.special(7) - SPECIAL PASSIVE SYSTEM UNITS
Before=network-pre.target
Wants=network-pre.target

# Make sure to have filesystem mounted since we remove default dependencies.
After=local-fs.target

...

[Install]
WantedBy=networking.service

and the second part is much more simple:

[Unit]
After=multi-user.target

...

[Install]
WantedBy=multi-user.target

from addon-context-linux.

vholer avatar vholer commented on July 24, 2024

Hi @baby-gnu and @FlorianHeigl, by older commit 93cb488 I tried to split the contextualization scripts into pre and post networking. For now, only the Systemd is done, the SysV init scripts needs to be fixed before next release. Just letting you know in case you want to try it or discuss the change. Thank you!

from addon-context-linux.

FlorianHeigl avatar FlorianHeigl commented on July 24, 2024

Thx @vholer i very much want to test them!

from addon-context-linux.

vholer avatar vholer commented on July 24, 2024

The second part (SysV and Upstart) is covered by recent PR #74. I think it's done for now and I'll close this issue. If you experience any problem (at least I think there is still space for play with the init script dependencies), please open a new one. Thank you!

from addon-context-linux.

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.