[solved] seeking way to use the terminal to re-launch app

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
HelloIndustries

[solved] seeking way to use the terminal to re-launch app

Post by HelloIndustries »

Hi all.

I use LottaNZB but find it crashes a LOT. My current work-around is to launch it via the terminal and then re-launch it by simply hitting [up key] then [enter] rather than digging around the menus each time, and that can be quite frequent depending on how it's feeling at the time.

I'm hoping there's an automated way to re-launch the application if it crashes out so i don't need to babysit the damn thing.

Cheers.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Odd0002

Re: seeking way to use the terminal to re-launch a crashed a

Post by Odd0002 »

You could make a shell script that you run and that restarts the process automatically like this:

Open a terminal and do:

Code: Select all

gedit restart.sh
Then put the following in the file:

Code: Select all

#!/bin/bash
while true
do
(enter command name here)
pid=`pidof -s (command name)`
wait $pid
sleep 5
done
To make it executable, in the terminal do

Code: Select all

chmod 755 restart.sh
Then run it by doing

Code: Select all

./restart.sh
in the terminal.

Hope this works for you, since it worked for me with Firefox.
If you ever want to stop it, then just press Crtl+C in the terminal that's running the file.
HelloIndustries

Re: seeking way to use the terminal to re-launch a crashed a

Post by HelloIndustries »

Odd0002 wrote:You could make a shell script that you run and that restarts the process automatically like this
Thanks :)
Seems to be working fine so far.

MUCH appreciated!
User avatar
Midnighter
Level 6
Level 6
Posts: 1327
Joined: Tue May 22, 2007 1:52 pm
Location: Western Australia

Re: [solved] seeking way to use the terminal to re-launch ap

Post by Midnighter »

Wouldn't it make more sense to ask for help finding out why it keeps crashing so much?
If you accept - and I do - that freedom of speech is important, then you are going to have to defend the indefensible. That means you are going to be defending the right of people to read, or to write, or to say, what you don't say or like or want said.
HelloIndustries

Re: [solved] seeking way to use the terminal to re-launch ap

Post by HelloIndustries »

Midnighter wrote:Wouldn't it make more sense to ask for help finding out why it keeps crashing so much?
The reason it keeps crashing is a known bug and will hopefully be fixed soon.
Locked

Return to “Beginner Questions”