Systemd, Centos7 : network-online.target doesn't want to run service
Clash 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
centos systemd
add a comment |Â
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
centos systemd
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
add a comment |Â
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
centos systemd
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
centos systemd
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
add a comment |Â
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
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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