How to start a service upon the output of a command?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I would like to start a specific service after another one has completely started. Specifically, I need an OpenVPN service to be up and have completed its startup to start another service.
I would normally use After=
but it does not work as intended with OpenVPN, which informs that it has started right after launch and before its setup is completed.
A solution to this would be to constrain the start of my service to the output or exit status of a script(*) (or to the existence of a file which would be crated by the said script).
Is this possible with systemd?
(*) The script would ping a host known to be accessible only via the VPN tunnel and exit once connectivity is achieved (or drop a file)
systemd
add a comment |Â
up vote
0
down vote
favorite
I would like to start a specific service after another one has completely started. Specifically, I need an OpenVPN service to be up and have completed its startup to start another service.
I would normally use After=
but it does not work as intended with OpenVPN, which informs that it has started right after launch and before its setup is completed.
A solution to this would be to constrain the start of my service to the output or exit status of a script(*) (or to the existence of a file which would be crated by the said script).
Is this possible with systemd?
(*) The script would ping a host known to be accessible only via the VPN tunnel and exit once connectivity is achieved (or drop a file)
systemd
unix.stackexchange.com/questions/388586/â¦
â jasonwryan
Oct 15 '17 at 18:00
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I would like to start a specific service after another one has completely started. Specifically, I need an OpenVPN service to be up and have completed its startup to start another service.
I would normally use After=
but it does not work as intended with OpenVPN, which informs that it has started right after launch and before its setup is completed.
A solution to this would be to constrain the start of my service to the output or exit status of a script(*) (or to the existence of a file which would be crated by the said script).
Is this possible with systemd?
(*) The script would ping a host known to be accessible only via the VPN tunnel and exit once connectivity is achieved (or drop a file)
systemd
I would like to start a specific service after another one has completely started. Specifically, I need an OpenVPN service to be up and have completed its startup to start another service.
I would normally use After=
but it does not work as intended with OpenVPN, which informs that it has started right after launch and before its setup is completed.
A solution to this would be to constrain the start of my service to the output or exit status of a script(*) (or to the existence of a file which would be crated by the said script).
Is this possible with systemd?
(*) The script would ping a host known to be accessible only via the VPN tunnel and exit once connectivity is achieved (or drop a file)
systemd
asked Oct 15 '17 at 17:19
WoJ
366113
366113
unix.stackexchange.com/questions/388586/â¦
â jasonwryan
Oct 15 '17 at 18:00
add a comment |Â
unix.stackexchange.com/questions/388586/â¦
â jasonwryan
Oct 15 '17 at 18:00
unix.stackexchange.com/questions/388586/â¦
â jasonwryan
Oct 15 '17 at 18:00
unix.stackexchange.com/questions/388586/â¦
â jasonwryan
Oct 15 '17 at 18:00
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
You can configure the service unit with
Type=notify
NotifyAccess=all
and make the last script (or a child of that) which is started by OpenVPN during initialization (wait for the desired logging output and then) call systemd-notify
.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You can configure the service unit with
Type=notify
NotifyAccess=all
and make the last script (or a child of that) which is started by OpenVPN during initialization (wait for the desired logging output and then) call systemd-notify
.
add a comment |Â
up vote
0
down vote
You can configure the service unit with
Type=notify
NotifyAccess=all
and make the last script (or a child of that) which is started by OpenVPN during initialization (wait for the desired logging output and then) call systemd-notify
.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
You can configure the service unit with
Type=notify
NotifyAccess=all
and make the last script (or a child of that) which is started by OpenVPN during initialization (wait for the desired logging output and then) call systemd-notify
.
You can configure the service unit with
Type=notify
NotifyAccess=all
and make the last script (or a child of that) which is started by OpenVPN during initialization (wait for the desired logging output and then) call systemd-notify
.
answered Nov 4 '17 at 16:25
Hauke Laging
53.6k1282130
53.6k1282130
add a comment |Â
add a comment |Â
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%2f398258%2fhow-to-start-a-service-upon-the-output-of-a-command%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
unix.stackexchange.com/questions/388586/â¦
â jasonwryan
Oct 15 '17 at 18:00