Skip to content

docs: #6257 add conceptual note in the explanation section#6264

Open
shaloo wants to merge 8 commits into
canonical:mainfrom
shaloo:shaloo/fix-6257
Open

docs: #6257 add conceptual note in the explanation section#6264
shaloo wants to merge 8 commits into
canonical:mainfrom
shaloo:shaloo/fix-6257

Conversation

@shaloo
Copy link
Copy Markdown

@shaloo shaloo commented May 28, 2026

Based on user feedback regarding missing information (#6257) I have pulled changes verbatim from the Forum's post

  • New page in explanations section titled Services and Daemons
  • In the discourse post conceptual content, fixed layout of long list and fixed intersphinx cross referencing to snap documentation instead of forum post backlinks.

  • I've followed the contribution guidelines.
  • I've signed the CLA.
  • I've successfully run make lint && make test.
  • I've added or updated any relevant documentation.
  • In documents I changed, I added a meta description if one was missing.
  • I've updated the relevant release notes.

@shaloo shaloo requested review from a team, bepri and mr-cal as code owners May 28, 2026 10:26
@shaloo shaloo changed the title Fix #6257 first draft docs: #6257 add conceptual note about snaps running as daemon or service in the explanation section May 28, 2026
@shaloo shaloo changed the title docs: #6257 add conceptual note about snaps running as daemon or service in the explanation section docs: #6257 add conceptual note in the explanation section May 28, 2026
Comment thread docs/explanation/services-daemons.rst Outdated
@shaloo shaloo force-pushed the shaloo/fix-6257 branch from aafcbe9 to e3dac1e Compare May 28, 2026 14:54
@shaloo
Copy link
Copy Markdown
Author

shaloo commented May 29, 2026

The connection errors during lint are due to network issues - not due to content. Not sure why CVE errors are showing up here and how/whether we need to wait and merge those fixes from elsewhere before this PR can be reviewed/processed.

@shaloo shaloo force-pushed the shaloo/fix-6257 branch from 0a12c20 to a04a0d1 Compare May 29, 2026 14:19
Copy link
Copy Markdown
Member

@bepri bepri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far, thanks! There's a lot of comments, but they're largely touching up on some style choices that were common "back then" but have been revised since.

.. _explanation-services-daemons:

Services and daemons
======================
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
======================
====================

Services and daemons
======================

When :ref:`creating snapcraft.yaml <explanation-snapcraft-yaml>` to build a new snap, a snap’s executable component can be either exposed as a command or run as a background service or daemon.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We generally prefer to use the term "project file" over "snapcraft.yaml" where possible (this applies to many other places in this document too)

Services and daemons
======================

When :ref:`creating snapcraft.yaml <explanation-snapcraft-yaml>` to build a new snap, a snap’s executable component can be either exposed as a command or run as a background service or daemon.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When :ref:`creating snapcraft.yaml <explanation-snapcraft-yaml>` to build a new snap, a snaps executable component can be either exposed as a command or run as a background service or daemon.
When :ref:`creating snapcraft.yaml <explanation-snapcraft-yaml>` to build a new snap, a snap's executable component can be either exposed as a command or run as a background service or daemon.

There's a number of these ⭐ Fancy Apostrophes ⭐ in this, could you replace them?

Comment on lines +25 to +30
::

apps:
part-os-release:
command: bin/os-release.sh
daemon: simple
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
::
apps:
part-os-release:
command: bin/os-release.sh
daemon: simple
.. code-block:: yaml
apps:
part-os-release:
command: bin/os-release.sh
daemon: simple

The value for ``daemon:`` can be one of the following:

- ``simple``: Run for as long as the service is active - this is typically the default option.
- ``oneshot``: Run once and exit after completion, notifying systemd. After completion, the daemon is still considered active and *running*.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- ``oneshot``: Run once and exit after completion, notifying systemd. After completion, the daemon is still considered active and *running*.
- ``oneshot``: Run once and exit after completion, notifying systemd. After completion, the daemon is still considered active and running.

If the ``dbus`` type is used, either the ``bus-name`` keyword or ``activates-on`` keyword must be used to define a bus name for the daemon. If both keywords are defined, the bus name takes precedence. If only the ``activates-on`` keyword is defined, the last name in its list of slots is used as the bus name.

Activation
~~~~~~~~~~~
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
~~~~~~~~~~~
~~~~~~~~~~

Activation
~~~~~~~~~~~

The ``activates-on`` keyword is used to define a list of names that will be exposed via D-Bus. These names are automatically added to the slots for the snap.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The ``activates-on`` keyword is used to define a list of names that will be exposed via D-Bus. These names are automatically added to the slots for the snap.
The ``activates-on`` key is used to define a list of names that will be exposed via D-Bus. These names are automatically added to the slots for the snap.

This provides a way for a daemon to be started on a D-Bus method call. When a method on any of the names is invoked, the daemon’s ``command`` is run to start the daemon.

General use
~~~~~~~~~~~~
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
~~~~~~~~~~~~
~~~~~~~~~~~

General use
~~~~~~~~~~~~

A daemon that needs to provide services to applications can be configured to use a bus name by setting its ``bus-name`` keyword. This enables the system bus to be used for communication, as with regular system daemons.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A daemon that needs to provide services to applications can be configured to use a bus name by setting its ``bus-name`` keyword. This enables the system bus to be used for communication, as with regular system daemons.
A daemon that needs to provide services to applications can be configured to use a bus name by setting its ``bus-name`` key. This enables the system bus to be used for communication, as with regular system daemons.


A daemon that needs to provide services to applications can be configured to use a bus name by setting its ``bus-name`` keyword. This enables the system bus to be used for communication, as with regular system daemons.

The ``daemon`` keyword does not need to specify the ``dbus`` type for this use case, unless it is convenient to notify *systemd* about start-up by claiming a D-Bus name.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The ``daemon`` keyword does not need to specify the ``dbus`` type for this use case, unless it is convenient to notify *systemd* about start-up by claiming a D-Bus name.
The ``daemon`` key does not need to specify the ``dbus`` type for this use case, unless it is convenient to notify systemd about start-up by claiming a D-Bus name.

Copy link
Copy Markdown
Member

@bepri bepri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far, thanks! There's a lot of comments, but they're largely touching up on some style choices that were common "back then" but have been revised since.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants