Systemd, Centos7 : network-online.target doesn't want to run service

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











up vote
1
down vote

favorite












I have a problem with newly created service in systemd.
I want, that service A will start after network-online.target
What service A does? - runs the script with echo "xxx" > resolf.conf



I tried almost everything : editing network-online.target, network.service but with no effect.



This is how service A looks like:



[Unit]
Description=Nadpisuje plik /etc/resolv.conf
After=network-online.target

[Service]
Type=oneshot
User=root
WorkingDirectory=/opt/
ExecStart=/opt/skrypt.sh
RemainAfterExit=true
StandardOutput=journal

[Install]
WantedBy= multi-user.target basic.target network-online.target









share|improve this question























  • Related:  Cause a script to execute after networking has started?  and  How can I make my user services wait till the network is online?
    – G-Man
    Aug 7 at 9:14














up vote
1
down vote

favorite












I have a problem with newly created service in systemd.
I want, that service A will start after network-online.target
What service A does? - runs the script with echo "xxx" > resolf.conf



I tried almost everything : editing network-online.target, network.service but with no effect.



This is how service A looks like:



[Unit]
Description=Nadpisuje plik /etc/resolv.conf
After=network-online.target

[Service]
Type=oneshot
User=root
WorkingDirectory=/opt/
ExecStart=/opt/skrypt.sh
RemainAfterExit=true
StandardOutput=journal

[Install]
WantedBy= multi-user.target basic.target network-online.target









share|improve this question























  • Related:  Cause a script to execute after networking has started?  and  How can I make my user services wait till the network is online?
    – G-Man
    Aug 7 at 9:14












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I have a problem with newly created service in systemd.
I want, that service A will start after network-online.target
What service A does? - runs the script with echo "xxx" > resolf.conf



I tried almost everything : editing network-online.target, network.service but with no effect.



This is how service A looks like:



[Unit]
Description=Nadpisuje plik /etc/resolv.conf
After=network-online.target

[Service]
Type=oneshot
User=root
WorkingDirectory=/opt/
ExecStart=/opt/skrypt.sh
RemainAfterExit=true
StandardOutput=journal

[Install]
WantedBy= multi-user.target basic.target network-online.target









share|improve this question















I have a problem with newly created service in systemd.
I want, that service A will start after network-online.target
What service A does? - runs the script with echo "xxx" > resolf.conf



I tried almost everything : editing network-online.target, network.service but with no effect.



This is how service A looks like:



[Unit]
Description=Nadpisuje plik /etc/resolv.conf
After=network-online.target

[Service]
Type=oneshot
User=root
WorkingDirectory=/opt/
ExecStart=/opt/skrypt.sh
RemainAfterExit=true
StandardOutput=journal

[Install]
WantedBy= multi-user.target basic.target network-online.target






centos systemd






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 days ago









Rui F Ribeiro

36.5k1271116




36.5k1271116










asked Aug 7 at 8:36









kjkj3456

61




61











  • Related:  Cause a script to execute after networking has started?  and  How can I make my user services wait till the network is online?
    – G-Man
    Aug 7 at 9:14
















  • Related:  Cause a script to execute after networking has started?  and  How can I make my user services wait till the network is online?
    – G-Man
    Aug 7 at 9:14















Related:  Cause a script to execute after networking has started?  and  How can I make my user services wait till the network is online?
– G-Man
Aug 7 at 9:14




Related:  Cause a script to execute after networking has started?  and  How can I make my user services wait till the network is online?
– G-Man
Aug 7 at 9:14















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
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: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f461001%2fsystemd-centos7-network-online-target-doesnt-want-to-run-service%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%2funix.stackexchange.com%2fquestions%2f461001%2fsystemd-centos7-network-online-target-doesnt-want-to-run-service%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Christian Cage

How to properly install USB display driver for Fresco Logic FL2000DX on Ubuntu?