Also "mask" services when disabling them #61

Merged
merged 1 commit into from Oct 12, 2017

Conversation

Projects
None yet
3 participants
Collaborator

mvo5 commented Oct 12, 2017

In addition to disabling services when
snap set service.{ssh,syslog}.disable=true is called we need to
mask them. The reason is that the /etc/systemd/system directory
is marked "synced" and the core snap has a "syslog.service" symlink.
So on each boot if there is no "syslog.service" (or ssh) link there
writable-path will happily copy it. This is not what we want. By
using "mask" in addition to disable systemd will create a symlink
with the name of the service to /dev/null. This prevents
writable-path from interfering.

Also "mask" services when disabling them
In addition to disabling services when
`snap set service.{ssh,syslog}.disable=true` is called we need to
mask them. The reason is that the /etc/systemd/system directory
is marked "synced" and the core snap has a "syslog.service" symlink.
So on each boot if there is no "syslog.service" (or ssh) link there
writable-path will happily copy it. This is not what we want. By
using "mask" in addition to disable systemd will create a symlink
with the name of the service to /dev/null. This prevents
writable-path from interfering.

zyga approved these changes Oct 12, 2017

OUCH

+1

ogra1 approved these changes Oct 12, 2017

tested (manually) and confirmed this works ...

@ogra1 ogra1 merged commit 4c778be into snapcore:master Oct 12, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

mvo5 added a commit to mvo5/snappy that referenced this pull request Nov 30, 2017

systemd: add support for the mask/unmask operations
We will need those for corecfg, i.e. to port the PR
snapcore/core#61 to the new
internal corecfg code.

mvo5 added a commit to mvo5/snappy that referenced this pull request Nov 30, 2017

systemd: add support for the mask/unmask operations
We will need those for corecfg, i.e. to port the PR
snapcore/core#61 to the new
internal corecfg code.

@mvo5 mvo5 referenced this pull request in snapcore/snapd Nov 30, 2017

Merged

systemd: add support for the mask/unmask operations #4331

mvo5 added a commit to mvo5/snappy that referenced this pull request Nov 30, 2017

corecfg: also "mask" services when disabling them
This is a port of snapcore/core#61:

In addition to disabling services when
snap set service.{ssh,syslog}.disable=true is called we need to
mask them. The reason is that the /etc/systemd/system directory
is marked "synced" and the core snap has a "syslog.service" symlink.
So on each boot if there is no "syslog.service" (or ssh) link there
writable-path will happily copy it. This is not what we want. By
using "mask" in addition to disable systemd will create a symlink
with the name of the service to /dev/null. This prevents
writable-path from interfering.

@mvo5 mvo5 referenced this pull request in snapcore/snapd Nov 30, 2017

Merged

corecfg: also "mask" services when disabling them #4332

mvo5 added a commit to snapcore/snapd that referenced this pull request Dec 1, 2017

systemd: add support for the mask/unmask operations
We will need those for corecfg, i.e. to port the PR
snapcore/core#61 to the new
internal corecfg code.

mvo5 added a commit to snapcore/snapd that referenced this pull request Dec 1, 2017

corecfg: also "mask" services when disabling them
This is a port of snapcore/core#61:

In addition to disabling services when
snap set service.{ssh,syslog}.disable=true is called we need to
mask them. The reason is that the /etc/systemd/system directory
is marked "synced" and the core snap has a "syslog.service" symlink.
So on each boot if there is no "syslog.service" (or ssh) link there
writable-path will happily copy it. This is not what we want. By
using "mask" in addition to disable systemd will create a symlink
with the name of the service to /dev/null. This prevents
writable-path from interfering.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment