[yocto] Best practice dynamic service file

ChenQi Qi.Chen at windriver.com
Mon Mar 4 17:15:14 PST 2019

On 03/05/2019 05:46 AM, Jonas Andersson wrote:
> Hi,
> I have an systemd recipe to start an application as a service, i have 
> included an service file.
> Now I am looking for an solution to be able to set settings in the 
> service file from Yocto variables, i have found recipes that use 
> python to build files during build.
> What is best practice for this?
> /Jonas

Use placeholders like VAR_TO_SUBSTITUDE, and then use 'sed' command to 
replace it in do_install.
sed -i -e 's/VAR_TO_SUBSTITUDE/${VAR_IN_RECIPE}/g' path/to/my.service

Best Regards,
Chen Qi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20190305/b7f0bfb9/attachment.html>

More information about the yocto mailing list