• Re: Native systemd services.

    From Greg Wooledge@21:1/5 to peter@easthope.ca on Sun Mar 9 05:50:01 2025
    On Sat, Mar 08, 2025 at 20:04:16 -0700, peter@easthope.ca wrote:
    # ls -1 /lib/systemd/system/stunnel*
    /lib/systemd/system/stunnel@.service
    /lib/systemd/system/stunnel.target

    What is stunnel@.service, rather than stunnel.service?

    systemd.service(5):

    SERVICE TEMPLATES
    It is possible for systemd services to take a single argument via the
    "service@argument.service" syntax. Such services are called
    "instantiated" services, while the unit definition without the argument
    parameter is called a "template". An example could be a dhcpcd@.service
    service template which takes a network interface as a parameter to form
    an instantiated service. Within the service file, this parameter or
    "instance name" can be accessed with %-specifiers. See systemd.unit(5)
    for details.

    systemd.unit(5):

    As mentioned above, a unit may be instantiated from a template file.
    This allows creation of multiple units from a single configuration
    file. If systemd looks for a unit configuration file, it will first
    search for the literal unit name in the file system. If that yields no
    success and the unit name contains an "@" character, systemd will look
    for a unit template that shares the same name but with the instance
    string (i.e. the part between the "@" character and the suffix)
    removed. Example: if a service getty@tty3.service is requested and no
    file by that name is found, systemd will look for getty@.service and
    instantiate a service from that configuration file if it is found.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From peter@easthope.ca@21:1/5 to All on Sun Mar 9 05:30:01 2025
    From: Greg Wooledge <greg@wooledge.org>
    Date: Thu, 13 Feb 2025 13:35:31 -0500
    [shorewall]'s a native systemd service (/lib/systemd/...) but the service is showing as disabled.

    # ls -1 /lib/systemd/system/shorewall* /lib/systemd/system/shorewall-init.service /lib/systemd/system/shorewall.service

    systemctl enable shorewall
    systemctl start shorewall

    Works. No problem.

    # ls -1 /lib/systemd/system/stunnel*
    /lib/systemd/system/stunnel@.service
    /lib/systemd/system/stunnel.target

    What is stunnel@.service, rather than stunnel.service?

    Thx, ... P.

    --
    VoIP: +1 604 670 0140
    work: https://en.wikibooks.org/wiki/User:PeterEasthope

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From peter@easthope.ca@21:1/5 to All on Sun Mar 9 17:40:01 2025
    From: Greg Wooledge <greg@wooledge.org>
    Date: Sat, 8 Mar 2025 23:28:24 -0500
    '... the unit definition without the argument parameter is
    called a "template".'

    Thanks.

    So /lib/systemd/system/stunnel@.service is a service template file
    rather than service file.

    Here, one execution of command "stunnel" yields a working tunnel. For
    systemd to open the tunnel, one "instantiated service" should suffice.

    A tunnel has no intrinsic name analogous to tty3 in the
    systemd.unit(5) example. Invent a name for an instance?

    Create a unit file for the service instance?

    man 5 systemd.service helps but is at the abstract end of the
    documentation spectrum. Does more concrete documentation exist?

    OBSERVATION

    googling "site:wiki.debian.org stunnel" yields
    https://wiki.debian.org/Pan . There we read,

    To enable Stunnel edit /etc/default/stunnel4

    ENABLED=1

    /etc/default/stunnel4 exists but lacks ENABLED. My best guess is that
    systemd obsoleted it. Stunnel needs https://wiki.debian.org/Stunnel
    with current documentation.

    Thx, ... P.

    --
    VoIP: +1 604 670 0140
    work: https://en.wikibooks.org/wiki/User:PeterEasthope

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)