Start/Stop/Restart another snap inside a snap


#1

Hello All,

I would like to know, is there any mechanism to start/stop/restart other snap services inside a snap.

Also, I have tried with snapctl by connecting the plug snapd-control, it does allow to control only the snap dependent services.

Thanks in Advance!!!


#2

Hello All,

Let me know, if any one have a solution for this.


#3

If your snap has snapd-control, you can control all snap-provided services from ‘inside’ that snap, yes, using the apps endpoint. You can also, on core, disable services that are considered ‘device configuration’, which today includes rsyslogd and sshd; these are done via the config endpoint.


#4

Hello @chipaca,

Thanks for the quick reply.

Yes, I have integrated snapd-control plug into my snap. The snap which I need to enable/disable is wifi-ap.

Kindly let me know the appropriate commands for the same.


#5

Hello @chipaca,

Are there any possible ways to do it?


#6

Let me know if these docs aren’t clear.


#7

Hello @chipaca,

Thanks for pointing this out.

It works with the POST /v2/snaps/[name] API.