KDE System Administration/Startup: Difference between revisions

From KDE TechBase
m (s/alerts and showed/alerts are showed/)
No edit summary
(6 intermediate revisions by 6 users not shown)
Line 1: Line 1:
== Startkde Script ==
== Startkde Script ==


Line 4: Line 5:
script gets called from the display manager (KDM) once the user has been authenticated.
script gets called from the display manager (KDM) once the user has been authenticated.
There are two very important lines in the startkde script:
There are two very important lines in the startkde script:
<code>
<syntaxhighlight lang="bash">
   LD_BIND_NOW=true kdeinit +kcminit +knotify
   LD_BIND_NOW=true kdeinit +kcminit +knotify
</code>
</syntaxhighlight>
and
and
<code>
<syntaxhighlight lang="bash">
   kwrapper ksmserver $KDEWM
   kwrapper ksmserver $KDEWM
</code>
</syntaxhighlight>
The first line starts the kdeinit master process. This process is used to start all other
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.
KDE processes. The arguments behind kdeinit are the names of additional services to be started.
Line 19: Line 20:


== Background Services ==
== Background Services ==
All KDE background services are user specific, unlike system daemons they are not shared between users.
All KDE background services are user specific; unlike system daemons they are not shared between users.
Apart from being unique per user they are unique per X-server display as well.
They are also unique per X-server display.


=== kdeinit: Kicking Everything Off ===
=== kdeinit: Kicking Everything Off ===
Line 28: Line 29:
of <tt>top</tt> and <tt>ps</tt>. Use <tt>top -c</tt> or <tt>ps aux</tt> to see the actual program name.
of <tt>top</tt> and <tt>ps</tt>. Use <tt>top -c</tt> or <tt>ps aux</tt> to see the actual program name.
For example:
For example:
<code>
<pre>
> ps aux
> ps aux
waba    23184  0.2  2.1 23428 11124 ?      S    21:41  0:00 kdeinit: Running...
waba    23184  0.2  2.1 23428 11124 ?      S    21:41  0:00 kdeinit: Running...
Line 35: Line 36:
waba    23192  0.7  2.8 25596 14772 ?      S    21:41  0:00 kdeinit: kded
waba    23192  0.7  2.8 25596 14772 ?      S    21:41  0:00 kdeinit: kded
waba    23203  0.8  3.4 31516 17892 ?      S    21:41  0:00 kdeinit: knotify
waba    23203  0.8  3.4 31516 17892 ?      S    21:41  0:00 kdeinit: knotify
</code>
</pre>
<tt>kdeinit: Running...</tt> indicates the master kdeinit process. The other processes listed
<tt>kdeinit: Running...</tt> indicates the master kdeinit process. The other processes listed
are programs started as KLMs.
are programs started as KLMs.
Line 43: Line 44:


=== dbus-daemon: Inter-process Communication ===
=== dbus-daemon: Inter-process Communication ===
dbus-daemon is a background process (daemon) which provides inter-process communication (IPC) facilities to all KDE
dbus-daemon provides inter-process communication (IPC) facilities to all KDE
applications as well as several other system components, such as HAL, network manager, power manager and various non-KDE desktop applications. It is a cross-desktop, portable IPC project which is hosted at freedesktop.org.
applications as well as several other system components, such as HAL, network manager, power manager and various non-KDE desktop applications. It is a cross-desktop, portable IPC project which is hosted at freedesktop.org.


D-Bus facilities are accessible from the command shell via the qdcop command line tool and can be explored using the graphical dcop-viewer application. D-Bus is essential for all KDE applications and should autostart when requested.
D-Bus facilities are accessible from the command shell via the qdcop command-line tool and can be explored using the graphical dcop-viewer application. D-Bus is essential for all KDE applications and should autostart when requested.


=== klauncher: Service Activation ===
=== klauncher: Service Activation ===
klauncher is a deamon which is responsible for service activation within KDE. It operates in close connection with the kdeinit master process to start new processes. KDE applications communicate with klauncher over the D-Bus in order to start new applications or services.
klauncher is a daemon which is responsible for service activation within KDE. It operates in close connection with the kdeinit master process to start new processes. KDE applications communicate with klauncher over the D-Bus in order to start new applications or services.


=== kded: Background Services ===
=== kded: Background Services ===
Line 56: Line 57:


=== kcminit: Initialization Services ===
=== kcminit: Initialization Services ===
kcminit executes initialization services during startup. Initialization services are specified in the .desktop files of applications or services via the X-KDE-Init line. Initialization services are typically used for initializing hardware based on user specified settings.  
kcminit executes initialization services during startup. Initialization services are specified in the .desktop files of applications or services via the X-KDE-Init line. Initialization services are typically used for initializing hardware based on user-specified settings.  


<tt>kcminit --list</tt> can be used to show all initialization services and <tt>kcminit &lt;service&gt;</tt> can be used to execute a single service explicitly. This can be useful when investigating start-up problems.
<tt>kcminit --list</tt> can be used to show all initialization services and <tt>kcminit &lt;service&gt;</tt> can be used to execute a single service explicitly. This can be useful when investigating start-up problems.
Line 69: Line 70:
<tt>ksmserver</tt> is KDE's session manager. On startup the session manager starts auto-start applications and it restores applications from the previous session.
<tt>ksmserver</tt> is KDE's session manager. On startup the session manager starts auto-start applications and it restores applications from the previous session.


The applications to auto-start are indicated by .desktop files in the {{path|$KDEDIR/share/autostart}} directory. Auto-start of an application can be made conditional upon the '''X-KDE-autostart-condition''' entry in the .desktop file. The {{path|ktip.desktop}} file for example contains:
The applications to auto-start are indicated by .desktop files in the {{path|$KDEDIR/share/autostart}} directory. Auto-start of an application can be made conditional upon the '''X-KDE-autostart-condition''' entry in the .desktop file. The {{path|ktip.desktop}} file, for instance, might contain


<code>
<syntaxhighlight lang="ini">
X-KDE-autostart-condition=ktiprc:TipOfDay:RunOnStart:true
X-KDE-autostart-condition=ktiprc:TipOfDay:RunOnStart:true
</code>
</syntaxhighlight>


This means that the '''ktiprc''' configuration file is checked for a '''RunOnStart''' entry in the '''[TipOfDay]''' section. If no such entry is found, '''true''' is assumed, which means that ktip is one of the applications that is auto-started by default.
This means that the '''ktiprc''' configuration file is checked for a '''RunOnStart''' entry in the '''[TipOfDay]''' section. If no such entry is found, '''true''' is assumed, which means that ktip is one of the applications that is auto-started by default.
Line 81: Line 82:
There is an additional auto-start directory, {{path|$KDEHOME/Autostart}} that is sourced later. Note that this autostart path differs from the {{path|$KDEDIR/share/autostart}} directory used by the session manager. While {{path|$KDEDIR/share/autostart}} must contain .desktop files, $KDEHOME/Autostart may contain all kinds of files. The files will be opened as if they were clicked upon by the user.
There is an additional auto-start directory, {{path|$KDEHOME/Autostart}} that is sourced later. Note that this autostart path differs from the {{path|$KDEDIR/share/autostart}} directory used by the session manager. While {{path|$KDEDIR/share/autostart}} must contain .desktop files, $KDEHOME/Autostart may contain all kinds of files. The files will be opened as if they were clicked upon by the user.


The KDE session manager also restores one of the previous sessions. A session contains of a collection of applications as well as application specific information that reflects the state of the applications at the time the session was saved. Sessions are stored in the {{path|ksmserverrc}} configuration file and contains references to application specific state information. The application specific state infomation is saved in {{path|$KDEHOME/share/config/session}}.
The KDE session manager also restores one of the previous sessions. A session contains of a collection of applications as well as application-specific information that reflects the state of the applications at the time the session was saved. Sessions are stored in the {{path|ksmserverrc}} configuration file and contains references to application-specific state information. The application specific state infomation is saved in {{path|$KDEHOME/share/config/session}}.


For example if ksmserverrc contains:
For example, if ksmserverrc contains:
<code>
<syntaxhighlight lang="ini">
restartCommand1=kwin,-session,110a0a0002000106760689100000019360000_1083342151_608625
restartCommand1=kwin,-session,110a0a0002000106760689100000019360000_1083342151_608625
restartCommand2=konsole,-session,10378ac070000108334204700000277690000_1083342151_552722
restartCommand2=konsole,-session,10378ac070000108334204700000277690000_1083342151_552722
</code>
</syntaxhighlight>
Then the application specific state information for <tt>kwin</tt> and <tt>konsole</tt> can be found in
Then the application specific state information for <tt>kwin</tt> and <tt>konsole</tt> can be found in
<code>
<pre>
$KDEHOME/share/config/session/kwin_110a0a0002000106760689100000019360000_1083342151_608625
$KDEHOME/share/config/session/kwin_110a0a0002000106760689100000019360000_1083342151_608625
</code>
</pre>
and
and
<code>
<pre>
$KDEHOME/share/config/session/konsole_10378ac070000108334204700000277690000_1083342151_552722
$KDEHOME/share/config/session/konsole_10378ac070000108334204700000277690000_1083342151_552722
</code>
</pre>
respectively.
respectively.


Line 108: Line 109:
The window manager is responsible for managing all the windows across the virtual desktops,
The window manager is responsible for managing all the windows across the virtual desktops,
including initial placement, minimizing, maximizing, raising, lowering of the windows and
including initial placement, minimizing, maximizing, raising, lowering of the windows and
focus switching between windows.
focus-switching between windows.


By default, KWin is started as the window manager in a KDE session. This can be overriden by defining the  <tt>KDEWM</tt> environment variable to be name of an alternate window manager.
By default, KWin is started as the window manager in a KDE session. This can be overriden by defining the  <tt>KDEWM</tt> environment variable to be name of an alternate window manager.
Line 114: Line 115:
=== krunner: Run Dialog, Task List, Screensaver ===
=== krunner: Run Dialog, Task List, Screensaver ===


<tt>krunner</tt> is auto-started by the session manager by means of {{path|$KDEDIR/share/autostart/krunner.desktop}}. It is responsible for activating the screensaver, application start feedbackand the Run Command (Alt-F2) dialog, the task list window and is meant to run for the lifetime of the session.
<tt>krunner</tt> is auto-started by the session manager by means of {{path|$KDEDIR/share/autostart/krunner.desktop}}. It is responsible for activating the screensaver, application start feedback, the Run Command (Alt-F2) dialog, and the task list window and is meant to run for the lifetime of the session.


=== Plasma ===
=== Plasma ===

Revision as of 15:56, 13 July 2012

Startkde Script

The KDE startup sequence starts with the startkde script. In most cases this script gets called from the display manager (KDM) once the user has been authenticated. There are two very important lines in the startkde script:

   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.

The second line asks kdeinit to start the ksmserver session manager process. The session manager determines the lifetime of the session. When this process exits, the user is logged out.

Background Services

All KDE background services are user specific; unlike system daemons they are not shared between users. They are also unique per X-server display.

kdeinit: Kicking Everything Off

kdeinit is used to start all other KDE programs. kdeinit can start normal binary program files as well as kdeinit loadable modules (KLMs). KLMs work just like binary program files but can be started more efficiently. The drawback is that programs started this way appear as kdeinit in the output of top and ps. Use top -c or ps aux to see the actual program name. For example:

> ps aux
waba     23184  0.2  2.1 23428 11124 ?       S    21:41   0:00 kdeinit: Running...
waba     23187  0.1  2.1 23200 11124 ?       S    21:41   0:00 kdeinit: dcopserver --nosid
waba     23189  0.2  2.4 25136 12496 ?       S    21:41   0:00 kdeinit: klauncher
waba     23192  0.7  2.8 25596 14772 ?       S    21:41   0:00 kdeinit: kded
waba     23203  0.8  3.4 31516 17892 ?       S    21:41   0:00 kdeinit: knotify

kdeinit: Running... indicates the master kdeinit process. The other processes listed are programs started as KLMs.

When kdeinit starts for the first time it will launch klauncher and kded, as well as any additional programs specified on its command line in the startkde script. Normally that is kcminit and knotify.

dbus-daemon: Inter-process Communication

dbus-daemon provides inter-process communication (IPC) facilities to all KDE applications as well as several other system components, such as HAL, network manager, power manager and various non-KDE desktop applications. It is a cross-desktop, portable IPC project which is hosted at freedesktop.org.

D-Bus facilities are accessible from the command shell via the qdcop command-line tool and can be explored using the graphical dcop-viewer application. D-Bus is essential for all KDE applications and should autostart when requested.

klauncher: Service Activation

klauncher is a daemon which is responsible for service activation within KDE. It operates in close connection with the kdeinit master process to start new processes. KDE applications communicate with klauncher over the D-Bus in order to start new applications or services.

kded: Background Services

kded is a generic KDE daemon. It has the ability to load various service modules and run these in the background. Each kded service module is described by a .desktop file installed under $KDEDIR/share/services/kded/ The Service Manager in the Control Center can be used to monitor the status of the service modules and to disable certain services.

kcminit: Initialization Services

kcminit executes initialization services during startup. Initialization services are specified in the .desktop files of applications or services via the X-KDE-Init line. Initialization services are typically used for initializing hardware based on user-specified settings.

kcminit --list can be used to show all initialization services and kcminit <service> can be used to execute a single service explicitly. This can be useful when investigating start-up problems.

knotify: Notification Services

The primary task of knotify is to relay notifications to appropriate sub-systems. For instance, sound alerts are sent to the sound system, visual alerts are showed on-screen using passive popups or dialogs, logged messages are written out to disk, etc. The actions are user configurable and support user interaction.

ksmserver: Session Management and Autostart

Warning
This section needs improvements: Please help us to

cleanup confusing sections and fix sections which contain a todo


When the fd.o autostart spec is finalized and implemented in KDE4, update this section

ksmserver is KDE's session manager. On startup the session manager starts auto-start applications and it restores applications from the previous session.

The applications to auto-start are indicated by .desktop files in the $KDEDIR/share/autostart directory. Auto-start of an application can be made conditional upon the X-KDE-autostart-condition entry in the .desktop file. The ktip.desktop file, for instance, might contain

X-KDE-autostart-condition=ktiprc:TipOfDay:RunOnStart:true

This means that the ktiprc configuration file is checked for a RunOnStart entry in the [TipOfDay] section. If no such entry is found, true is assumed, which means that ktip is one of the applications that is auto-started by default.

Warning
This section needs improvements: Please help us to

cleanup confusing sections and fix sections which contain a todo


This may change in KDE4. Check back closer to release.

There is an additional auto-start directory, $KDEHOME/Autostart that is sourced later. Note that this autostart path differs from the $KDEDIR/share/autostart directory used by the session manager. While $KDEDIR/share/autostart must contain .desktop files, $KDEHOME/Autostart may contain all kinds of files. The files will be opened as if they were clicked upon by the user.

The KDE session manager also restores one of the previous sessions. A session contains of a collection of applications as well as application-specific information that reflects the state of the applications at the time the session was saved. Sessions are stored in the ksmserverrc configuration file and contains references to application-specific state information. The application specific state infomation is saved in $KDEHOME/share/config/session.

For example, if ksmserverrc contains:

restartCommand1=kwin,-session,110a0a0002000106760689100000019360000_1083342151_608625
restartCommand2=konsole,-session,10378ac070000108334204700000277690000_1083342151_552722

Then the application specific state information for kwin and konsole can be found in

$KDEHOME/share/config/session/kwin_110a0a0002000106760689100000019360000_1083342151_608625

and

$KDEHOME/share/config/session/konsole_10378ac070000108334204700000277690000_1083342151_552722

respectively.

The state information of kwin contains the location of the application windows of all the other applications in the session.


Desktop Components

The three major components of the desktop are the window manager, command executer and workspace (desktop and panels).

kwin: Window Manager

The window manager is always started by the session manager as part of the session restoration. The window manager is responsible for managing all the windows across the virtual desktops, including initial placement, minimizing, maximizing, raising, lowering of the windows and focus-switching between windows.

By default, KWin is started as the window manager in a KDE session. This can be overriden by defining the KDEWM environment variable to be name of an alternate window manager.

krunner: Run Dialog, Task List, Screensaver

krunner is auto-started by the session manager by means of $KDEDIR/share/autostart/krunner.desktop. It is responsible for activating the screensaver, application start feedback, the Run Command (Alt-F2) dialog, and the task list window and is meant to run for the lifetime of the session.

Plasma

Warning
This section needs improvements: Please help us to

cleanup confusing sections and fix sections which contain a todo


when plasma enters the start up sequence document it here.

KDesktop is auto-started by the session manager by means of $KDEDIR/share/autostart/plasma.desktop