LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   Fedora 7 - Autostarting apps (https://www.linuxquestions.org/questions/fedora-35/fedora-7-autostarting-apps-564466/)

Keithj 06-25-2007 07:19 PM

Fedora 7 - Autostarting apps
 
I want to have some apps start automatically when Fedora 7 boots (using KDE).

At the moment, I start them manually when needed, but the machine is supposed to run unattended, and if the power goes off, they don't restart till I get back.

Googling tells me to add them to ~/.kde/Autostart - that doesn't work.
Another says add to /etc/rc.d/rc.local - that doesn't work: they start before the logon, and the GUI doesn't pick them up.
.xinitrc doesn't do it.

There has to be a place...

Anyone tell me where it is?

b0uncer 06-26-2007 02:41 AM

rc.local is executed after the other init scripts but before X is really running (if I'm right), so like you said, it's too early. If you want them to run when KDE has started, then it's KDE config file you need to edit. Are they such apps that you need to be logged in before they can launch? In that case I would start off by opening the KDE Control Center and looking if there's a similar tool like the "Sessions" in Gnome which lets you add programs to a list that is executed when the Gnome session starts. This obviously needs that your login to KDE is automated, if you're not there giving password when the machine reboots itself. It's unsafe, so..I would consider another way :)

Maybe kde.org is the right place to start.

Keithj 06-26-2007 02:36 PM

Yes, exactly. rc.local is not the right answer.

There is no other user of this machine - it sits in the corner of my study and quietly does its thing. In fact, it's under the bench and out of sight, unless I pull out the keyboard, mouse, and monitor. Fedora logs in to the only account it has, automatically. It wouldn't matter whether the apps started before or after the login - but they do have to start after kdestart.

What I would really like is not to have to type the root password umpteen times whenever I'm working on it, but I understand that's part of the Linux creed and I'd be excommunicated for suggesting it.

KDE has a Session Manager and a Resource Manager, but neither allows adding of stuff to run at GUI boot time. I've not yet found a file where stuff can be added to run at that point.

In Windows, I'd just add them to the "Start" menu, and that would be it. If Fedora or KDE has such a thing, it's well hidden.

Maybe I have to start again, and use Gnome as the desktop :) (or is that :( ?)

Keithj 06-26-2007 04:12 PM

I found the answer!
It's ~/.bashrc

Hours of Googling, and careful reading of the KDE manual, revealed nothing. The realisation that some things were starting led me to search for them. One was in .bashrc.

I added the apps to that, and strange things happened at boot-up.
I added a & at the end of each app, and they now all run fine.

The file folders no longer appear on the desktop, but I can live with that.

Keithj 06-27-2007 02:15 PM

SEQUEL TO THE ABOVE (if anyone's reading this or using it to solve the same problems).

Putting the commands in ~/.bashrc works - they start at login.
However, if you try to open a terminal window, they all run again, with "interesting" results.
No doubt some clever "if .. then .. else" coding could deal with that, but I cheated.

I created a new file called z_startup_apps.sh in /etc/profile.d and then removed everything from ~/.bashrc. Otherwise, .bashrc tries to load them again anyway via the /etc/bashrc setup.

Keithj 06-28-2007 04:58 PM

AND ANOTHER SEQUEL (this stuff isn't in any book or website I've found yet!)

z_startup_apps.sh in /etc/profile.d works fine, until you try to open a terminal window. Then Fedora tries to run that stuff all again. Some apps don't mind, some get right shirty.

The better place for z_startup_apps.sh is in ~/.kde/Autostart
I don't know if that's what that folder is for (Google searches imply otherwise) but it works well in there, running with the individual's boot-up preferences and not arguing with Terminal.


All times are GMT -5. The time now is 11:36 PM.