1

I've got a startup task via systemd that fails as it is unable to resolve an IP address it should be accessing via DNS. I consistently get and error indicating a Temporary Error in Name Resolution. I've tried various combinations of assigning network-online.target, nss-lookup.target, and systemd-resolved.service to the tasks Wants, Required, and After tags but no dice. I still cannot get the job to start consistently without producing failure on DNS lookup. Any suggestions? Posted an example of what I'm trying to do below.

[Unit]
Description=Does some stuff
Before=multi-user.target
Wants=network-online.target nss-lookup.target systemd-resolved.service
Requires=network-online.target nss-lookup.target systemd-resolved.service
After=network-online.target nss-lookup.target systemd-resolved.service

[Service]
Type=oneshot
User=myuser
SyslogIdentifier=calibration_update
ExecStart=/bin/bash -c 'myservice_command'
RestartSec=5s
Restart=False
LimitNOFILE=1024000

[Install]
WantedBy=multi-user.target
2

0

You must log in to answer this question.

Browse other questions tagged .