[systemd-devel] Starting configurable set of services first

Umut Tezduyar Lindskog umut at tezduyar.com
Tue Sep 2 01:06:15 PDT 2014


Hi,

I would like to start a configurable set of services first and the
services are wanted by multi-user.target. I am using a service to jump
to multi-user.target and I was wondering if we can support this use
case natively by systemd.

multi-user.target.wants
  A.service
  B.service
  C.service
  D.service

default.target > stage.target
stage.target.wants (These are set by generator)
  A.service
  C.service
  switcher.service

switcher.service (This is generated by generator)
  [Unit]
  Description=Switch to multi-user.targe
  After=A.service C.service
  [Service]
  Type=oneshot
  RemainAfterExit=yes
  ExecStart=/usr/bin/systemctl --no-block start multi-user.target

This way I am jumping from one target to another target during runtime.

- What stage.target wants is dynamic. If it was static, my job would
have been very simple.
- I am aware of StartupCPUShares but it is not the ultimate solution
A) there is a configurable minimum quota in CFS which still gives CPU
to other processes. B) We still fork other processes and this causes
changes in timeout values of other processes.
- Adding dynamically After= to B and D service files is not the
ultimate solution either because B and D might be socket/dbus
activated by A or C.

Should this be something we should support natively by systemd?

Umut


More information about the systemd-devel mailing list