[SOLVED] automatic restart of crashed apps on Fedora
Linux - SoftwareThis 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.
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.
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?
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.
#!/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
)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.