How to enable a systemd service at build time

Hi All,

I want to be able to run a script at boot time using systemd service, but it has to be enabled at build time rather than having someone manually enable the script using systemctl. All of our programs are out of tree builds using Angstrom tools. We use a stock Angstrom console image, move our program and run scripts to the appropriate locations in the root file system and then install to an SD card. I have done some Googling, but so far haven't found too much in the way of useful information.

So what are my options for enabling a systemd script at build time? Can I modify a systemd config or control files, or a chroot environment perhaps?

Ubuntu 12.04 for the build machine
Beaglebone Black
Latest Angstrom distribution

Any help is much appreciated.
Mark

Well it turns out to be an embarrassingly simple link. In case it helps anyone else...

  ln -s '/lib/systemd/system/xxxx.service' '/etc/systemd/system/multi-user.target.wants/xxxx.service'

Hi All,

I want to be able to run a script at boot time using systemd service, but it has to be enabled at build time rather than having someone manually enable the script using systemctl. All of our programs are out of tree builds using Angstrom tools. We use a stock Angstrom console image, move our program and run scripts to the appropriate locations in the root file system and then install to an SD card. I have done some Googling, but so far haven't found too much in the way of useful information.

So what are my options for enabling a systemd script at build time? Can I modify a systemd config or control files, or a chroot environment perhaps?

Ubuntu 12.04 for the build machine
Beaglebone Black
Latest Angstrom distribution

Any help is much appreciated.
Mark

Well it turns out to be an embarrassingly simple link. In case it helps anyone else...

ln -s '/lib/systemd/system/xxxx.service' '/etc/systemd/system/multi-user.target.wants/xxxx.service'

I think you may also use systemctl:

systemctl enable xxxx.service

Yes Dave you are right. However in my case I want to do this at build time where I do not have systemctl.