I have a custom Debian package I've built for our software that creates a systemd service. What is the preferred/idiomatic way to have the installation of said package enable/start the service at install time?
What I did was add the following three lines to my
systemctl --system daemon-reload systemctl enable my_service.service systemctl start my_service.service
This worked fine until we tried to include loading this package in our initial image creation running under
debootstrap at which point it turned out that
systemctl appears to want a lot of environment stuff set up that just isn't normally up in that process.