How to install and enable timer units in a package?

Felipe Sateler fsateler at debian.org
Tue Dec 13 12:58:43 GMT 2016


Hi Gioele,

On 12 December 2016 at 17:40, Gioele Barabucci <gioele at svario.it> wrote:
> Hello,
>
> I'd like to create a Debian package for an application that uses systemd
> timers instead of cron jobs. Installing the `.service` and `.timer`
> units is easy, one just copied them into `/lib/systemd/system/`.
>
> My open question now is: how does one enable/start the installed timer
> unit "in the right way"?
>
> Should I use a postinst maintscript to manually enable and start the
> timer or are there other and better facilities that I can use?

You should just use dh_systemd_enable/dh_systemd_start. If you are
using short-form dh, passing --with systemd will do the trick in
compat <=9, compat >= 10 enables the systemd sequence by default.

-- 

Saludos,
Felipe Sateler




More information about the Pkg-systemd-maintainers mailing list