Lucas Nussbaum: systemd: Type=simple and avoiding forking considered harmful?
(This came up in a discussion on debian-user-french@l.d.o)
When converting from sysvinit scripts to systemd init files, the default practice seems to be to start services without forking, and to use Type=simple in the service description.
What Type=simple does is, well, simple. from systemd.service(5):
If set to simple (the default value if neither Type= nor BusName= are specified), it is expected that the process configured with ExecStart= is the main process of the service. In this mode, if the process offers functionality to other processes on the system, its communication channels should be installed before the daemon is started up (e.g. sockets set up by systemd, via socket activation), as systemd will immediately proceed starting follow-up units. In other words, systemd just runs the command described in ExecStart=, and it s done: it considers the service is started. Unfortunately, this causes a regression compared to the sysvinit behaviour, as described in #778913: if there s a configuration error, the process will start and exit almost immediately. But from systemd s point-of-view, the service will have been started successfully, and the error only shows in the logs:
root@debian:~# systemctl start ssh root@debian:~# echo $? 0 root@debian:~# systemctl status ssh ssh.service - OpenBSD Secure Shell server Loaded: loaded (/lib/systemd/system/ssh.service; enabled) Active: failed (Result: start-limit) since mer. 2015-05-13 09:32:16 CEST; 7s ago Process: 2522 ExecStart=/usr/sbin/sshd -D $SSHD_OPTS (code=exited, status=255) Main PID: 2522 (code=exited, status=255)
mai 13 09:32:16 debian systemd[1]: ssh.service: main process exited, code=exited, status=255/n/a mai 13 09:32:16 debian systemd[1]: Unit ssh.service entered failed state. mai 13 09:32:16 debian systemd[1]: ssh.service start request repeated too quickly, refusing to start. mai 13 09:32:16 debian systemd[1]: Failed to start OpenBSD Secure Shell server. mai 13 09:32:16 debian systemd[1]: Unit ssh.service entered failed state.With sysvinit, this error is detected before the fork(), so it shows during startup:
root@debian:~# service ssh start [....] Starting OpenBSD Secure Shell server: sshd/etc/ssh/sshd_config: line 4: Bad configuration option: blah /etc/ssh/sshd_config: terminating, 1 bad configuration options failed! root@debian:~#It s not trivial to fix that. The implicit behaviour of sysvinit is that fork() sort-of signals the end of service initialization. The systemd way to do that would be to use Type=notify, and have the service signals that it s ready using systemd-notify(1) or sd_notify(3) (or to use socket activation, but that s another story). However that requires changes to the service. Returning to the sysvinit behaviour by using Type=forking would help, but is not really a solution: but what if some of the initialization happens *after* the fork? This is actually the case for sshd, where the socket is bound after the fork (see
strace -f -e trace=process,network /usr/sbin/sshd), so if another process is listening on port 22 and preventing sshd to successfully start, it would not be detected.
I wonder if systemd shouldn t do more to detect problems during services initialization, as the transition to proper notification using sd_notify will likely take some time. A possibility would be to wait 100 or 200ms after the start to ensure that the service doesn t exit almost immediately. But that s not really a solution for several obvious reasons. A more hackish, but still less dirty solution could be to poll the state of processes inside the cgroup, and assume that the service is started only when all processes are sleeping. Still, that wouldn t be entirely satisfying
I've recently been contacted by
When
I love having guests give my classes :)
This time, we had Felipe Esquivel, a good friend who had been once before invited by me to the Faculty, about two years ago. And it was due time to invite him again!
Yes, this is the same Felipe I

This evening I've been mostly playing with removing duplicate content. I've had this idea for the past few days about object-storage, and obviously in that context if you can handle duplicate content cleanly that's a big win.
The naive implementation of object-storage involves splitting uploaded files into chunks, storing them separately, and writing database-entries such that you can reassemble the appropriate chunks when the object is retrieved.
If you store chunks on-disk, by the hash of their contents, then things are nice and simple.
The end result is that you might upload the file /etc/passwd, split that into four-byte chunks, and then hash each chunk using SHA256.
This leaves you with some database-entries, and a bunch of files on-disk:
Some time ago I have embarked on a jurney to install NetBSD on one of my two NSLU2-s. I have ran into all sorts of hurdles and problems which I finally managed to overcome, except one:
A hotfix release for the
Erich,
As a follow-up on your blog post, where you complain about the state of Hadoop. First, I couldn t agree more with all you wrote. All of it! But why not trying to get Hadoop in Debian, rather than only complaining about the state of things?
I have recently packaged and uploaded Sahara, which is OpenStack big data as a service (in other words: running Hadoop as a service on an OpenStack cloud). Its working well, though it was a bit frustrating to discover exactly what you complained about: the operating system cloud image needed to run within Sahara can only be downloaded as a pre-built image, which is impossible to check. It would have been so much work to package Hadoop that I just gave up (and frankly, packaging all of OpenStack in Debian is enough work for a single person doing the job so no, I don t have time to do it myself).
OpenStack Sahara already provides the reproducible deployment system which you seem to wish. We only need Hadoop itself.
Edit to add: These patches on their own won't enable this functionality, they just give us a better set of options. Once they're merged we can look at changing the defaults so people get the benefit of this out of the box.
About a decade ago, I played in the (now defunct) "Jozef Pauly
ensemble", a flute choir connected to the musical academy where I was
taught to play the flute. At the time, this ensemble had the habit of
goin on summer trips every year; sometimes these trips were large
international concert tours (like our 2001 trip to Australia), but that
wasn't always the case; there have also been smaller trips, like the
2002 one to the French Ardennes.
While there, we went on a day trip to the city of Reims. As a city close
to the front in the first world war, it has a museum dedicated to that
subject that I remembered going to. But the fondest memory of that day
was going to a park where a podium was set up, with a few stacks of
fold-up chairs standing nearby. I took one and listened to the music.
That was the day when I realized that I kindof like jazz. I had come
into contact with Jazz before, but it had always been something to be
used as a kind of musical wallpaper; something you put on, but don't
consciously listen to. Watching this woman sing, however, was a
different kind of experience altogether. I'm still very fond of her
rendition of "Besame Mucho".
After having listened to the concert for about two hours, they called it
quits, but did tell us that there was a record which you could buy. Of
course, after having enjoyed the afternoon so much, I couldn't imagine
not buying it, so that happened.
Fast forward several years, in the move from my apartment above my
then-office to my current apartment (just around the corner), the record
got put into the wrong box, and when I unpacked things again it got
lost; permanently, I thought. Since I also hadn't digitized it yet at
the time, I haven't listened to it anymore in quite a while.
But that time came to an end today. The record which I thought I'd lost
wasn't, it was just in a weird place, and while cleaning yesterday, I
found it sitting among a bunch of old stuff that I was going to throw
out. Putting on the record today made me realize again how good it
really is, and I thought that I might want to see if she was still
active, and if she might perhaps have made another album.
It was great to find out that not only had she made six more albums
since the one I bought, she'd also become a lot more known in the Jazz
world (which I must admit I don't really follow all that well), and won
a number of awards.
At the time, Youn Sun Nah was just a (fairly) recent graduate from a
particular Jazz school in Paris. Today, she appears to be so much
more...
The actual use of this extension is still in development and the log files are not currently publicly visible, but it may still be useful for people to know the what and why
The Debian ARMMP kernel can be used for multiple devices, just changing the DTB. I ve already done tests with this for Cubietruck and Beaglebone-Black, iMX.53 was one of the original test devices too. Whilst these tests can deploy a full image (there are examples of building such images in the