DH_SYSTEMD_ENABLE(1)

πŸ’– dh_systemd_enable β€” the girlies' guide to systemd unit files πŸ’–

okay so welcome to DH_SYSTEMD_ENABLE(1), bestie. this is a debhelper program and she's here to enable and disable your systemd unit files. no cap.


✨ NAME ✨

dh_systemd_enable β€” enable/disable systemd unit files πŸŽ€


🌸 SYNOPSIS 🌸

dh_systemd_enable [debhelper options] [--no-enable] [--name=name]
[unit file ...]

πŸ¦‹ DESCRIPTION πŸ¦‹

so dh_systemd_enable is a debhelper program, and her whole job, her entire main character arc, is being responsible for enabling and disabling systemd unit files. that's it. that's the gig. πŸ’…

the simple case: she finds all the unit files that got installed by a package (think bacula-fd.service) and she enables them. and like, super important β€” it is not necessary that the machine actually runs systemd during package installation time. enabling happens on all machines, and the whole point is being able to switch from sysvinit to systemd and back again. so versatile. so iconic. πŸ”„

the complex case: you can call dh_systemd_enable and dh_systemd_start manually β€” by overwriting the debian/rules targets β€” and specify flags per unit file. the classic example is colord, which ships colord.service, a dbus-activated service with no [Install] section. that service file literally cannot be enabled or disabled (a state systemd calls "static") because it has no [Install] section. so running dh_systemd_enable on it? does not make sense, bestie. πŸ™ˆ

and if you only want to generate blocks for specific service files, you pass them as arguments, like:

dh_systemd_enable quota.service

and:

dh_systemd_enable --name=quotarpc quotarpc.service

see? easy. ate. πŸ”₯


πŸŽ€ FILES πŸŽ€

these are the files she's looking for, and where they end up (all inside the package build directory) πŸ’–

  • debian/package.service, debian/package@.service β€” if this exists, it gets installed into usr/lib/systemd/system/package.service (or usr/lib/systemd/system/package@.service).
  • debian/package.tmpfile β€” if this exists, it gets installed into usr/lib/tmpfiles.d/package.conf.
  • debian/package.target, debian/package@.target β€” if this exists, it gets installed into usr/lib/systemd/system/package.target (or usr/lib/systemd/system/package@.target).
  • debian/package.socket, debian/package@.socket β€” if this exists, it gets installed into usr/lib/systemd/system/package.socket (or usr/lib/systemd/system/package@.socket).
  • debian/package.mount β€” if this exists, it gets installed into usr/lib/systemd/system/package.mount.
  • debian/package.path, debian/package@.path β€” if this exists, it gets installed into usr/lib/systemd/system/package.path (or usr/lib/systemd/system/package@.path).
  • debian/package.timer, debian/package@.timer β€” if this exists, it gets installed into usr/lib/systemd/system/package.timer (or usr/lib/systemd/system/package@.timer).

🌈 OPTIONS 🌈

  • --no-enable β€” disable the service(s) on purge, but do not enable them on install.
heads up bestie: this option does not affect whether the services are started. that's a whole different thing, controlled by dh_systemd_start(1) (using e.g. its --no-start option). don't get it twisted. πŸ’€
  • --name=name β€” install the service file as name.service instead of the default filename, which is package.service. when this parameter is used, dh_systemd_enable looks for and installs files named debian/package.name.service instead of the usual debian/package.service.

⭐ NOTES ⭐

🚨 not me forgetting this one β€” note that this command is not idempotent. dh_prep(1) should be called between invocations of this command (with the same arguments). otherwise, it may cause multiple instances of the same text to be added to maintainer scripts. messy. we don't do messy. 😭

also: note that dh_systemd_enable should be run before dh_installinit. the default sequence in dh does the right thing, so this note is only relevant when you are calling dh_systemd_enable manually. okay? okay. 🫢


πŸ‘‘ SEE ALSO πŸ‘‘


πŸ’œ AUTHORS πŸ’œ

pkg-systemd-maintainers@lists.alioth.debian.org


and that's the whole page, bestie!! this one's from debhelper version 14.5ubuntu1, dated 2026-09-21 β€” she's serving DH_SYSTEMD_ENABLE(1) energy and honestly? she slayed. go enable some units. periodt. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from