You are not logged in.

#1 2023-11-28 20:58:30

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 635

Reflector.service fails to start automatically after reboot.

For an obscure to me reason reflector.service fails to start automatically after I boot into Arch, but I can start it manually without any issues.

Here's what I see after reboot

$ systemctl --failed
  UNIT              LOAD   ACTIVE SUB    DESCRIPTION                              
● reflector.service loaded failed failed Refresh Pacman mirrorlist with Reflector.

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.
1 loaded units listed.

$ sudo systemctl status reflector.service
[sudo] hasło użytkownika zbigniew: 
× reflector.service - Refresh Pacman mirrorlist with Reflector.
     Loaded: loaded (/usr/lib/systemd/system/reflector.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Tue 2023-11-28 21:40:12 CET; 2min 2s ago
TriggeredBy: ● reflector.timer
       Docs: https://wiki.archlinux.org/index.php/Reflector
    Process: 2464 ExecStart=/usr/bin/reflector @/etc/xdg/reflector/reflector.conf (code=exited, status=1/FAILURE)
   Main PID: 2464 (code=exited, status=1/FAILURE)
        CPU: 75ms

lis 28 21:40:12 MSI-Arch systemd[1]: Starting Refresh Pacman mirrorlist with Reflector....
lis 28 21:40:12 MSI-Arch reflector[2464]: error: failed to retrieve mirrorstatus data: URLError: <urlopen error [Errno -3] Temporary failure in name resoluti>
lis 28 21:40:12 MSI-Arch systemd[1]: reflector.service: Main process exited, code=exited, status=1/FAILURE
lis 28 21:40:12 MSI-Arch systemd[1]: reflector.service: Failed with result 'exit-code'.
lis 28 21:40:12 MSI-Arch systemd[1]: Failed to start Refresh Pacman mirrorlist with Reflector..

$ sudo systemctl status reflector.timer
● reflector.timer - Refresh Pacman mirrorlist weekly with Reflector.
     Loaded: loaded (/usr/lib/systemd/system/reflector.timer; enabled; preset: disabled)
     Active: active (waiting) since Tue 2023-11-28 21:40:06 CET; 3min 30s ago
    Trigger: Mon 2023-12-04 10:46:05 CET; 5 days left
   Triggers: ● reflector.service

And the config /etc/systemd/system/multi-user.target.wants/reflector.service

[Unit]
Description=Refresh Pacman mirrorlist with Reflector.
Documentation=https://wiki.archlinux.org/index.php/Reflector
Wants=network-online.target nss-lookup.target
After=network-online.target nss-lookup.target

[Service]
Type=oneshot
ExecStart=/usr/bin/reflector @/etc/xdg/reflector/reflector.conf
CacheDirectory=reflector
# CapabilityBoundingSet=~CAP_SETUID CAP_SETGID CAP_SETPCAP CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_CHOWN CAP_FSETID CAP_SETFCAP CAP_DAC_OVERRIDE CAP_DAC_READ_SEARCH CAP_FOWNER CAP_IPC_OWNER CAP_NET_ADMIN CAP_SYS_TIME CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE CAP_KILL CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_SYS_NICE CAP_SYS_RESOURCE CAP_MAC_ADMIN CAP_MAC_OVERRIDE CAP_SYS_BOOT CAP_LINUX_IMMUTABLE CAP_IPC_LOCK CAP_SYS_CHROOT CAP_BLOCK_SUSPEND CAP_LEASE CAP_SYS_PACCT CAP_SYS_TTY_CONFIG CAP_WAKE_ALARM
CapabilityBoundingSet=
Environment=XDG_CACHE_HOME=/var/cache/reflector
LockPersonality=true
MemoryDenyWriteExecute=true
NoNewPrivileges=true
PrivateDevices=true
PrivateTmp=true
PrivateUsers=true
ProtectClock=true
ProtectControlGroups=true
ProtectHome=true
ProtectHostname=true
ProtectKernelTunables=true
ProtectKernelLogs=true
ProtectKernelModules=true
ProtectSystem=strict
ReadOnlyPaths=/etc/xdg/reflector/reflector.conf
ReadWritePaths=/etc/pacman.d/mirrorlist
RemoveIPC=true
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
RestrictNamespaces=true
RestrictRealtime=true
RestrictSUIDSGID=true
SystemCallArchitectures=native
SystemCallFilter=@system-service
SystemCallFilter=~@resources @privileged
UMask=177

[Install]
WantedBy=multi-user.target

What did I miss?


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#2 2023-11-28 22:45:04

seth
Member
Registered: 2012-09-03
Posts: 50,938

Re: Reflector.service fails to start automatically after reboot.

lis 28 21:40:12 MSI-Arch reflector[2464]: error: failed to retrieve mirrorstatus data: URLError: <urlopen error [Errno -3] Temporary failure in name resoluti>

What provides your network? The network-online.target for the most part is useless, see eg. https://wiki.archlinux.org/title/System … ait-online

Offline

#3 2023-11-29 21:30:07

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 635

Re: Reflector.service fails to start automatically after reboot.

seth wrote:
lis 28 21:40:12 MSI-Arch reflector[2464]: error: failed to retrieve mirrorstatus data: URLError: <urlopen error [Errno -3] Temporary failure in name resoluti>

What provides your network? The network-online.target for the most part is useless, see eg. https://wiki.archlinux.org/title/System … ait-online

I think you mean Network Manager (?)

● NetworkManager.service - Network Manager
     Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; preset: disabled)
     Active: active (running) since Wed 2023-11-29 21:53:26 CET; 31min ago
       Docs: man:NetworkManager(8)
   Main PID: 1040 (NetworkManager)
      Tasks: 9 (limit: 76651)
     Memory: 22.3M
        CPU: 5.928s
     CGroup: /system.slice/NetworkManager.service
             ├─ 1040 /usr/bin/NetworkManager --no-daemon
             ├─29567 /usr/lib/nm-openvpn-service --bus-name org.freedesktop.NetworkManager.openvpn.Connection_4
             └─29574 /usr/sbin/openvpn --remote 146.70.161.178 80 udp --explicit-exit-notify --remote 146.70.161.178 51820 udp --explicit-exit-notify --remote 146.70.161.178 4569 udp --explicit-exit-notify --remote 146.70.161.178 1194 udp --explicit-exit-notify --remote 146.70.161.178 5060 udp --explicit-exit-notify --remote-random --connect-timeout 20 --nobind --dev tun --cipher AES-256-GCM --data-ciphers AES-256-GCM --auth-nocache --tls-crypt /home/zbigniew/.cert/nm-openvpn/ProtonVPN-bqlz9jf9-tls-crypt.pem --verify-x509-name node-pl-06.protonvpn.net name --remote-cert-tls server --reneg-sec 0 --verb 1 --syslog nm-openvpn --tun-mtu 1500 --mssfix 0 --script-security 2 --up "/usr/lib/nm-openvpn-service-openvpn-helper --debug 0 29567 --bus-name org.freedesktop.NetworkManager.openvpn.Connection_4 --tun --" --up-restart --persist-key --persist-tun --management /var/run/NetworkManager/nm-openvpn-dcc22196-1859-4a1a-a856-8b063a19115e unix --management-client-user root --management-client-group root --management-query-passwords --auth-retry interact --route-noexec --ifconfig-noexec --client --auth-user-pass --ca /home/zbigniew/.cert/nm-openvpn/ProtonVPN-bqlz9jf9-ca.pem --user nm-openvpn --group nm-openvpn

lis 29 22:21:39 MSI-Arch nm-openvpn[29574]: AEAD Decrypt error: bad packet ID (may be a replay): [ #116128 ] -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
lis 29 22:21:39 MSI-Arch nm-openvpn[29574]: AEAD Decrypt error: bad packet ID (may be a replay): [ #116129 ] -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
lis 29 22:21:39 MSI-Arch nm-openvpn[29574]: AEAD Decrypt error: bad packet ID (may be a replay): [ #116130 ] -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
lis 29 22:21:39 MSI-Arch nm-openvpn[29574]: AEAD Decrypt error: bad packet ID (may be a replay): [ #116131 ] -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
lis 29 22:21:39 MSI-Arch nm-openvpn[29574]: AEAD Decrypt error: bad packet ID (may be a replay): [ #116132 ] -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
lis 29 22:21:39 MSI-Arch nm-openvpn[29574]: AEAD Decrypt error: bad packet ID (may be a replay): [ #116133 ] -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
lis 29 22:21:39 MSI-Arch nm-openvpn[29574]: AEAD Decrypt error: bad packet ID (may be a replay): [ #116134 ] -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
lis 29 22:21:39 MSI-Arch nm-openvpn[29574]: AEAD Decrypt error: bad packet ID (may be a replay): [ #116135 ] -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
lis 29 22:21:39 MSI-Arch nm-openvpn[29574]: AEAD Decrypt error: bad packet ID (may be a replay): [ #116136 ] -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
lis 29 22:21:39 MSI-Arch nm-openvpn[29574]: AEAD Decrypt error: bad packet ID (may be a replay): [ #116137 ] -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings

I based the configuration of reflector.service on it

$ systemctl is-enabled NetworkManager-wait-online.service
enabled

$ systemctl is-enabled systemd-networkd.service
disabled

Last edited by Zibi1981 (2023-11-29 21:30:43)


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#4 2023-11-29 21:40:21

seth
Member
Registered: 2012-09-03
Posts: 50,938

Re: Reflector.service fails to start automatically after reboot.

Likewise useless by default, https://wiki.archlinux.org/title/Networ … ait-online
Removing the "-s" will break the service for static leases.

Offline

#5 2023-11-30 20:17:12

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 635

Re: Reflector.service fails to start automatically after reboot.

So, if I get you right, regardless of the configuration, automation won't work for reflector.service?


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#6 2023-11-30 20:32:17

seth
Member
Registered: 2012-09-03
Posts: 50,938

Re: Reflector.service fails to start automatically after reboot.

The "network-online.target" won't do by default what any sane human would ever expect - regardless in what context.
You can alter the behavior of the NetworkManager-wait-online.service itr, w/ the known caveats.

If that's undesireable, you could just "ExecStartPre=sleep 60" to unconditioanlly wait 60s before reflector actually runs.
Or sth. like

while ! ping -qc1 google.com > /dev/null; do sleep 1; done

Offline

#7 2023-12-01 18:17:41

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 635

Re: Reflector.service fails to start automatically after reboot.

seth wrote:

Or sth. like

while ! ping -qc1 google.com > /dev/null; do sleep 1; done

In which part of the /etc/systemd/system/multi-user.target.wants/reflector.service should I add this entry?


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#8 2023-12-01 22:25:45

seth
Member
Registered: 2012-09-03
Posts: 50,938

Re: Reflector.service fails to start automatically after reboot.

ExecStartPre - I'm at hand not sure whether it'll use a system call to execute this (ie. you can use shell logics) but you could wrap it in an executable "wait_for_interwebz.sh" or "bash -c '…'" it.

Maybe there should™ be a systemd service that actually provides this for an "internet-ready.target"…

Offline

#9 2023-12-02 12:51:42

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 635

Re: Reflector.service fails to start automatically after reboot.

Here's how it goes:

1) /etc/systemd/system/multi-user.target.wants/reflector.service

[Unit]
Description=Refresh Pacman mirrorlist with Reflector.
Documentation=https://wiki.archlinux.org/index.php/Reflector
Wants=network-online.target nss-lookup.target
After=network-online.target nss-lookup.target

[Service]
Type=oneshot
ExecStartPre=while ! ping -qc1 google.com > /dev/null; do sleep 1; done
ExecStart=/usr/bin/reflector @/etc/xdg/reflector/reflector.conf
CacheDirectory=reflector
# CapabilityBoundingSet=~CAP_SETUID CAP_SETGID CAP_SETPCAP CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_CHOWN CAP_FSETID CAP_SETFCAP CAP_DAC_OVERRIDE CAP_DAC_READ_SEARCH CAP_FOWNER CAP_IPC_OWNER CAP_NET_ADMIN CAP_SYS_TIME CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE CAP_KILL CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_SYS_NICE CAP_SYS_RESOURCE CAP_MAC_ADMIN CAP_MAC_OVERRIDE CAP_SYS_BOOT CAP_LINUX_IMMUTABLE CAP_IPC_LOCK CAP_SYS_CHROOT CAP_BLOCK_SUSPEND CAP_LEASE CAP_SYS_PACCT CAP_SYS_TTY_CONFIG CAP_WAKE_ALARM
CapabilityBoundingSet=
Environment=XDG_CACHE_HOME=/var/cache/reflector
(...)

2) At system startup

$ sudo systemctl status reflector.service
[sudo] hasło użytkownika zbigniew: 
× reflector.service - Refresh Pacman mirrorlist with Reflector.
     Loaded: loaded (/usr/lib/systemd/system/reflector.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Sat 2023-12-02 13:43:47 CET; 4min 2s ago
TriggeredBy: ● reflector.timer
       Docs: https://wiki.archlinux.org/index.php/Reflector
    Process: 3376 ExecStartPre=while ! ping -qc1 google.com > /dev/null; do sleep 1; done (code=exited, status=203/EXEC)
        CPU: 13ms

gru 02 13:43:47 MSI-Arch systemd[1]: Starting Refresh Pacman mirrorlist with Reflector....
gru 02 13:43:47 MSI-Arch (while)[3376]: reflector.service: Failed to locate executable while: No such file or directory
gru 02 13:43:47 MSI-Arch (while)[3376]: reflector.service: Failed at step EXEC spawning while: No such file or directory
gru 02 13:43:47 MSI-Arch systemd[1]: reflector.service: Control process exited, code=exited, status=203/EXEC
gru 02 13:43:47 MSI-Arch systemd[1]: reflector.service: Failed with result 'exit-code'.
gru 02 13:43:47 MSI-Arch systemd[1]: Failed to start Refresh Pacman mirrorlist with Reflector..


$ sudo systemctl start reflector.service
Job for reflector.service failed because the control process exited with error code.
See "systemctl status reflector.service" and "journalctl -xeu reflector.service" for details.

"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#10 2023-12-02 14:54:07

seth
Member
Registered: 2012-09-03
Posts: 50,938

Re: Reflector.service fails to start automatically after reboot.

Failed to locate executable while:
seth wrote:

you could wrap it in an executable "wait_for_interwebz.sh" or "bash -c '…'" it.

Offline

#11 2023-12-02 22:12:48

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 635

Re: Reflector.service fails to start automatically after reboot.

○ reflector.service - Refresh Pacman mirrorlist with Reflector.
     Loaded: bad-setting (Reason: Unit reflector.service has a bad unit file setting.)
     Active: inactive (dead) since Sat 2023-12-02 23:06:06 CET; 6min ago
TriggeredBy: ● reflector.timer
       Docs: https://wiki.archlinux.org/index.php/Reflector
   Main PID: 27742 (code=exited, status=0/SUCCESS)
        CPU: 211ms

gru 02 23:05:05 MSI-Arch systemd[1]: Starting Refresh Pacman mirrorlist with Reflector....
gru 02 23:06:06 MSI-Arch systemd[1]: reflector.service: Deactivated successfully.
gru 02 23:06:06 MSI-Arch systemd[1]: Finished Refresh Pacman mirrorlist with Reflector..
gru 02 23:11:09 MSI-Arch systemd[1]: /usr/lib/systemd/system/reflector.service:9: Neither a valid executable name nor an absolute path: bash -c while ! ping -qc1 google.com > /dev/null; do sleep 1; done
gru 02 23:11:09 MSI-Arch systemd[1]: reflector.service: Unit configuration has fatal error, unit will not be started.

"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#12 2023-12-02 22:18:03

seth
Member
Registered: 2012-09-03
Posts: 50,938

Re: Reflector.service fails to start automatically after reboot.

bash -c 'while ! ping -qc1 google.com > /dev/null; do sleep 1; done'

The quotes aren't optional.

Offline

#13 2023-12-04 21:44:45

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 635

Re: Reflector.service fails to start automatically after reboot.

Although after reboot reflector.service seems to start, I see these messages

$ systemctl status reflector.service
● reflector.service - Refresh Pacman mirrorlist with Reflector.
     Loaded: loaded (/usr/lib/systemd/system/reflector.service; enabled; preset: disabled)
     Active: activating (start-pre) since Mon 2023-12-04 22:33:03 CET; 7min ago
TriggeredBy: ● reflector.timer
       Docs: https://wiki.archlinux.org/index.php/Reflector
  Cntrl PID: 2456 (bash)
      Tasks: 2 (limit: 76651)
     Memory: 1.6M
        CPU: 2.247s
     CGroup: /system.slice/reflector.service
             ├─ 2456 bash -c "while ! ping -qc1 google.com > /dev/null; do sleep 1; done"
             └─31635 sleep 1

gru 04 22:40:26 MSI-Arch bash[2456]: bash: linia 1: 31446 Błędne wywołanie systemowe     (zrzut pamięci) ping -qc1 google.com > /dev/null
gru 04 22:40:27 MSI-Arch bash[2456]: bash: linia 1: 31456 Błędne wywołanie systemowe     (zrzut pamięci) ping -qc1 google.com > /dev/null
gru 04 22:40:29 MSI-Arch bash[2456]: bash: linia 1: 31465 Błędne wywołanie systemowe     (zrzut pamięci) ping -qc1 google.com > /dev/null
gru 04 22:40:30 MSI-Arch bash[2456]: bash: linia 1: 31482 Błędne wywołanie systemowe     (zrzut pamięci) ping -qc1 google.com > /dev/null
gru 04 22:40:31 MSI-Arch bash[2456]: bash: linia 1: 31529 Błędne wywołanie systemowe     (zrzut pamięci) ping -qc1 google.com > /dev/null
gru 04 22:40:32 MSI-Arch bash[2456]: bash: linia 1: 31540 Błędne wywołanie systemowe     (zrzut pamięci) ping -qc1 google.com > /dev/null
gru 04 22:40:33 MSI-Arch bash[2456]: bash: linia 1: 31552 Błędne wywołanie systemowe     (zrzut pamięci) ping -qc1 google.com > /dev/null
gru 04 22:40:34 MSI-Arch bash[2456]: bash: linia 1: 31569 Błędne wywołanie systemowe     (zrzut pamięci) ping -qc1 google.com > /dev/null
gru 04 22:40:35 MSI-Arch bash[2456]: bash: linia 1: 31622 Błędne wywołanie systemowe     (zrzut pamięci) ping -qc1 google.com > /dev/null
gru 04 22:40:36 MSI-Arch bash[2456]: bash: linia 1: 31631 Błędne wywołanie systemowe     (zrzut pamięci) ping -qc1 google.com > /dev/null

Are the "Incorrect system calls (core dumps)" due to the script trying to and failing to connect/ping, but eventually succeeding, or is it pinging endlessly?

$ systemctl status reflector.service
● reflector.service - Refresh Pacman mirrorlist with Reflector.
     Loaded: loaded (/usr/lib/systemd/system/reflector.service; enabled; preset: disabled)
     Active: activating (start-pre) since Mon 2023-12-04 22:33:03 CET; 18min ago
TriggeredBy: ● reflector.timer
       Docs: https://wiki.archlinux.org/index.php/Reflector
  Cntrl PID: 2456 (bash)
      Tasks: 2 (limit: 76651)
     Memory: 1.8M
        CPU: 5.570s
     CGroup: /system.slice/reflector.service
             ├─ 2456 bash -c "while ! ping -qc1 google.com > /dev/null; do sleep 1; done"
             └─45358 sleep 1

gru 04 22:51:46 MSI-Arch bash[2456]: bash: linia 1: 45168 Błędne wywołanie systemowe     (zrzut pamięci) ping -qc1 google.com > /dev/null
gru 04 22:51:47 MSI-Arch bash[2456]: bash: linia 1: 45185 Błędne wywołanie systemowe     (zrzut pamięci) ping -qc1 google.com > /dev/null
gru 04 22:51:48 MSI-Arch bash[2456]: bash: linia 1: 45233 Błędne wywołanie systemowe     (zrzut pamięci) ping -qc1 google.com > /dev/null
gru 04 22:51:49 MSI-Arch bash[2456]: bash: linia 1: 45242 Błędne wywołanie systemowe     (zrzut pamięci) ping -qc1 google.com > /dev/null
gru 04 22:51:50 MSI-Arch bash[2456]: bash: linia 1: 45251 Błędne wywołanie systemowe     (zrzut pamięci) ping -qc1 google.com > /dev/null
gru 04 22:51:52 MSI-Arch bash[2456]: bash: linia 1: 45268 Błędne wywołanie systemowe     (zrzut pamięci) ping -qc1 google.com > /dev/null
gru 04 22:51:53 MSI-Arch bash[2456]: bash: linia 1: 45318 Błędne wywołanie systemowe     (zrzut pamięci) ping -qc1 google.com > /dev/null
gru 04 22:51:54 MSI-Arch bash[2456]: bash: linia 1: 45328 Błędne wywołanie systemowe     (zrzut pamięci) ping -qc1 google.com > /dev/null
gru 04 22:51:55 MSI-Arch bash[2456]: bash: linia 1: 45337 Błędne wywołanie systemowe     (zrzut pamięci) ping -qc1 google.com > /dev/null
gru 04 22:51:56 MSI-Arch bash[2456]: bash: linia 1: 45354 Błędne wywołanie systemowe     (zrzut pamięci) ping -qc1 google.com > /dev/null

Last edited by Zibi1981 (2023-12-04 21:52:49)


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#14 2023-12-05 07:16:14

seth
Member
Registered: 2012-09-03
Posts: 50,938

Re: Reflector.service fails to start automatically after reboot.

seth wrote:

bash -c 'while ! ping -qc1 google.com > /dev/null; do sleep 1; done'

single and double quotes have different features.
Seriously, just put that into a script

/usr/local/bin/wait_for_interwebz.sh

#!/bin/bash
while ! ping -qc1 google.com > /dev/null; do sleep 1; done
chmod +x /usr/local/bin/wait_for_interwebz.sh
ExecStartPre=/usr/local/bin/wait_for_interwebz.sh

Offline

#15 2023-12-05 20:57:18

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 635

Re: Reflector.service fails to start automatically after reboot.

I see your point, but the external script works the same way as putting it inside the Reflector's config file

$ systemctl status reflector.service
● reflector.service - Refresh Pacman mirrorlist with Reflector.
     Loaded: loaded (/usr/lib/systemd/system/reflector.service; enabled; preset: disabled)
     Active: activating (start-pre) since Tue 2023-12-05 21:51:37 CET; 1min 17s ago
TriggeredBy: ● reflector.timer
       Docs: https://wiki.archlinux.org/index.php/Reflector
  Cntrl PID: 2461 (wait_for_interw)
      Tasks: 2 (limit: 76651)
     Memory: 1.7M
        CPU: 386ms
     CGroup: /system.slice/reflector.service
             ├─ 2461 /bin/bash /usr/local/bin/wait_for_interwebz.sh
             └─21586 sleep 1

gru 05 21:52:43 MSI-Arch wait_for_interwebz.sh[2461]: /usr/local/bin/wait_for_interwebz.sh: linia 2: 21342 Błędne wywołanie systemowe     (zrzut pamięci) pin>
gru 05 21:52:44 MSI-Arch wait_for_interwebz.sh[2461]: /usr/local/bin/wait_for_interwebz.sh: linia 2: 21366 Błędne wywołanie systemowe     (zrzut pamięci) pin>
gru 05 21:52:46 MSI-Arch wait_for_interwebz.sh[2461]: /usr/local/bin/wait_for_interwebz.sh: linia 2: 21416 Błędne wywołanie systemowe     (zrzut pamięci) pin>
gru 05 21:52:47 MSI-Arch wait_for_interwebz.sh[2461]: /usr/local/bin/wait_for_interwebz.sh: linia 2: 21429 Błędne wywołanie systemowe     (zrzut pamięci) pin>
gru 05 21:52:48 MSI-Arch wait_for_interwebz.sh[2461]: /usr/local/bin/wait_for_interwebz.sh: linia 2: 21446 Błędne wywołanie systemowe     (zrzut pamięci) pin>
gru 05 21:52:49 MSI-Arch wait_for_interwebz.sh[2461]: /usr/local/bin/wait_for_interwebz.sh: linia 2: 21474 Błędne wywołanie systemowe     (zrzut pamięci) pin>
gru 05 21:52:50 MSI-Arch wait_for_interwebz.sh[2461]: /usr/local/bin/wait_for_interwebz.sh: linia 2: 21529 Błędne wywołanie systemowe     (zrzut pamięci) pin>
gru 05 21:52:51 MSI-Arch wait_for_interwebz.sh[2461]: /usr/local/bin/wait_for_interwebz.sh: linia 2: 21544 Błędne wywołanie systemowe     (zrzut pamięci) pin>
gru 05 21:52:52 MSI-Arch wait_for_interwebz.sh[2461]: /usr/local/bin/wait_for_interwebz.sh: linia 2: 21559 Błędne wywołanie systemowe     (zrzut pamięci) pin>
gru 05 21:52:53 MSI-Arch wait_for_interwebz.sh[2461]: /usr/local/bin/wait_for_interwebz.sh: linia 2: 21582 Błędne wywołanie systemowe     (zrzut pamięci) pin>

[zbigniew@MSI-Arch ~]$ systemctl status reflector.service
● reflector.service - Refresh Pacman mirrorlist with Reflector.
     Loaded: loaded (/usr/lib/systemd/system/reflector.service; enabled; preset: disabled)
     Active: activating (start-pre) since Tue 2023-12-05 21:51:37 CET; 1min 55s ago
TriggeredBy: ● reflector.timer
       Docs: https://wiki.archlinux.org/index.php/Reflector
  Cntrl PID: 2461 (wait_for_interw)
      Tasks: 2 (limit: 76651)
     Memory: 2.2M
        CPU: 586ms
     CGroup: /system.slice/reflector.service
             ├─ 2461 /bin/bash /usr/local/bin/wait_for_interwebz.sh
             └─22326 sleep 1

gru 05 21:53:23 MSI-Arch wait_for_interwebz.sh[2461]: /usr/local/bin/wait_for_interwebz.sh: linia 2: 22139 Błędne wywołanie systemowe     (zrzut pamięci) pin>
gru 05 21:53:24 MSI-Arch wait_for_interwebz.sh[2461]: /usr/local/bin/wait_for_interwebz.sh: linia 2: 22148 Błędne wywołanie systemowe     (zrzut pamięci) pin>
gru 05 21:53:25 MSI-Arch wait_for_interwebz.sh[2461]: /usr/local/bin/wait_for_interwebz.sh: linia 2: 22166 Błędne wywołanie systemowe     (zrzut pamięci) pin>
gru 05 21:53:26 MSI-Arch wait_for_interwebz.sh[2461]: /usr/local/bin/wait_for_interwebz.sh: linia 2: 22214 Błędne wywołanie systemowe     (zrzut pamięci) pin>
gru 05 21:53:27 MSI-Arch wait_for_interwebz.sh[2461]: /usr/local/bin/wait_for_interwebz.sh: linia 2: 22223 Błędne wywołanie systemowe     (zrzut pamięci) pin>
gru 05 21:53:28 MSI-Arch wait_for_interwebz.sh[2461]: /usr/local/bin/wait_for_interwebz.sh: linia 2: 22232 Błędne wywołanie systemowe     (zrzut pamięci) pin>
gru 05 21:53:29 MSI-Arch wait_for_interwebz.sh[2461]: /usr/local/bin/wait_for_interwebz.sh: linia 2: 22250 Błędne wywołanie systemowe     (zrzut pamięci) pin>
gru 05 21:53:30 MSI-Arch wait_for_interwebz.sh[2461]: /usr/local/bin/wait_for_interwebz.sh: linia 2: 22296 Błędne wywołanie systemowe     (zrzut pamięci) pin>
gru 05 21:53:32 MSI-Arch wait_for_interwebz.sh[2461]: /usr/local/bin/wait_for_interwebz.sh: linia 2: 22305 Błędne wywołanie systemowe     (zrzut pamięci) pin>
gru 05 21:53:33 MSI-Arch wait_for_interwebz.sh[2461]: /usr/local/bin/wait_for_interwebz.sh: linia 2: 22314 Błędne wywołanie systemowe     (zrzut pamięci) pin>

"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#16 2023-12-05 21:14:35

seth
Member
Registered: 2012-09-03
Posts: 50,938

Re: Reflector.service fails to start automatically after reboot.

"Błędne wywołanie systemowe" is apparently a SIGPIPE ?

while ! ping -qc1 google.com; do sleep 1; done

Offline

#17 2023-12-05 21:27:45

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 635

Re: Reflector.service fails to start automatically after reboot.

seth wrote:

"Błędne wywołanie systemowe" is apparently a SIGPIPE ?

while ! ping -qc1 google.com; do sleep 1; done

"Błędne wywołanie systemowe" (Polish) = "Invalid system call" (English).
I'm not sure what a SIGPIPE is, I'm not a programmer.

$ while ! ping -qc1 google.com; do sleep 1; done
PING google.com (142.250.186.110) 56(84) bytes of data.

--- google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 36.054/36.054/36.054/0.000 ms

"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#18 2023-12-06 07:52:33

seth
Member
Registered: 2012-09-03
Posts: 50,938

Re: Reflector.service fails to start automatically after reboot.

I googled the polish token and it showed up in relation to https://en.wikipedia.org/wiki/Signal_(IPC)#SIGPIPE - which doesn't make a lot of sense, but whatever.

The plan was to use the unredirected call in the systemd service, systemd might exit w/ that but there's also the default of https://www.freedesktop.org/software/sy … reSIGPIPE=

This might be down to all the ridiculous hardening stuff in the service.

seth wrote:

you could just "ExecStartPre=sleep 60" to unconditioanlly wait 60s before reflector actually runs.

Offline

#19 2023-12-06 18:43:25

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 635

Re: Reflector.service fails to start automatically after reboot.

seth wrote:
seth wrote:

you could just "ExecStartPre=sleep 60" to unconditioanlly wait 60s before reflector actually runs.

I don't have the slightest idea what are you writing about when it comes do SIGPIPE, but when I consider to make the reflector.service unconditionally wait for 60 seconds before running I have one doubt: quite often my Arch (which I dual boot beside Windows 11) has some issues to connect to my 6GHz WiFi and it could take more than 60 seconds. Quite often I have to turn on and off the WiFi switch for more than once to make it see this WiFi.

Last edited by Zibi1981 (2023-12-06 19:09:19)


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#20 2023-12-06 19:01:49

seth
Member
Registered: 2012-09-03
Posts: 50,938

Re: Reflector.service fails to start automatically after reboot.

If you
1. remove the > /dev/null for the ExecStartPre script
2. Explicitly add "IgnoreSIGPIPE=true" to the service
3. start the service only when you've established an internet connection

Do you still get any errors?
Do you still get errors when starting the service w/ the boot?
Does reflector itself still error or does it wait until you got an internet connection.

As a third alternative, you understood that you can change the NM wait-online service in a way such that it only fires when you actually have an internet connection?
https://bbs.archlinux.org/viewtopic.php … 2#p2134412
If you don't use static leases, the caveat becomes irrelevant.

Offline

#21 2023-12-06 22:18:37

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 635

Re: Reflector.service fails to start automatically after reboot.

For now the "sleep=60" thing seems to make its job. I've read the wiki about modifying NetworkManager-wait-online.service and there are issues with it as well.


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#22 2023-12-07 07:54:32

seth
Member
Registered: 2012-09-03
Posts: 50,938

Re: Reflector.service fails to start automatically after reboot.

If you want to re-explore the ping test and there're remaining issues a subshell

(while ! ping -qc1 google.com > /dev/null; do sleep 1; done; true) > /dev/null

might help you out.

Offline

#23 2024-01-03 23:16:18

snakeroot
Member
Registered: 2012-10-06
Posts: 164

Re: Reflector.service fails to start automatically after reboot.

I'd been using a "ping" ExecPre= on most of my network-reliant services quite successfully. With reflector, on the other hand, ping uniformly dumped core.

The solution I found is to add a line

SystemCallFilter=capset setuid

below the line

SystemCallFilter=~@resources @privileged

in the reflector service file. This restores capabilities ping needs to operate.

Offline

Board footer

Powered by FluxBB