Skip to content

Commit

Permalink
Two more Friday presentations
Browse files Browse the repository at this point in the history
Two more presentations I took notes from on Friday during RedHat
Developers Conference 2012.
  • Loading branch information
miska committed Feb 17, 2012
1 parent b65f2ba commit 8e24f6d
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
24 changes: 24 additions & 0 deletions RH-DevConf-2012/What can Linux learn from the others.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
What can Linux learn from the others
====================================

Inspiration from Solaris
------------------------

.STREAM
* I/O subsystem that is modular and can be stacked one on top of another.
.Kernel stability
* In Solaris, you have just stable interfaces which are supported and not
supposed to change, but everything beneath that can change.
.ZFS
* We are getting BTRFS
.Zones
* lightweight virtualization
.RBAC
* privilege granularity
* root is set of privileges
* anybody can be root
37 changes: 37 additions & 0 deletions RH-DevConf-2012/Writing System Services.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Do's and Don'ts When Writing System Services
============================================

First thing to do is not to fork and especially not to double double fork. It
makes hard to figure out anything about the process and init systems nowadays
can do a good job supervising the process. But without forking, init doesn't
know when service is ready. Systemd comes with 'sd_notify()' function to get
notified about successful initialization.

Don't write PID files. Systemd knows your PID unless you forked!

sd_notify can send READY=1 to set that service is ready. It can also use
STATUS=... to tell what is it doing right now.

Configuration belongs to configuration file in /etc. No to init script or into
/etc/sysconfig. Providing drop-in directory for adding configuration snippets
is nice, don't try to do generator. Sane defaults should be compiled-in.

Regarding logging, use syslog or stdout/stderr.

Limit security impact - drop privileges you don't need, use capabilities.
Capabilities are beyond what normal user can do, all of them means effectively
becoming root. pscap can help in identifying capabilities.

Honour SIGTERM. Support SIGHUP but also provide a way for synchronous reload.

Use D-Bus as IPC.

Never spawn daemons out of libraries.

Use socket activation if possible. Start only when it makes sense.

Put daemon binary in /usr/lib not in the $PATH

Send systemd unit file upstream and try to keep one unit file per deamon.

Watch for network configuration changes. Computers migrate

0 comments on commit 8e24f6d

Please sign in to comment.