cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove unused services

Jzhua
Associate III

how do i remove service at the build time,such like avahi-daemon,systemd-timesyncd

I don't need them,I hope the system can start as soon as possible by removing unnecessary startup items

4 REPLIES 4
PatrickF
ST Employee

Hello,

this could help you: https://wiki.st.com/stm32mpu/wiki/How_to_optimize_the_boot_time

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

I have read that page.

I mean how to disable a service at build time so that it does not load automatically at system startup.

For example, how to edit the .bb file so that systemd-timesyncd is not loaded at system startup, but is started by my app when needed.

Jzhua
Associate III

The default configuration loads many services, some of which can be disabled or started when needed, such as Bluetooth, wifi

Bernard PUEL
ST Employee

Hello,

Difficult to answer your question as there are many ways to do it and it is really depending on your background + target.

1/ you could use another build system as Yocto: buildroot is very convenient is you want to build a small and manageable system (in term of component count)

2/ you can build your own distribution with yocto: see: poky/meta-poky/conf/distro/poky-tiny.conf  for example

3/ you can choose from ST distribution minimal core image: in envsetup.sh, no distro then build core-image-minimal

4/ you can remove features from ST distribution: From your image.bb, remove the features you don't need (also in the sub packages) so that you keep only what you need. If the feature is removed, Yocto will also remove the services associated to this feature from systemd launch.