Buenas,

Estoy tratando de hacer que systemd haga andar getmail automáticamente.
Esta parte ya funciona; para eso, hice un .service en
.config/systemd/user/[email protected] que dice así:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
[Unit]
Description=getmail %i

[Service]
Type=simple
ExecStart=/usr/bin/getmail -v -iINBOX --rcfile rc-%i
Restart=always

[Install]
WantedBy=default.target
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Luego hice "systemctl --user enable getmail@fastmail" y como tengo un
archivo .getmail/rc-fastmail, parece funcionar perfectamente. 

Lo que no entiendo es cómo hacer que esto se levante sólo si es que
network.target está arriba.  El network.target es del systemd de
sistema, no del usuario (--user), así que veo lo siguiente en el status si es
que agrego "Requires=network.target" en el archivo .service:

● [email protected] - getmail fastmail
   Loaded: loaded (/home/alvherre/.config/systemd/user/[email protected]; 
enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2018-12-28 00:19:20 -03; 5min 
ago
  Process: 3725 ExecStart=/usr/bin/getmail -v -iINBOX --rcfile rc-fastmail 
(code=exited, status=127)
 Main PID: 3725 (code=exited, status=127)

dic 28 00:19:19 alvin systemd[3720]: [email protected]: Main process 
exited, code=exited, status=127/n/a
dic 28 00:19:19 alvin systemd[3720]: [email protected]: Unit entered 
failed state.
dic 28 00:19:19 alvin systemd[3720]: [email protected]: Failed with 
result 'exit-code'.
dic 28 00:19:20 alvin systemd[3720]: [email protected]: Service hold-off 
time over, scheduling restart.
dic 28 00:19:20 alvin systemd[3720]: [email protected]: Failed to 
schedule restart job: Unit network.target not found.
dic 28 00:19:20 alvin systemd[3720]: [email protected]: Unit entered 
failed state.
dic 28 00:19:20 alvin systemd[3720]: [email protected]: Failed with 
result 'exit-code'.


¿Alguna idea cómo resolver esto?

-- 
Álvaro Herrera

Responder a