Systemd for Developers

Systemd not only brings improvements for administrators and users, it also brings a (small) number of new APIs with it. In this blog story (which might become the first of a series) I hope to shed some light on one of the most important new APIs in systemd:

Socket Activation – In the original blog story about systemd I tried to explain why socket activation is a wonderful technology to spawn services. Let’s reiterate the background here a bit.

The basic idea of socket activation is not new. The inetd superserver was a standard component of most Linux and Unix systems since time began: instead of spawning all local Internet services already at boot, the superserver would listen on behalf of the services and whenever a connection would come in an instance of the respective service would be spawned.

This allowed relatively weak machines with few resources to offer a big variety of services at the same time. However it quickly got a reputation for being somewhat slow: since daemons would be spawned for each incoming connection a lot of time was spent on forking and initialization of the services — once for each connection, instead of once for them all.

Spawning one instance per connection was how inetd was primarily used, even though inetd actually understood another mode: on the first incoming connection it would notice this via poll() (or select()) and spawn a single instance for all future connections. (This was controllable with the wait/nowait options.)

That way the first connection would be slow to set up, but subsequent ones would be as fast as with a standalone service. In this mode inetd would work in a true on-demand mode: a service would be made available lazily when it was required. Continue reading…

Related Posts

Restore the Windows bootloader to MBR after dual-booting with Linux If you are reading this, you have likely attempted or actually set up a dual-boot system between your favorite Linux distribution and Windows. And if ...
GRUB-Install errors while attempting to dual-boot Windows 10 and Linux distributions Since Windows 10 was released, I've made several attempts to set up dual-boot systems between it and a few Linux distributions (Fedora 22, Ubuntu 15.0...
How to install Lekture on Fedora 19 KDE When I started taking free online classes on Coursera and other online academies a few months ago, I always wondered whether those lecture-making soft...
Disk encryption in ROSA Marathon 2012 ROSA Marathon is a Linux distribution derived from Mandriva Desktop. It is developed by ROSA Labs, a Linux solutions provider based in Moscow, Russia....
How to enhance the physical security posture of your Linux/BSD-powered PC Securing a computer goes beyond more than just using strong passwords. You should consider what happens if an unauthorized person gains physical acce...
How to customize Mandriva’s updates notifier One of the most useful features of any operating system is an application or package update notifier, a simple utility which notifies you when there a...

We Recommend These Vendors

Launch an SSD VPS in Europe, USA, Asia & Australia on Vultr's KVM-based Cloud platform starting at $5:00/month (15 GB SSD, 768 MB of RAM).

Deploy an SSD Cloud server in 55 seconds on DigitalOcean. Built for developers and starting at $5:00/month (20 GB SSD, 512 MB of RAM).


Leave a Comment

Your email address will not be published. Required fields are marked *

*