systemctl Service that runs an executable that never returnsMake systemd reload only single openvpn process...

How to get locks that are keyed alike?

Does the C++ standard guarantee that a failed insertion into an associative container will not modify the rvalue-reference argument?

Weird resistor with dots around it

The more + the + comparative degree

Did Michelle Obama have a staff of 23; and Melania have a staff of 4?

Solving a maximum minimum problem

Because my friend asked me to

How to measure if Scrum Master is making a difference and when to give up

Is it really Security Misconfiguration to show a version number?

What is the proper name for a circle with a line through it?

Did Pope Urban II issue the papal bull "terra nullius" in 1095?

What is the prop for Thor's hammer (Mjölnir) made of?

How would armour (and combat) change if the fighter didn't need to actually wear it?

What would it take to get a message to another star?

How much can I judge a company based on a phone screening?

List, map function based on a condition

Units of measurement, especially length, when body parts vary in size among races

Doesn't the speed of light limit imply the same electron can be annihilated twice?

Is the Microsoft recommendation to use C# properties applicable to game development?

Why does Japan use the same type of AC power outlet as the US?

What would cause a nuclear power plant to break down after 2000 years, but not sooner?

Sum Square Difference, which way is more Pythonic?

Why aren’t there water shutoff valves for each room?

Sums of binomial coefficients weighted by incomplete gamma



systemctl Service that runs an executable that never returns


Make systemd reload only single openvpn process and not the whole groupSystemD: configure unit file so that login screen is not shown until service exits and rebootsAdding a systemd .service (Debian)Why is systemd stopping service immediately after it is started?Systemd irregular timing issueInstruct to execute an unit after completing another unit successfullysystemd: finish the execution of custom shell script before starting nginxHow can I define a systemd target to start on boot or after another targetStopping systemd unit together with another. Starting worksSystemd Unit File - WantedBy and After






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I'm having some trouble figuring out how the services work on CentOS. Right now I have the following service file:



[Unit]
Description=SomeDescription
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/script

[Install]
WantedBy=multi-user.target


This will launch a script that calls an executable that will never return:



#!/bin/bash
export LD_LIBRARY_PATH=SOMEPATH && cd SOMEOTHERPATH && ./EXECUTABLE


The executable never returns. When I launch the service, it runs for a while but then exits due to timeout:



Job for selftester.service failed because a timeout was exceeded. See "systemctl status selftester.service" and "journalctl -xe" for details.


I noticed that if I change explicitly the script to run the executable in the background it works:



#!/bin/bash
export LD_LIBRARY_PATH=SOMEPATH && cd SOMEOTHERPATH && ./EXECUTABLE &


Is that the correct implementation?
Thanks in advance










share|improve this question







New contributor



Ricardo Alves is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






















  • The environment variable and the working directory can both be set in the service directly, so why are they set separately in a script?

    – muru
    yesterday











  • @muru I didn't know I could do that. I followed your suggestions and I could get it to work. Thanks!

    – Ricardo Alves
    yesterday


















0















I'm having some trouble figuring out how the services work on CentOS. Right now I have the following service file:



[Unit]
Description=SomeDescription
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/script

[Install]
WantedBy=multi-user.target


This will launch a script that calls an executable that will never return:



#!/bin/bash
export LD_LIBRARY_PATH=SOMEPATH && cd SOMEOTHERPATH && ./EXECUTABLE


The executable never returns. When I launch the service, it runs for a while but then exits due to timeout:



Job for selftester.service failed because a timeout was exceeded. See "systemctl status selftester.service" and "journalctl -xe" for details.


I noticed that if I change explicitly the script to run the executable in the background it works:



#!/bin/bash
export LD_LIBRARY_PATH=SOMEPATH && cd SOMEOTHERPATH && ./EXECUTABLE &


Is that the correct implementation?
Thanks in advance










share|improve this question







New contributor



Ricardo Alves is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






















  • The environment variable and the working directory can both be set in the service directly, so why are they set separately in a script?

    – muru
    yesterday











  • @muru I didn't know I could do that. I followed your suggestions and I could get it to work. Thanks!

    – Ricardo Alves
    yesterday














0












0








0








I'm having some trouble figuring out how the services work on CentOS. Right now I have the following service file:



[Unit]
Description=SomeDescription
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/script

[Install]
WantedBy=multi-user.target


This will launch a script that calls an executable that will never return:



#!/bin/bash
export LD_LIBRARY_PATH=SOMEPATH && cd SOMEOTHERPATH && ./EXECUTABLE


The executable never returns. When I launch the service, it runs for a while but then exits due to timeout:



Job for selftester.service failed because a timeout was exceeded. See "systemctl status selftester.service" and "journalctl -xe" for details.


I noticed that if I change explicitly the script to run the executable in the background it works:



#!/bin/bash
export LD_LIBRARY_PATH=SOMEPATH && cd SOMEOTHERPATH && ./EXECUTABLE &


Is that the correct implementation?
Thanks in advance










share|improve this question







New contributor



Ricardo Alves is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I'm having some trouble figuring out how the services work on CentOS. Right now I have the following service file:



[Unit]
Description=SomeDescription
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/script

[Install]
WantedBy=multi-user.target


This will launch a script that calls an executable that will never return:



#!/bin/bash
export LD_LIBRARY_PATH=SOMEPATH && cd SOMEOTHERPATH && ./EXECUTABLE


The executable never returns. When I launch the service, it runs for a while but then exits due to timeout:



Job for selftester.service failed because a timeout was exceeded. See "systemctl status selftester.service" and "journalctl -xe" for details.


I noticed that if I change explicitly the script to run the executable in the background it works:



#!/bin/bash
export LD_LIBRARY_PATH=SOMEPATH && cd SOMEOTHERPATH && ./EXECUTABLE &


Is that the correct implementation?
Thanks in advance







centos systemd






share|improve this question







New contributor



Ricardo Alves is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










share|improve this question







New contributor



Ricardo Alves is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








share|improve this question




share|improve this question






New contributor



Ricardo Alves is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








asked yesterday









Ricardo AlvesRicardo Alves

1011 bronze badge




1011 bronze badge




New contributor



Ricardo Alves is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




New contributor




Ricardo Alves is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.


















  • The environment variable and the working directory can both be set in the service directly, so why are they set separately in a script?

    – muru
    yesterday











  • @muru I didn't know I could do that. I followed your suggestions and I could get it to work. Thanks!

    – Ricardo Alves
    yesterday



















  • The environment variable and the working directory can both be set in the service directly, so why are they set separately in a script?

    – muru
    yesterday











  • @muru I didn't know I could do that. I followed your suggestions and I could get it to work. Thanks!

    – Ricardo Alves
    yesterday

















The environment variable and the working directory can both be set in the service directly, so why are they set separately in a script?

– muru
yesterday





The environment variable and the working directory can both be set in the service directly, so why are they set separately in a script?

– muru
yesterday













@muru I didn't know I could do that. I followed your suggestions and I could get it to work. Thanks!

– Ricardo Alves
yesterday





@muru I didn't know I could do that. I followed your suggestions and I could get it to work. Thanks!

– Ricardo Alves
yesterday










0






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',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






Ricardo Alves is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f535522%2fsystemctl-service-that-runs-an-executable-that-never-returns%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes








Ricardo Alves is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Ricardo Alves is a new contributor. Be nice, and check out our Code of Conduct.













Ricardo Alves is a new contributor. Be nice, and check out our Code of Conduct.












Ricardo Alves is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f535522%2fsystemctl-service-that-runs-an-executable-that-never-returns%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...