Is it possible to replace the supervisor service with my own in balena os image?

Hello,

I really have fun with balena OS these days.
I have some questions about supervisor service

  1. Where does the supervisor service come from? Is it included in the OS image, such as raspberrypi4-64-2.107.10+rev3-v14.4.4.img? Or Is it downloaded when the device is provisioned for the first time?
  1. Can I replace(change) the official supervisor service with the supervisor to I make some modifications? If the supervisor service is delivering in raspberrypi4-64-2.107.10+rev3-v14.4.4.img file, can I make a modified balena os image that has my modified supervisor service? Or, if the supervisor service is downloaded when the device is provisioned, can I provide the service docker image for it?

I want to read some information that is in the /mnt/boot/config.json in my services. I asked about this question, but I haven’t got the any solution for it yet. My idea is to let the supervisor service copy /mnt/boot/config.json to some volume so-called common-data and to make services read that file by mounting common-data volume. I also ask you guys if my idea makes sense or not.

Thank you
Chester

Hey @chester

There is a version of the supervisor included when you download the OS but this of course can be updated from the dashboard after that.

Swapping out the supervisor for your own isn’t something we support at the moment - I’ll go and find the other question you asked and take a look now :slight_smile:

Hello Everyone,
I want to add little bit contribution in this query and I hope it will srt out your problem.
Yes, it is possible to replace the supervisor service with your own service in BalenaOS. The supervisor service is responsible for managing application updates, device health, and other system-level functions in BalenaOS, so it’s an important component of the system. However, if you have specific needs or requirements that are not met by the default supervisor service, you can replace it with your own custom service.

To replace the supervisor service, you will need to do the following:

  1. Build your own supervisor service: You will need to create your own service that performs the same functions as the default supervisor service, but with any modifications or additional features that you require. You can use the Balena supervisor repository as a starting point for your own implementation.
  2. Disable the default supervisor service: To replace the default supervisor service with your own, you will need to disable the default service on your device. You can do this by setting the SUPERVISOR_IGNORE_LOCK environment variable to 1 in your device configuration.
  3. Start your custom supervisor service: Once you have disabled the default supervisor service, you can start your own custom supervisor service on your device. You can do this by running the balena-supervisor command with the --replace option.

It’s worth noting that replacing the default supervisor service with your own custom service is an advanced operation that requires a good understanding of BalenaOS and its architecture. It’s important to thoroughly test your custom supervisor service before deploying it to production devices, to ensure that it works correctly and does not cause any unexpected issues.

1 Like