Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-30-2014, 03:36 AM
|
#1
|
Member
Registered: Mar 2012
Distribution: Manjaro XFCE 0.8.10, Fedora 19 XFCE, Fedora 20 Cinnamon
Posts: 41
Rep: 
|
automatic restart of crashed apps on Fedora
Is there an option to add in my .desktop file to make vino-server automatically restart after crashing??
Using Fedora 19 x64 XFCE
Code:
[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=vino
Comment=
Exec=/usr/libexec/vino-server
OnlyShowIn=XFCE;
StartupNotify=false
Terminal=false
Hidden=true
thnx in advance
|
|
|
07-30-2014, 07:52 AM
|
#2
|
Senior Member
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,992
|
no but you can create a cron script that would check ps -ef for the file/service and if not found execute the service.
|
|
|
07-30-2014, 07:54 AM
|
#3
|
Member
Registered: Mar 2012
Distribution: Manjaro XFCE 0.8.10, Fedora 19 XFCE, Fedora 20 Cinnamon
Posts: 41
Original Poster
Rep: 
|
any guidance?
|
|
|
07-31-2014, 06:53 AM
|
#5
|
Member
Registered: Mar 2012
Distribution: Manjaro XFCE 0.8.10, Fedora 19 XFCE, Fedora 20 Cinnamon
Posts: 41
Original Poster
Rep: 
|
i wasnt asking anyone to do the work for me, just a little guidance for cron jobs cause i never used them. is it possible to run vino as a systemd service and add the Restart=on-failure parameter to do the job?
|
|
|
07-31-2014, 11:01 AM
|
#6
|
Senior Member
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,992
|
possibly sadly i dont know a lot about the new systemd or how it functions yet. thus my simple recommendations of cron + bash script.
|
|
|
07-31-2014, 11:32 AM
|
#7
|
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,908
|
The most trivial would be to use a script to start it:
Change the "Exec=" line from "/usr/libexec/vino-server" to something like "/home/<username>/<your path>/mystart_vino-server
And create an executable scrip "/home/<username>/<your path>/mystart_vino-server
With the contents of:
Code:
#!/bin/bash
while 1; do
/usr/libexec/vino-server
done
Thus, whenever vino-server terminates, it is restarted.
Of course, stopping it might be a bit of an issue...
|
|
|
07-31-2014, 11:39 AM
|
#8
|
Senior Member
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683
|
Do we know why it crashes?
Long term it may be better to work out why it crashes and fix..
But both the cron and the while loop are solutions
|
|
|
08-01-2014, 01:34 AM
|
#9
|
Member
Registered: Mar 2012
Distribution: Manjaro XFCE 0.8.10, Fedora 19 XFCE, Fedora 20 Cinnamon
Posts: 41
Original Poster
Rep: 
|
fedora and vino-server never got along..you have authentication issues, crash issues etc. used to have the exact same setup in my server but instead of fedora x64 i had fedora x86 (because of my cpu). vino never crashed but took me forever to set it start on boot, again for no obvious reasons. in x64 i even tried running vino-server manually from ssh and connect from ultravnc and it just stop working after a couple of minutes without giving anything in the terminal,and couldnt connect anymore, only after rebooting the server. its a massive headache. i didnt find any log either for explaining why it crashes, it just does. anyways, i'll try the bash script and report back.
i'll be moving to centos soon so hopefully vino will work flawlessly there.
|
|
|
08-01-2014, 05:24 AM
|
#10
|
Senior Member
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683
|
This script gives you a 5 second 'window'
Code:
#!/bin/bash
while true; do
/usr/libexec/vino-server
for i in {1..5};do
sleep 1
printf "."
done
printf "\n"
done
This script starts a gnu screen session ( as required ), and then starts the 'VinoScript'
Code:
#!/bin/bash
grep -q Vino <<<$(screen -ls) || (
screen -s /bin/bash -dmS Vino -t Vino
)
screen -S Vino -p 0 -X stuff $'/path/to/VinoScript.sh\n'
Alternatively
Code:
#!/bin/bash
while true; do
/usr/libexec/vino-server
(( $? == 0 )) && break
done
This assumes a 'normal' shutdown gives exit 0, and a 'crash' gives exit of none-zero
should it exit normally we break out of the loop, else we carry on looping
You could either 'set up' a screen session, or use coproc so you don't need a term/console 'open'
Code:
#!/bin/bash
coproc Vino (
while true; do
/usr/libexec/vino-server
(( $? == 0 )) && break
done
)
|
|
|
08-07-2014, 03:02 AM
|
#11
|
Member
Registered: Mar 2012
Distribution: Manjaro XFCE 0.8.10, Fedora 19 XFCE, Fedora 20 Cinnamon
Posts: 41
Original Poster
Rep: 
|
Quote:
Originally Posted by jpollard
The most trivial would be to use a script to start it:
Change the "Exec=" line from "/usr/libexec/vino-server" to something like "/home/<username>/<your path>/mystart_vino-server
And create an executable scrip "/home/<username>/<your path>/mystart_vino-server
With the contents of:
Code:
#!/bin/bash
while 1; do
/usr/libexec/vino-server
done
Thus, whenever vino-server terminates, it is restarted.
Of course, stopping it might be a bit of an issue...
|
script worked as i wanted, thank you!
|
|
|
All times are GMT -5. The time now is 12:13 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|