SystemdUser: Persistent=true runs missed jobs at boot before the network is up, so network jobs fail on every boot

Abierto
#2,785 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 5 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
linux, typescript

Línea de trabajo

Start with LIFEOS/TOOLS/lib/SystemdUser.ts and inspect renderService, then look for tests covering generated systemd units. Check how the installer detects nm-online and how calendar, interval, and daemon units are rendered. Done means calendar jobs wait for NetworkManager when available, with a timeout, while interval jobs, daemons, and machines without nm-online keep their current behavior.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

What happens

On Linux, LIFEOS/TOOLS/lib/SystemdUser.ts renders each scheduled job as a systemd --user oneshot service plus a timer with Persistent=true. When the machine was off at the scheduled time, Persistent=true runs the missed job as soon as the user manager starts at boot. That is before NetworkManager has connected, so every job that calls the network fails on the first run after each boot.

Observed

Over 12 days, com.lifeos.commitmentsweep and com.lifeos.modelsync failed on each of the three boot catch-up runs and on no other run:

Event Time
user manager starts both jobs 08:20:21
both exit 1 (error connecting to api.github.com) 08:20:22
NetworkManager: state is now CONNECTED_GLOBAL 08:20:28

User units cannot order themselves after the system network-online.target, because the user manager does not see system targets.

Fix we run locally

renderService adds this line to every calendar (OnCalendar=) unit, only when nm-online is found on the machine at install time:

ExecStartPre=-/usr/bin/nm-online -q -t 60

When the network is already up, it returns at once. At boot, it waits the few seconds until NetworkManager connects. The leading - lets a 60 s timeout fall through to the job, which then fails visibly as before. Interval units and daemons are left as they were: offline, an interval job every few minutes would wait 60 s on every run, and none of ours failed at boot. Machines without NetworkManager (for example macOS, or systemd-networkd) render the unit unchanged.

Lenguaje dominante
TypeScript
Estrellas
19.9k
Forks
2.5k
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de danielmiessler/LifeOS

Todos los issues de danielmiessler/LifeOS

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.