[systemd-devel] How to properly write an "umbrella" unit

Alexandre Detiste alexandre.detiste at gmail.com
Tue Jul 21 05:13:12 PDT 2015


Le mardi 21 juillet 2015, 13:43:48 Marc Haber a écrit :
> This works as designed. Unfortunately, my Distribution's build tools
> don't handle package-provided targets too well, and I feel that using
> a target here is kind of wrong anyway.

Hi,

Package-provided targets works well,
but by default debhelper will try to enable everything.

You'd need to overide dh_systemd_enable & dh_systemd_start:

https://sources.debian.net/src/systemd-cron/1.5.2-1/debian/rules/

| override_dh_systemd_enable:
|	# Only enable cron.target, it pulls in all the others via .timer files.
|	dh_systemd_enable cron.target
|
| override_dh_systemd_start:
|	# Only start cron.target, it pulls in all the others via .timer files.
|	dh_systemd_start cron.target


> 
> Can I write my nifty.target as a service? I have seen in this case
> nifty.service files with Exec=/bin/true to basically create a no-op
> service, but that's ugly.

PostgreSQL does that for some reason:
https://sources.debian.net/src/postgresql-common/169/systemd/postgresql.service/

> How would one handle this situation in the clear, recommended way?
Can't help for this.

Greets,

Alexandre


More information about the systemd-devel mailing list