How to enable a systemd service at build time

61 views
Skip to first unread message

Mark Barton

unread,
Aug 15, 2013, 8:01:37 AM8/15/13
to beagl...@googlegroups.com
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





Mark Barton

unread,
Aug 15, 2013, 2:56:51 PM8/15/13
to beagl...@googlegroups.com
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'


David Lambert

unread,
Aug 15, 2013, 3:12:26 PM8/15/13
to beagl...@googlegroups.com
I think you may also use systemctl:

systemctl enable xxxx.service
>
>

Mark Barton

unread,
Aug 15, 2013, 3:46:04 PM8/15/13
to beagl...@googlegroups.com
Yes Dave you are right. However in my case I want
to do this at build time where I do not have
systemctl.
Reply all
Reply to author
Forward
0 new messages