rancher / k3os

Purpose-built OS for Kubernetes, fully managed by Kubernetes.
https://k3os.io
Apache License 2.0
3.5k stars 396 forks source link

Unable to restart connman #849

Open pavanfhw opened 2 years ago

pavanfhw commented 2 years ago

Version (k3OS / kernel)

k3os version v0.20.7-k3s1r0 5.4.0-73-generic #82 SMP Thu Jun 3 02:29:43 UTC 2021 **Architecture**

x86_64 Describe the bug

I use this configuration to set up the IP of my k3os

write_files:
- enconding: ""
  content: |-
    #!/bin/bash

    ETH0=$(connmanctl services | awk '{ print $3 }' | while read -r s1; do connmanctl services $s1 | grep -q "eth0" && echo "$s1"; done)

    connmanctl config $ETH0 --ipv4 manual 172.93.52.3 255.255.255.0 172.93.52.1 --nameservers 8.8.8.8 1.1.1.1

    service connman restart
  owner: root:root
  path: /etc/set-ip.sh
  permissions: '0755'

run_cmd:
- "/etc/set-ip.sh"

Suddenly this server went offline and I can't ping any server, resolve any DNS and the server is not reachable from outside. Trying to run manually the IP configuration from the config file I get this when restarting connman to apply the config:

$ sudo service connman restart
 * Starting Network Management Daemon ...
 * supervise-daemon: /usr/sbin/connmand is already running
 * failed to start Network Management Daemon                                                                                                                                                                                            [ !! ]
 * ERROR: connman failed to start

Additional context

I have other servers, exact like this one with the same configuration (changing only the IP) that work. My guess is that as connman is not restarting the network config is not applying and I have no connection. I need help understanding how to restart connman (or the connman daemon?).

pavanfhw commented 2 years ago

Tried setting network config like this on /var/lib/connman/default.config

[service_eth0]
Type=ethernet
IPv4=172.93.52.3/255.255.255.0/172.93.52.1
IPv6=off
Nameservers=8.8.8.8

I can see changes were applied. But the result is the same. If this config is indeed being applied and is correct, what could cause the network connection problems? Is there a way to debug this in k3os/connman?