DH_INSTALLSYSTEMDUSER(1)

✨ DH_INSTALLSYSTEMDUSER(1) ✨

okay bestie, gather round πŸ’– this is the dh_installsystemduser page from the Debhelper manual, and it's literally the girl who handles your systemd user unit files. no cap. let's get into it 🫢


🌸 NAME 🌸

dh_installsystemduser β€” she installs systemd unit files. that's the whole job description, she's booked and busy πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

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

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, bestie β˜• dh_installsystemduser goes looking for the systemd user instance service files that a package installed, and then she generates preinst, postinst, and prerm code blocks for enabling, disabling, starting, stopping, and restarting the matching systemd user instance services β€” for when the package gets installed, updated, or removed. those little snippets get added into the maintainer scripts by dh_installdeb(1). iconic delegation, honestly πŸ‘‘

and the way deb-systemd-helper(1) is the one doing the actual enabling and disabling of the systemd units? that means the machine doesn't even have to be running systemd at package installation time β€” the enabling happens on all machines regardless. so nobody gets left out, it's giving inclusivity πŸ’–

dh_installsystemduser operates on all user instance unit files installed by a package. but if you only want blocks generated for specific unit files, just pass them as arguments. and if you wanna exclude specific unit files from processing, you use the -X common debhelper(1) option. options on options, she contains multitudes πŸ’…


🌈 FILES 🌈

  • debian/package.user.path
  • debian/package@.user.path
  • debian/package.user.service
  • debian/package@.user.service
  • debian/package.user.socket
  • debian/package@.user.socket
  • debian/package.user.target
  • debian/package@.user.target
  • debian/package.user.timer
  • debian/package@.user.timer

if any of those files exist, they get installed into usr/lib/systemd/user/ in the package build directory β€” and the .user part of the filename gets stripped off on the way in. cute little glow-up, honestly ✨


πŸ’… OPTIONS πŸ’…

  • --name=name β€” install the service file as name.service instead of the default filename package.service. when you use this, dh_installsystemd goes looking for and installs files named debian/package.name.user.service instead of the usual debian/package.user.service. and on top of that, maintainer scripts are only generated for units that match the given name. specific. focused. main character energy πŸ‘‘
  • --no-enable β€” disable the service(s) on purge, but do not enable them on install. that's it, that's the option πŸŽ€

πŸ’€ NOTES πŸ’€

bestie. listen. 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. yeah. copy-paste city. a mess. don't do it fr fr πŸ™ˆ


⭐ SEE ALSO ⭐


πŸ’œ AUTHORS πŸ’œ

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


okay that's the whole page bestie, you ate that 🫢 this was version 14.5ubuntu1, dated 2026-09-21, straight outta the Debhelper manual β€” go forth and install your user units, periodt πŸ’–βœ¨

πŸ“¦ where this page comes from