App start order in KDE4

I worte somewhere in time here about this, but I cant find it…
anyways…

I have a problem, when starting KDE, it begins to start applications, usually the ones that were open (thanks God)… however, order is a bit screwed…

It opens Skype, KTorrent, Kopete, Sound, Keyboard and finally, NetworkManager…
It irritates me like hell. I would like to put Network to be ran 1st.

Is there a way to do it?

To me it’s a minor annoyance, but I agree it’s a thing that needs improvement. Googling about kde4 startup sequence did not bring me much.

Neither here… I 1st googled a lot, but had hope that there is a setting about it…

:frowning:

Isn’t there a combobox in teh systemsettings > advanced > autostart bit that lists 3 options per auto-started app?

I can’t recall exactly (and I’m not at home) but I remember one of them was pre-kde startup (I don’t understand how that works, but nvm). Perhaps one of them could be start after everything else? Worth a look anyway.

NetworkManager is started quite early, and it can do systemwide connections (ie so you can boot into a console, no X) and have your interface up & running.

Knetworkmanager is started by KDE (somehow, somewhere in the bowels of it). But it can’t configure system connections yet though unfortunately. Gnome’s can (afaiia) so maybe you could google for how to do that? Then your network would be up before KDE anyway (as it really should be).

Or ifup would work too. You’ll have to configure your wireless properly though. Wired usually just works with it.

Although, could it be you’re talking about sessions? In which case the only solution is to get the network up before kde starts (imho) as I really don’t think you’ll be able to guarantee that Knetworkmanager will have started, got comfortable, and brought an interface up before other apps decide to start.

<grumble mode=“GrittedTeeth”>
It also annoys the hell out of me too, to the extent I turned off sessions completely - if you can’t get the net up before my apps start then don’t bother, I’ll do it myself. Especially as most apps you leave running constantly tend to be networked apps (ie email…). Have you ever seen the sh*tstorm of popups kmail can generate with a few accounts & no network? Un-be-lieveable
</grumble>

I’m not moaning really though - all these things are fixable, and as soon as knetworkmanager can do system connections it’ll be gravy :slight_smile: (hopefully)

I was talking about sessions. There is nothing in my autostart, but it does save open apps in session… so That order is what I need to change.

I don’t think you can alter the order in which they’re started. I may of course be wrong there, but I have never seen any way to do it.

However, Knetworkmanager (what connects your net) isn’t part of session startup, so perhaps trying to figure out how to delay whatever code starts session apps long enough that knetworkmanager comes up might be a good bet?

If it were me though, I’d investigate either using ifup instead of NM (its a pain if you move between wifi APs though) or have a look into how to go about creating a system connection in NM.
Either of those won’t work if you are connecting to new (& therefore unconfigured) networks each time.

Good luck!

Like you say, no real solution if you’re running around with a laptop, connecting for 15 minutes and move on to the next. I’ve done searching on this in the past, never found a working solution. IMHO that should be that knetworkmanager is the first app to start. I already know it’s not waiting for some other app or service like kwallet.

I started a thread How to make knetworkmanager start as a first app • KDE Community Forums on forums.kde.org , let’s wait and see if one of the devs picks it up.

Nice, I’ll watch that with interest.

Hi
This may shed some light?
http://techbase.kde.org/KDE_System_Administration/Startup


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.45-0.1-default
up 13 days 4:09, 5 users, load average: 0.14, 0.32, 0.40
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 195.36.15

Interesting article. I think I;ll have to re-read it to fully get it though :slight_smile:

So knetworkmanager is started via a .desktop file in <kde>/share/autostart/ by the session service? I’m going to have poke in there to see what’s in there.

Meanwhile:

LD_BIND_NOW=true kdeinit +kcminit +knotify
and

kwrapper ksmserver $KDEWM

The first line starts the kdeinit master process. 
This process is used to start all other KDE processes. 
The arguments behind kdeinit are the names of additional services to be started. 
The + indicates that kdeinit needs to wait till the service has finished.

I suppose we can’t just change that to

LD_BIND_NOW=true kdeinit +kcminit +knotify +knetworkmanager

and expect it to work? Someone would have done it by now, its too easy.

Here’s the reply from one of the admins:

As far as I am aware, KDE starts all applications at the same time, except for those intricately involved in the KDE startup procedure, such as ksmserver, ksplash and kdeinit ( which spawns kded and klauncher )

Looks like I’ve found it, thanks to weighty_joe:

It’s in the /usr/bin/startkde script. If I change this line:


LD_BIND_NOW=true /usr/lib64/kde4/libexec/start_kdeinit_wrapper +kcminit_startup

to:


LD_BIND_NOW=true /usr/lib64/kde4/libexec/start_kdeinit_wrapper +kcminit_startup +knetworkmanager

the first thing I see on the appearing desktop is kwallet asking me for the master password doing so for …knetworkmanager. The most first icon in the systray is …knetworkmanager.
Looks like we have this tackled, but I’d be very glad if some of you can confirm this.

Mind: on a 32bit system you need to edit out the “64” from the line.

I’ll reboot now and see if the behaviour is persistent.

It is persistent, though I realize it’s just a hack. You wouldn’t want this on a desktop with ifup. I found some more entries to look at, will keep you posted. Anyway, for those interested, this hack works, but will have to be reapplied after each update …

Ah that’s fantastic :slight_smile: I’m going to try that when I get home.

My setup is 11.2 64bit, with kde 4.4 from Factory. Knetworkmanager does not use kwallet for wifi passwords (unencrypted storage).

I’ll report back.

I bet that’s even faster, since it does not wait for a password. You should be online before the desktop is up. POWER OF THE COMMUNITY !!! :slight_smile:

Hurrah!

It does work! knetworkmanager is already up & halfway connected before the desktop loads. It’s first in the systray as well.

This wifi router (work) is horribly slow to connect to though, so I’ll try mine at home as well. Hopefully it will be fully connected before apps start. I wonder how well it does with wired? I’ll try that too.

Hi
Glad y’all found the article useful :slight_smile:

In Gnome, if you edit the connection (in NetworkManager) to
be ‘available for all users’ then it won’t use ‘wallet’ method and
should just connect. On Gnome the network is up before the desktop has
finished loading.


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.45-0.1-default
up 14 days 1:02, 4 users, load average: 1.08, 0.78, 0.47
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 195.36.15

Yap… power of community. Thanks!

Is that what is called a ‘system connection’ in knetworkmanager (the option is greyed out)? I.e. a connection that is wholly controlled by NetworkManager and not the gui frontends?