Running snap as daemon with several instances

Hi, I want to switch over to using snaps in my company but there is one thing I can’t figure out.
Currently we are running a python file as a daemon. The user can create several services from this same python file by setting different arguments.

I want to package the python main file as a snap and have the user run x amount of the snaps with command arguments separating the different instances. Is this possible? I guess putting arguments in the yaml file will not work as it would require a rebuild of the snap every time the user want to change arguments.

1 Like

As long as X is a constant and something you can bake into the snap then yes. If you want to create systemd units at runtime (say, let the user decide how many instances of a deamon to start then I don’t think you can do that with snaps today.

Can you please tell me how does it work outside of snaps?

Normally without snaps we have a web interface the user can create new service files with. The service files starts several instances of the same python file but with different arguments.

Being able to dynamically create the amount of snap apps in a snap package after the snap has been packaged would be a really nice feature.