Why the snap disable/enable commands don't accept service names?

I am currently working with a snap containing few services.

Using the command:

sudo snap disable mysnap

This disables the mysnap services. The disable command only accept a snap name.

To disable only one service of a snap, the command is:

sudo snap stop --disable mysnap.service1

This stop and disable mysnap.service1. The stop command accept a service name as well as a snap name.

Why the disable/enable commands don’t accept service names? Would it break something if the disable/enable commands were accepting service names?

Those are different operations. snap disable <snap> disables the snap, i.e. the snap becomes inactive, it’s not mounted, its apps and services are no longer available. snap stop --disable <snap> disables the services of a snap. See the --help output of either of the commands, there should be a description of what each command does.

1 Like