Kodi

Kodi (formerly XBMC) is a media center application.

Create user
First create the user:

OpenRC
Then define the Kodi file with the following contents:

Set the appropriate permissions:

And tell OpenRC to start it on boot:

Using inittab
First create the user (see above). This is based on the way the mythtv ebuilds enable the autostart of the mythtv frontend.

Define an file in 's home:

Then create the login scripts:

Finally append an inittab entry which does the autologin:

Gentoo Hardened
Running Kodi on a Hardened Gentoo installation is possible. To avoid grsecurity interfering with network connectivity, the CONFIG_GRKERNSEC_PROC_USER kernel option must not be enabled.

Should you require a restricted filesystem, use CONFIG_GRKERNSEC_PROC_USERGROUP and set GRKERNSEC_PROC_GID to the ID of a group that the user running Kodi is a member of.

Shutdown
Allow the user to issue an shutdown via polkit, resulting in a shutdown option in the Kodi menu:

Note: Ensure the  USE flag set for shutdown to work.

External resources

 * Unofficial Kodi Overlay