On Thu, 16 Nov 2023 at 04:12, Russell L. Harris <russ...@rlharris.org> wrote:
> On Wed, Nov 15, 2023 at 07:41:03PM -0700, Charles Curley wrote:
> >On Thu, 16 Nov 2023 01:39:32 +0000 "Russell L. Harris" 
> ><russ...@rlharris.org> wrote:

> >> I installed approx in a Debian 12 system, but when I attempt to
> >> restart it the error message appears "Unit approx.service not loaded."

> >Please show us a complete copy and paste of the transaction, from the
> >initial prompt and the command you entered, through to the following
> >prompt, inclusive.
> >
> >Then, similarly for "systemctl status approx".
> >
> >You may need to run "systemctl daemon-reload".

> root@mollydew:/home/rlh# systemctl daemon-reload
> root@mollydew:/home/rlh# systemctl restart approx
> Failed to restart approx.service: Unit approx.service not found.
> root@mollydew:/home/rlh# systemctl status approx
> Unit approx.service could not be found.
> root@mollydew:/home/rlh#

Hi, the reason that the above commands fail is that there is no
systemd unit named neither 'approx' nor 'approx.service'.
systemd assumes '.service' for unit names that dont have any
type specified, see 'man 1 systemd'.

The name of the systemd unit is 'approx.socket'. So you need to use
that complete name all commands. If you put that complete name in
the above commands, then they will have a chance to succeed.

Examples:

[root@kablamm ~]# systemctl list-sockets | grep -E 'LISTEN|approx' -
LISTEN                            UNIT                            ACTIVATES
[::]:9999                         approx.socket                   -

[root@kablamm ~]# systemctl status approx.socket
● approx.socket - caching proxy server for Debian archive files
     Loaded: loaded (/lib/systemd/system/approx.socket; enabled;
vendor preset: enabled)
     Active: active (listening) since Thu 2023-11-16 22:20:21 AEDT; 11min ago
       Docs: man:approx(8)
     Listen: [::]:9999 (Stream)
   Accepted: 0; Connected: 0;
      Tasks: 0 (limit: 19049)
     Memory: 4.0K
        CPU: 780us
     CGroup: /system.slice/approx.socket
Nov 16 22:20:21 kablamm systemd[1]: Listening on caching proxy server
for Debian archive files.

[root@kablamm ~]# cat /lib/systemd/system/approx.socket
[Unit]
Description=caching proxy server for Debian archive files
Documentation=man:approx(8)
[Socket]
ListenStream=9999
Accept=yes
[Install]
WantedBy=sockets.target

Reply via email to