restart program when it crashes / closes by self
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
2
down vote
favorite
Hi i am wanting to restart a program which i need to have it run 24/7 the app is minergate.
The issue I am having is that the app / program feezes and shuts down - this is a known issue with the 8.1 version.
However until 8.2 comes out I have no other option but to bite my lips and bear it. I am wondering is there away to listen for the program, and if it crashes to restart the app and continue the ETH mining?
18.04 cron restart
add a comment |Â
up vote
2
down vote
favorite
Hi i am wanting to restart a program which i need to have it run 24/7 the app is minergate.
The issue I am having is that the app / program feezes and shuts down - this is a known issue with the 8.1 version.
However until 8.2 comes out I have no other option but to bite my lips and bear it. I am wondering is there away to listen for the program, and if it crashes to restart the app and continue the ETH mining?
18.04 cron restart
Depending on how the program works, you could wrap it in a shell loop so that it gets relaunched after it exits.
â dsstorefile1
May 23 at 17:05
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
Hi i am wanting to restart a program which i need to have it run 24/7 the app is minergate.
The issue I am having is that the app / program feezes and shuts down - this is a known issue with the 8.1 version.
However until 8.2 comes out I have no other option but to bite my lips and bear it. I am wondering is there away to listen for the program, and if it crashes to restart the app and continue the ETH mining?
18.04 cron restart
Hi i am wanting to restart a program which i need to have it run 24/7 the app is minergate.
The issue I am having is that the app / program feezes and shuts down - this is a known issue with the 8.1 version.
However until 8.2 comes out I have no other option but to bite my lips and bear it. I am wondering is there away to listen for the program, and if it crashes to restart the app and continue the ETH mining?
18.04 cron restart
asked May 23 at 16:56
RussellHarrower
1163
1163
Depending on how the program works, you could wrap it in a shell loop so that it gets relaunched after it exits.
â dsstorefile1
May 23 at 17:05
add a comment |Â
Depending on how the program works, you could wrap it in a shell loop so that it gets relaunched after it exits.
â dsstorefile1
May 23 at 17:05
Depending on how the program works, you could wrap it in a shell loop so that it gets relaunched after it exits.
â dsstorefile1
May 23 at 17:05
Depending on how the program works, you could wrap it in a shell loop so that it gets relaunched after it exits.
â dsstorefile1
May 23 at 17:05
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
You can run the program as a daemon using the daemon
command, which runs the program in the background, and will automatically restart it if it dies (using the --respawn
option) :
daemon --name="yourservicename" --respawn --output=yourlog.txt yourprogram
To stop the daemon:
daemon --name="yourservicename" --stop
To install daemon:
sudo apt-get update
sudo apt-get install daemon
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
You can run the program as a daemon using the daemon
command, which runs the program in the background, and will automatically restart it if it dies (using the --respawn
option) :
daemon --name="yourservicename" --respawn --output=yourlog.txt yourprogram
To stop the daemon:
daemon --name="yourservicename" --stop
To install daemon:
sudo apt-get update
sudo apt-get install daemon
add a comment |Â
up vote
3
down vote
You can run the program as a daemon using the daemon
command, which runs the program in the background, and will automatically restart it if it dies (using the --respawn
option) :
daemon --name="yourservicename" --respawn --output=yourlog.txt yourprogram
To stop the daemon:
daemon --name="yourservicename" --stop
To install daemon:
sudo apt-get update
sudo apt-get install daemon
add a comment |Â
up vote
3
down vote
up vote
3
down vote
You can run the program as a daemon using the daemon
command, which runs the program in the background, and will automatically restart it if it dies (using the --respawn
option) :
daemon --name="yourservicename" --respawn --output=yourlog.txt yourprogram
To stop the daemon:
daemon --name="yourservicename" --stop
To install daemon:
sudo apt-get update
sudo apt-get install daemon
You can run the program as a daemon using the daemon
command, which runs the program in the background, and will automatically restart it if it dies (using the --respawn
option) :
daemon --name="yourservicename" --respawn --output=yourlog.txt yourprogram
To stop the daemon:
daemon --name="yourservicename" --stop
To install daemon:
sudo apt-get update
sudo apt-get install daemon
edited May 23 at 21:21
answered May 23 at 17:20
![](https://i.stack.imgur.com/y7JEo.jpg?s=32&g=1)
![](https://i.stack.imgur.com/y7JEo.jpg?s=32&g=1)
stumblebee
2,2983922
2,2983922
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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%2faskubuntu.com%2fquestions%2f1039492%2frestart-program-when-it-crashes-closes-by-self%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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
Depending on how the program works, you could wrap it in a shell loop so that it gets relaunched after it exits.
â dsstorefile1
May 23 at 17:05