systemctl status NetworkManager-wait-online.service
○ NetworkManager-wait-online.service - Network Manager Wait Online
Loaded: loaded (/usr/lib/systemd/system/NetworkManager-wait-online.service; enabled; preset: disabled)
Drop-In: /etc/systemd/system/NetworkManager-wait-online.service.d
└─override.conf
Active: inactive (dead)
Docs: man:NetworkManager-wait-online.service(8)
离线
journalctl -u NetworkManager.service --since 03:34
-- Boot 34288aab5d9b4a55ad4ed1d604b1fbeb --
2月 27 03:35:49 archer systemd[1]: Starting Network Manager...
2月 27 03:35:49 archer NetworkManager[623]: <info> [1740598549.7872] NetworkManager (version 1.50.2-1) is starting... (boot:34288aab-5d9b-4a55-ad4e-d1d604b1fbeb)
2月 27 03:35:49 archer NetworkManager[623]: <info> [1740598549.7873] Read config: /etc/NetworkManager/NetworkManager.conf (lib: 20-connectivity.conf)
2月 27 03:35:49 archer NetworkManager[623]: <info> [1740598549.8079] manager[0x5a088e4ec480]: monitoring kernel firmware directory '/lib/firmware'.
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.0978] hostname: hostname: using hostnamed
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.0979] hostname: static hostname changed from (none) to "archer"
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.1006] dns-mgr: init: dns=default,systemd-resolved rc-manager=symlink
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.1069] rfkill1: found Wi-Fi radio killswitch (at /sys/devices/pci0000:00/0000:00:02.2/0000:04:00.0/ieee80211/phy0/rfkill1) (driver rtw89_8852be)
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.1081] manager[0x5a088e4ec480]: rfkill: Wi-Fi hardware radio set enabled
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.1082] manager[0x5a088e4ec480]: rfkill: WWAN hardware radio set enabled
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.1762] Loaded device plugin: NMTeamFactory (/usr/lib/NetworkManager/1.50.2-1/libnm-device-plugin-team.so)
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.1855] Loaded device plugin: NMBluezManager (/usr/lib/NetworkManager/1.50.2-1/libnm-device-plugin-bluetooth.so)
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.1877] Loaded device plugin: NMWifiFactory (/usr/lib/NetworkManager/1.50.2-1/libnm-device-plugin-wifi.so)
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.1889] Loaded device plugin: NMAtmManager (/usr/lib/NetworkManager/1.50.2-1/libnm-device-plugin-adsl.so)
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.1906] Loaded device plugin: NMOvsFactory (/usr/lib/NetworkManager/1.50.2-1/libnm-device-plugin-ovs.so)
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.1918] Loaded device plugin: NMWwanFactory (/usr/lib/NetworkManager/1.50.2-1/libnm-device-plugin-wwan.so)
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.1928] manager: rfkill: Wi-Fi enabled by radio killswitch; enabled by state file
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.1930] manager: rfkill: WWAN enabled by radio killswitch; enabled by state file
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.1931] manager: Networking is enabled by state file
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.1945] settings: Loaded settings plugin: keyfile (internal)
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.2043] dhcp: init: Using DHCP client 'internal'
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.2051] manager: (lo): new Loopback device (/org/freedesktop/NetworkManager/Devices/1)
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.2084] device (lo): state change: unmanaged -> unavailable (reason 'connection-assumed', managed-type: 'external')
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.2101] device (lo): state change: unavailable -> disconnected (reason 'connection-assumed', managed-type: 'external')
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.2122] device (lo): Activation: starting connection 'lo' (99571926-d42f-4f08-896d-52d4ba13964d)
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.2150] manager: (enp2s0): new Ethernet device (/org/freedesktop/NetworkManager/Devices/2)
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.2183] settings: (enp2s0): created default wired connection 'Wired connection 1'
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.2184] device (enp2s0): state change: unmanaged -> unavailable (reason 'managed', managed-type: 'external')
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.3903] device (wlan0): driver supports Access Point (AP) mode
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.3924] manager: (wlan0): new 802.11 Wi-Fi device (/org/freedesktop/NetworkManager/Devices/3)
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.3932] device (wlan0): state change: unmanaged -> unavailable (reason 'managed', managed-type: 'external')
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.5353] device (wlan0): set-hw-addr: set MAC address to 0A:43:27:0A:3C:EB (scanning)
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.6459] bus-manager: acquired D-Bus service "org.freedesktop.NetworkManager"
2月 27 03:35:50 archer systemd[1]: Started Network Manager.
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.6476] ovsdb: disconnected from ovsdb
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.6477] device (lo): state change: disconnected -> prepare (reason 'none', managed-type: 'external')
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.6478] device (lo): state change: prepare -> config (reason 'none', managed-type: 'external')
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.6478] device (lo): state change: config -> ip-config (reason 'none', managed-type: 'external')
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.6480] device (lo): state change: ip-config -> ip-check (reason 'none', managed-type: 'external')
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.6488] device (lo): state change: ip-check -> secondaries (reason 'none', managed-type: 'external')
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.6489] device (lo): state change: secondaries -> activated (reason 'none', managed-type: 'external')
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.6490] device (lo): Activation: successful, device activated.
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.7025] device (wlan0): supplicant interface state: internal-starting -> disconnected
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.7026] Wi-Fi P2P device controlled by interface wlan0 created
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.7027] manager: (p2p-dev-wlan0): new 802.11 Wi-Fi P2P device (/org/freedesktop/NetworkManager/Devices/4)
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.7029] device (p2p-dev-wlan0): state change: unmanaged -> unavailable (reason 'managed', managed-type: 'external')
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.7030] device (wlan0): state change: unavailable -> disconnected (reason 'supplicant-available', managed-type: 'full')
2月 27 03:35:50 archer NetworkManager[623]: <info> [1740598550.7032] device (p2p-dev-wlan0): state change: unavailable -> disconnected (reason 'none', managed-type: 'full')
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.5250] policy: auto-activating connection 'w-2019_5G' (21db62d8-cb75-4919-a9d2-784f119a2ded)
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.5256] device (wlan0): Activation: starting connection 'w-2019_5G' (21db62d8-cb75-4919-a9d2-784f119a2ded)
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.5256] device (wlan0): state change: disconnected -> prepare (reason 'none', managed-type: 'full')
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.5259] manager: NetworkManager state is now CONNECTING
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.5478] device (wlan0): set-hw-addr: reset MAC address to C0:35:32:3D:4B:F1 (preserve)
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.6553] device (wlan0): state change: prepare -> config (reason 'none', managed-type: 'full')
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.6556] device (wlan0): Activation: (wifi) access point 'w-2019_5G' has security, but secrets are required.
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.6556] device (wlan0): state change: config -> need-auth (reason 'none', managed-type: 'full')
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.6559] device (wlan0): supplicant interface state: disconnected -> interface_disabled
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.6559] device (p2p-dev-wlan0): supplicant management interface state: disconnected -> interface_disabled
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.6567] device (wlan0): state change: need-auth -> prepare (reason 'none', managed-type: 'full')
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.6569] device (wlan0): state change: prepare -> config (reason 'none', managed-type: 'full')
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.6572] device (wlan0): Activation: (wifi) connection 'w-2019_5G' has security, and secrets exist. No new secrets needed.
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.6573] Config: added 'ssid' value 'w-2019_5G'
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.6573] Config: added 'scan_ssid' value '1'
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.6573] Config: added 'bgscan' value 'simple:30:-65:300'
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.6573] Config: added 'key_mgmt' value 'WPA-PSK WPA-PSK-SHA256 FT-PSK SAE FT-SAE'
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.6573] Config: added 'auth_alg' value 'OPEN'
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.6573] Config: added 'psk' value '<hidden>'
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.6667] device (wlan0): supplicant interface state: interface_disabled -> inactive
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.6667] device (p2p-dev-wlan0): supplicant management interface state: interface_disabled -> inactive
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.8991] device (wlan0): supplicant interface state: inactive -> authenticating
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.8992] device (p2p-dev-wlan0): supplicant management interface state: inactive -> authenticating
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.9004] device (wlan0): supplicant interface state: authenticating -> associating
2月 27 03:35:54 archer NetworkManager[623]: <info> [1740598554.9005] device (p2p-dev-wlan0): supplicant management interface state: authenticating -> associating
2月 27 03:35:55 archer NetworkManager[623]: <info> [1740598555.0761] device (wlan0): supplicant interface state: associating -> 4way_handshake
2月 27 03:35:55 archer NetworkManager[623]: <info> [1740598555.0762] device (p2p-dev-wlan0): supplicant management interface state: associating -> 4way_handshake
2月 27 03:35:55 archer NetworkManager[623]: <info> [1740598555.2365] device (wlan0): supplicant interface state: 4way_handshake -> completed
2月 27 03:35:55 archer NetworkManager[623]: <info> [1740598555.2367] device (wlan0): Activation: (wifi) Stage 2 of 5 (Device Configure) successful. Connected to wireless network "w-2019_5G"
2月 27 03:35:55 archer NetworkManager[623]: <info> [1740598555.2367] device (p2p-dev-wlan0): supplicant management interface state: 4way_handshake -> completed
2月 27 03:35:55 archer NetworkManager[623]: <info> [1740598555.2372] device (wlan0): state change: config -> ip-config (reason 'none', managed-type: 'full')
2月 27 03:35:55 archer NetworkManager[623]: <info> [1740598555.2386] dhcp4 (wlan0): activation: beginning transaction (timeout in 45 seconds)
2月 27 03:35:55 archer NetworkManager[623]: <info> [1740598555.2444] dhcp4 (wlan0): state changed new lease, address=192.168.0.37, acd pending
2月 27 03:35:55 archer NetworkManager[623]: <info> [1740598555.4321] dhcp4 (wlan0): state changed new lease, address=192.168.0.37
2月 27 03:35:55 archer NetworkManager[623]: <info> [1740598555.4332] policy: set 'w-2019_5G' (wlan0) as default for IPv4 routing and DNS
2月 27 03:35:55 archer NetworkManager[623]: <info> [1740598555.4468] device (wlan0): state change: ip-config -> ip-check (reason 'none', managed-type: 'full')
2月 27 03:35:55 archer NetworkManager[623]: <info> [1740598555.4515] device (wlan0): state change: ip-check -> secondaries (reason 'none', managed-type: 'full')
2月 27 03:35:55 archer NetworkManager[623]: <info> [1740598555.4520] device (wlan0): state change: secondaries -> activated (reason 'none', managed-type: 'full')
2月 27 03:35:55 archer NetworkManager[623]: <info> [1740598555.4527] manager: NetworkManager state is now CONNECTED_SITE
2月 27 03:35:55 archer NetworkManager[623]: <info> [1740598555.4540] device (wlan0): Activation: successful, device activated.
2月 27 03:35:56 archer NetworkManager[623]: <info> [1740598556.0512] manager: NetworkManager state is now CONNECTED_GLOBAL
2月 27 03:35:56 archer NetworkManager[623]: <info> [1740598556.3880] manager: startup complete
2月 27 03:35:59 archer NetworkManager[623]: <info> [1740598559.4445] agent-manager: agent[918fa6fc6801e748,:1.39/org.freedesktop.nm-applet/1000]: agent registered
离线
有大佬吗,麻烦你们帮帮忙。查了半天没解决
离线
恳请各位帮帮我,我什么都会做的😭,哦内该
离线
呃,没看到它失败呀。
离线
呃,没看到它失败呀。
你好大佬,我的一个podlet生成的podman service如下
[X-Container]
ContainerName=portainer
Image=cr.portainer.io/portainer/portainer-ce:latest
PublishPort=8000:8000
PublishPort=9443:9443
SecurityLabelDisable=true
Volume=/run/user/1000/podman/podman.sock:/var/run/docker.sock
Volume=portainer_data:/data
[Service]
Restart=always
Environment=PODMAN_SYSTEMD_UNIT=%n
KillMode=mixed
ExecStop=/usr/bin/podman rm -v -f -i --cidfile=%t/%N.cid
ExecStopPost=-/usr/bin/podman rm -v -f -i --cidfile=%t/%N.cid
Delegate=yes
Type=notify
NotifyAccess=all
SyslogIdentifier=%N
ExecStart=/usr/bin/podman run --name portainer --cidfile=%t/%N.cid --replace --rm --cgroups=split --sdnotify=conmon -d --security-opt label=disable -v /run/user/1000/podman/podman.sock:/var/run/docker.sock -v portainer_data:/data --publish 8000:8000 --publish 9443:9443 cr.portainer.io/portainer/portainer-ce:latest
[Install]
WantedBy=default.target
[Unit]
Wants=podman-user-wait-network-online.service
After=podman-user-wait-network-online.service
SourcePath=/home/triwj/.config/containers/systemd/podsrv-portainer.container
RequiresMountsFor=%t/containers
RequiresMountsFor=/run/user/1000/podman/podman.sock
但是开机好一会儿,才能访问服务。我查了一下podman-user-wait-network-online.service 启动失败
[Unit]
Description=Wait for system level network-online.target as user.
Documentation=https://github.com/containers/podman/issues/22197
Documentation=man:podman-systemd.unit(5)
[Service]
Type=oneshot
# Set a timeout as by default oneshot does not have one and in case network-online.target
# never comes online we do not want to block forever, 90s is the default systemd unit timeout.
TimeoutStartSec=90s
ExecStart=/bin/sh -c 'until systemctl is-active network-online.target; do sleep 0.5; done'
RemainAfterExit=yes
network-online.target没有激活,而network-online.target WantedBy=network-online.target
离线
呃,没看到它失败呀。
请问我该查找哪一方面的日志
离线
呃,没看到它失败呀。
我又重启了以下
journalctl --user -u podman-user-wait-network-online.service --since 20:00
2月 27 20:05:27 archer systemd[815]: Starting Wait for system level network-online.target as user....
2月 27 20:05:28 archer sh[915]: inactive
2月 27 20:05:31 archer sh[1416]: inactive
2月 27 20:05:31 archer sh[1432]: inactive
2月 27 20:05:32 archer sh[1439]: inactive
2月 27 20:05:32 archer sh[1469]: inactive
2月 27 20:05:33 archer sh[1471]: inactive
2月 27 20:05:34 archer sh[1482]: inactive
2月 27 20:05:35 archer sh[1783]: inactive
2月 27 20:05:36 archer sh[1877]: inactive
2月 27 20:05:36 archer sh[1896]: inactive
2月 27 20:05:37 archer sh[1907]: inactive
2月 27 20:05:37 archer sh[1919]: inactive
2月 27 20:05:38 archer sh[1947]: inactive
2月 27 20:05:38 archer sh[1950]: inactive
2月 27 20:05:39 archer sh[1980]: inactive
2月 27 20:05:40 archer sh[1987]: inactive
2月 27 20:05:40 archer sh[1998]: inactive
2月 27 20:05:41 archer sh[2043]: inactive
2月 27 20:05:41 archer sh[2045]: inactive
2月 27 20:05:42 archer sh[2047]: inactive
2月 27 20:05:42 archer sh[2052]: inactive
2月 27 20:05:43 archer sh[2054]: inactive
2月 27 20:05:45 archer sh[2144]: inactive
2月 27 20:05:46 archer sh[2194]: inactive
2月 27 20:05:48 archer sh[2237]: inactive
2月 27 20:05:49 archer sh[2245]: inactive
2月 27 20:05:49 archer sh[2249]: inactive
2月 27 20:05:50 archer sh[2252]: inactive
2月 27 20:05:53 archer sh[2320]: inactive
2月 27 20:05:54 archer sh[2324]: inactive
2月 27 20:05:54 archer sh[2329]: inactive
2月 27 20:05:55 archer sh[2335]: inactive
2月 27 20:05:55 archer sh[2340]: inactive
2月 27 20:05:56 archer sh[2342]: inactive
2月 27 20:05:56 archer sh[2344]: inactive
2月 27 20:05:58 archer sh[2401]: inactive
2月 27 20:05:59 archer sh[2403]: inactive
2月 27 20:06:00 archer sh[2429]: inactive
2月 27 20:06:01 archer sh[2431]: inactive
2月 27 20:06:03 archer sh[2486]: inactive
2月 27 20:06:06 archer sh[2503]: inactive
2月 27 20:06:06 archer sh[2506]: inactive
2月 27 20:06:07 archer sh[2556]: inactive
2月 27 20:06:08 archer sh[2561]: inactive
2月 27 20:06:09 archer sh[2582]: inactive
2月 27 20:06:09 archer sh[2585]: inactive
2月 27 20:06:10 archer sh[2587]: inactive
2月 27 20:06:11 archer sh[2593]: inactive
2月 27 20:06:12 archer sh[2598]: inactive
2月 27 20:06:14 archer sh[2663]: inactive
2月 27 20:06:15 archer sh[2665]: inactive
2月 27 20:06:15 archer sh[2667]: inactive
2月 27 20:06:16 archer sh[2671]: inactive
2月 27 20:06:17 archer sh[2673]: inactive
2月 27 20:06:17 archer sh[2684]: inactive
2月 27 20:06:18 archer sh[2725]: inactive
2月 27 20:06:19 archer sh[2727]: inactive
2月 27 20:06:19 archer sh[2729]: inactive
2月 27 20:06:20 archer sh[2731]: inactive
2月 27 20:06:20 archer sh[2733]: inactive
2月 27 20:06:21 archer sh[2737]: inactive
2月 27 20:06:21 archer sh[2739]: inactive
2月 27 20:06:24 archer sh[2795]: inactive
2月 27 20:06:24 archer sh[2797]: inactive
2月 27 20:06:25 archer sh[2799]: inactive
2月 27 20:06:26 archer sh[2803]: inactive
2月 27 20:06:27 archer sh[2807]: inactive
2月 27 20:06:27 archer sh[2809]: inactive
2月 27 20:06:30 archer sh[2869]: inactive
2月 27 20:06:31 archer sh[2871]: inactive
2月 27 20:06:34 archer sh[2927]: inactive
2月 27 20:06:35 archer sh[2936]: inactive
2月 27 20:06:37 archer sh[2942]: inactive
2月 27 20:06:38 archer sh[2948]: inactive
2月 27 20:06:39 archer sh[2961]: inactive
2月 27 20:06:39 archer sh[3000]: inactive
2月 27 20:06:40 archer sh[3002]: inactive
2月 27 20:06:40 archer sh[3004]: inactive
2月 27 20:06:41 archer sh[3006]: inactive
2月 27 20:06:41 archer sh[3008]: inactive
2月 27 20:06:42 archer sh[3010]: inactive
2月 27 20:06:44 archer sh[3043]: inactive
2月 27 20:06:45 archer sh[3087]: inactive
2月 27 20:06:45 archer sh[3089]: inactive
2月 27 20:06:46 archer sh[3093]: inactive
2月 27 20:06:46 archer sh[3096]: inactive
2月 27 20:06:47 archer sh[3098]: inactive
2月 27 20:06:48 archer sh[3102]: inactive
2月 27 20:06:48 archer sh[3104]: inactive
2月 27 20:06:50 archer sh[3162]: inactive
2月 27 20:06:50 archer sh[3164]: inactive
2月 27 20:06:51 archer sh[3166]: inactive
2月 27 20:06:51 archer sh[3168]: inactive
2月 27 20:06:54 archer sh[3189]: inactive
2月 27 20:06:55 archer sh[3228]: inactive
2月 27 20:06:55 archer sh[3230]: inactive
2月 27 20:06:56 archer sh[3232]: inactive
2月 27 20:06:57 archer systemd[815]: podman-user-wait-network-online.service: start operation timed out. Terminating.
2月 27 20:06:57 archer systemd[815]: podman-user-wait-network-online.service: Main process exited, code=killed, status=15/TERM
2月 27 20:06:57 archer systemd[815]: podman-user-wait-network-online.service: Failed with result 'timeout'.
2月 27 20:06:57 archer systemd[815]: Failed to start Wait for system level network-online.target as user..
2月 27 20:06:57 archer systemd[815]: podman-user-wait-network-online.service: Consumed 1.245s CPU time, 2.6M memory peak.
离线
你这个 podman-user-wait-network-online.service 应当写 Wants=network-online.target。可以编辑文件,也可以用 systemctl add-wants 子命令给它加上。
离线
你这个 podman-user-wait-network-online.service 应当写 Wants=network-online.target。可以编辑文件,也可以用 systemctl add-wants 子命令给它加上。
好的,我已经加上了,重启了一下还是不行。
# /usr/lib/systemd/user/podman-user-wait-network-online.service
[Unit]
Description=Wait for system level network-online.target as user.
Documentation=https://github.com/containers/podman/issues/22197
Documentation=man:podman-systemd.unit(5)
[Service]
Type=oneshot
# Set a timeout as by default oneshot does not have one and in case network-online.target
# never comes online we do not want to block forever, 90s is the default systemd unit timeout.
TimeoutStartSec=90s
ExecStart=/bin/sh -c 'until systemctl is-active network-online.target; do sleep 0.5; done'
RemainAfterExit=yes
# /home/triwj/.config/systemd/user/podman-user-wait-network-online.service.d/override.conf
[Unit]
Wants=network-online.target
journalctl --user -u podman-user-wait-network-online.service --since 20:15
2月 27 20:15:12 archer systemd[792]: Starting Wait for system level network-online.target as user....
2月 27 20:15:13 archer sh[904]: inactive
2月 27 20:15:14 archer sh[938]: inactive
2月 27 20:15:14 archer sh[1110]: inactive
2月 27 20:15:15 archer sh[1337]: inactive
2月 27 20:15:15 archer sh[1406]: inactive
2月 27 20:15:16 archer sh[1426]: inactive
2月 27 20:15:16 archer sh[1430]: inactive
2月 27 20:15:18 archer sh[1665]: inactive
2月 27 20:15:19 archer sh[1701]: inactive
2月 27 20:15:19 archer sh[1786]: inactive
2月 27 20:15:20 archer sh[1795]: inactive
2月 27 20:15:20 archer sh[1821]: inactive
2月 27 20:15:21 archer sh[1867]: inactive
2月 27 20:15:21 archer sh[1881]: inactive
2月 27 20:15:22 archer sh[1884]: inactive
2月 27 20:15:23 archer sh[1939]: inactive
2月 27 20:15:24 archer sh[1946]: inactive
2月 27 20:15:24 archer sh[1948]: inactive
2月 27 20:15:25 archer sh[1950]: inactive
2月 27 20:15:26 archer sh[1972]: inactive
2月 27 20:15:26 archer sh[2029]: inactive
2月 27 20:15:27 archer sh[2033]: inactive
2月 27 20:15:27 archer sh[2041]: inactive
2月 27 20:15:28 archer sh[2043]: inactive
2月 27 20:15:28 archer sh[2075]: inactive
2月 27 20:15:29 archer sh[2077]: inactive
2月 27 20:15:29 archer sh[2079]: inactive
2月 27 20:15:30 archer sh[2088]: inactive
2月 27 20:15:31 archer sh[2091]: inactive
2月 27 20:15:31 archer sh[2141]: inactive
2月 27 20:15:33 archer sh[2147]: inactive
2月 27 20:15:34 archer sh[2159]: inactive
2月 27 20:15:34 archer sh[2166]: inactive
2月 27 20:15:37 archer sh[2249]: inactive
2月 27 20:15:37 archer sh[2256]: inactive
2月 27 20:15:38 archer sh[2259]: inactive
2月 27 20:15:39 archer sh[2263]: inactive
2月 27 20:15:39 archer sh[2266]: inactive
2月 27 20:15:41 archer sh[2278]: inactive
2月 27 20:15:43 archer sh[2331]: inactive
2月 27 20:15:45 archer sh[2341]: inactive
2月 27 20:15:45 archer sh[2343]: inactive
2月 27 20:15:47 archer sh[2401]: inactive
2月 27 20:15:49 archer sh[2405]: inactive
2月 27 20:15:50 archer sh[2409]: inactive
2月 27 20:15:52 archer sh[2428]: inactive
2月 27 20:15:53 archer sh[2491]: inactive
2月 27 20:15:54 archer sh[2496]: inactive
2月 27 20:15:55 archer sh[2523]: inactive
2月 27 20:16:00 archer sh[2592]: inactive
2月 27 20:16:00 archer sh[2594]: inactive
2月 27 20:16:01 archer sh[2596]: inactive
2月 27 20:16:03 archer sh[2652]: inactive
2月 27 20:16:06 archer sh[2664]: inactive
2月 27 20:16:07 archer sh[2669]: inactive
2月 27 20:16:11 archer sh[2729]: inactive
2月 27 20:16:12 archer sh[2733]: inactive
2月 27 20:16:14 archer sh[2787]: inactive
2月 27 20:16:15 archer sh[2791]: inactive
2月 27 20:16:15 archer sh[2874]: inactive
2月 27 20:16:18 archer sh[2888]: inactive
2月 27 20:16:19 archer sh[2942]: inactive
2月 27 20:16:20 archer sh[2955]: inactive
2月 27 20:16:21 archer sh[2984]: inactive
2月 27 20:16:22 archer sh[2996]: inactive
2月 27 20:16:22 archer sh[2998]: inactive
2月 27 20:16:23 archer sh[3005]: inactive
2月 27 20:16:24 archer sh[3021]: inactive
2月 27 20:16:26 archer sh[3066]: inactive
2月 27 20:16:26 archer sh[3068]: inactive
2月 27 20:16:28 archer sh[3077]: inactive
2月 27 20:16:29 archer sh[3079]: inactive
2月 27 20:16:31 archer sh[3137]: inactive
2月 27 20:16:31 archer sh[3139]: inactive
2月 27 20:16:32 archer sh[3141]: inactive
2月 27 20:16:35 archer sh[3176]: inactive
2月 27 20:16:35 archer sh[3200]: inactive
2月 27 20:16:36 archer sh[3204]: inactive
2月 27 20:16:39 archer sh[3233]: inactive
2月 27 20:16:39 archer sh[3235]: inactive
2月 27 20:16:41 archer sh[3289]: inactive
2月 27 20:16:42 archer sh[3291]: inactive
2月 27 20:16:42 archer systemd[792]: podman-user-wait-network-online.service: start operation timed out. Terminating.
2月 27 20:16:42 archer systemd[792]: podman-user-wait-network-online.service: Main process exited, code=killed, status=15/TERM
2月 27 20:16:42 archer systemd[792]: podman-user-wait-network-online.service: Failed with result 'timeout'.
2月 27 20:16:42 archer systemd[792]: Failed to start Wait for system level network-online.target as user..
2月 27 20:16:42 archer systemd[792]: podman-user-wait-network-online.service: Consumed 1.150s CPU time, 2.8M memory peak.
离线
啊,原来是这样!你这个 podman-user-wait-network-online.service 是用户级的服务,wants 不到系统级的 network-online.target。那你把它 add-wants 到你的 default.target 试试?这样:
sudo systemctl add-wants network-online.target default.target
离线
啊,原来是这样!你这个 podman-user-wait-network-online.service 是用户级的服务,wants 不到系统级的 network-online.target。那你把它 add-wants 到你的 default.target 试试?这样:
sudo systemctl add-wants network-online.target default.target
你好,我加了上述命令,还是不行
systemctl list-dependencies network-online.target
network-online.target
○ ├─NetworkManager-wait-online.service
● └─graphical.target
● ├─sddm.service
● └─multi-user.target
● ├─clash-verge-service.service
● ├─dbus-broker.service
● ├─libvirtd.service
● ├─NetworkManager.service
● ├─systemd-ask-password-wall.path
● ├─systemd-logind.service
离线
[Unit]
Description=Wait for system level network-online.target as user.
Documentation=https://github.com/containers/podman/issues/22197
Documentation=man:podman-systemd.unit(5)
[Service]
Type=oneshot
# Set a timeout as by default oneshot does not have one and in case network-online.target
# never comes online we do not want to block forever, 90s is the default systemd unit timeout.
TimeoutStartSec=90s
ExecStart=/bin/sh -c 'until systemctl is-active network-online.target; do sleep 0.5; done'
RemainAfterExit=yes
因为是用户的服务,所以不用加 Wants=network-online.target,这个服务是用
ExecStart=/bin/sh -c 'until systemctl is-active network-online.target; do sleep 0.5; done'
检测系统network-online.target是否激活。然而这个服务阻塞了90s,所以我的podman服务迟迟无法访问,最后还是回到了系统network-online.target及其依赖NetworkManager-wait-online.service 无法激活这个问题
离线
你 systemctl status network-online.target 看看?
离线
❯ systemctl status network-online.target
○ network-online.target - Network is Online
Loaded: loaded (/usr/lib/systemd/system/network-online.target; static)
Active: inactive (dead)
Docs: man:systemd.special(7)
https://systemd.io/NETWORK_ONLINE
离线