systemd job wait for DNS lookup

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite












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









share|improve this question





















  • Did you ever figure out a solution for this?
    – mightimaus
    Aug 4 at 1:14














up vote
1
down vote

favorite












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









share|improve this question





















  • Did you ever figure out a solution for this?
    – mightimaus
    Aug 4 at 1:14












up vote
1
down vote

favorite









up vote
1
down vote

favorite











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









share|improve this question













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






networking dns systemd






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 31 at 17:51









David

224




224











  • Did you ever figure out a solution for this?
    – mightimaus
    Aug 4 at 1:14
















  • Did you ever figure out a solution for this?
    – mightimaus
    Aug 4 at 1:14















Did you ever figure out a solution for this?
– mightimaus
Aug 4 at 1:14




Did you ever figure out a solution for this?
– mightimaus
Aug 4 at 1:14















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1001806%2fsystemd-job-wait-for-dns-lookup%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1001806%2fsystemd-job-wait-for-dns-lookup%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491