mardi 15 avril 2014

Need help with Linux/Fedora/Gnome application startup.

I've been searching and troubleshooting this issue for a few days and since I'm kinda new to linux systems, I think I'm missing something obvious. It shouldn't be that difficult.



The problem: We have a dedicated desktop computer (Fedora 19 OS) that runs a specific graphical application, that's the only thing it will ever do. I'm trying to get it to run on start-up/login to increase the user friendliness. After extensive trial and error of copy-pasting code and not understanding what I'm doing, I have failed miserably.



I have tried adding the relevant command to rc.local (which didn't exist, I had to create it in rc.d). Well, that didn't work, so I tried to debug it by adding "touch /tmp/foo.txt" and 'lo, it did create a foo.txt on login, but didn't run the main command. So rc.local is working, I'm thinking there's something wrong with my specific command. It's "echo <password> | sudo -S /root/src/XBackground", where <password> obviously is my root login password. I run it in the terminal and it works, regardless of whether I'm logged in as root or regular user. So it has to be something else. So I happen to read somewhere rc.local runs the commands before it starts X-server, which I suppose is a prerequisite for any graphical applications. Just for good measure, I add sleep 2m in my rc.local before the actual command to see if that does anything - nope.



Right, so where do I need to add my command for it to run when the X-server starts up? I've combed through stackoverflow and fedora forums, but my directory hierarchy always seem to be different and I'm missing the relevant folder/files. And since I'm new to linux OS, I'm struggling to make an educated guess. I did try to tamper with some Xserver files, adding my code there, but that only produced anything when I manually ran that tampered file in terminal.



Second thing I tried was gnome-session-properties. I added the XBackground application to start-up list, but that did nothing. I'm wondering if I'm missing a step somewhere. Like with windows, you add info of the program to registry, maybe there's something similar on linux I missed?





Additional details: I did install the graphical application as root user, and it resides under root user catalog, so there's that. I've read it takes a bit of tweaking to let gnome log you in as a root, but since security is not an issue, there's close to zero chance anyone unauthorized will use it and it will stay offline, I'm thinking, if necessary, I'll just chmod the whole application catalog to 777? Would that be stupid, dangerous, unnecessary? But then again, user permission doesn't seem to be the actual problem.



As I mentioned, I tried the "echo <password> | sudo -S <your command>" which worked in a terminal, but didn't do anything sitting in rc.local, but that might be because of what I previously explained (the X-server thing).





If all else fails, I'd be happy to even have as much as a desktop icon linking to my application, but I'm not even sure how to do that on Fedora. My goal is to decrease the steps necessary for opening the application, should there be a crash/power-out or whatnot and the computer needs to be restarted.



Any ideas?





via JREF Forum http://ift.tt/1eDK8xN

Aucun commentaire:

Enregistrer un commentaire