• Matthew Clive's avatar
    Add network dependency to installed service file (#2210) · 052d283a
    Matthew Clive authored
    Adds the line `After=network-online.target` to the k3s systemd service
    file. This applies the fix mentioned in
    [this GH comment](https://github.com/rancher/k3s/issues/1626#issuecomment-642253812)
    which I can confirm makes k3s networking survive reboot in Raspbian
    Buster.
    
    [It appears, in some docs I found](https://www.digitalocean.com/community/tutorials/understanding-systemd-units-and-unit-files)
    that this is a recommended and usual way of specifying that we need the
    target to be _completed_ before starting k3s. Using just the `Wants=`
    directive doesn't work for this task, you have to add both directives
    at once to do this. Quote:
    
    > `Wants=`: This directive is similar to `Requires=`, but less strict.
    > `Systemd` will attempt to start any units listed here when this unit
    > is activated. If these units are not found or fail to start, the
    > current unit will continue to function. This is the recommended way to
    > configure most dependency relationships. **Again, this implies a
    > parallel activation unless modified by other directives**
    
    > [...]
    
    > `After=`: The units listed in this directive will be started before
    > starting the current unit. This does not imply a dependency
    > relationship and **one must be established through the above
    > directives if this is required.**
    
    - _(Emphasis mine)_
    Signed-off-by: 's avatarMatthew Clive <arcticlight@arcticlight.me>
    Signed-off-by: 's avatarBrad Davidson <brad.davidson@rancher.com>
    052d283a
Name
Last commit
Last update
.github Loading commit data...
cmd Loading commit data...
contrib Loading commit data...
e2e Loading commit data...
manifests Loading commit data...
package Loading commit data...
pkg Loading commit data...
scripts Loading commit data...
tests/perf Loading commit data...
vendor Loading commit data...
.dockerignore Loading commit data...
.drone.yml Loading commit data...
.gitignore Loading commit data...
.golangci.json Loading commit data...
BUILDING.md Loading commit data...
CODEOWNERS Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
CONTRIBUTING.md Loading commit data...
DCO Loading commit data...
Dockerfile.dapper Loading commit data...
Dockerfile.manifest Loading commit data...
Dockerfile.test.dapper Loading commit data...
LICENSE Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
ROADMAP.md Loading commit data...
Vagrantfile Loading commit data...
channel.yaml Loading commit data...
docker-compose.yml Loading commit data...
go.mod Loading commit data...
go.sum Loading commit data...
install.sh Loading commit data...
k3s.service Loading commit data...
main.go Loading commit data...
vendor.go Loading commit data...