yrutschle / sslh

Applicative Protocol Multiplexer (e.g. share SSH and HTTPS on the same port)

Home Page:https://www.rutschle.net/tech/sslh/README.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Socket activation on boot

nebulosa2007 opened this issue · comments

I want make start sslh.socket at boot on Archlinux.

Got this error:

$ sudo systemctl enable --now sslh.socket
Failed to enable unit: Unit /run/systemd/generator/sslh.socket is transient or generated.

Trying to fix, just open and close file for editing, it creates file in etc/systemd/system/sslh.socket

$ sudo EDITOR=micro systemctl edit --full sslh.socket
Successfully installed edited file '/etc/systemd/system/sslh.socket'.

But still got error:

$ sudo systemctl enable sslh.socket
The unit files have no installation config (WantedBy=, RequiredBy=, UpheldBy=,
Also=, or Alias= settings in the [Install] section, and DefaultInstance= for
template units). This means they are not meant to be enabled or disabled using systemctl.
 
Possible reasons for having this kind of units are:
• A unit may be statically enabled by being symlinked from another unit's
  .wants/ or .requires/ directory.
• A unit's purpose may be to act as a helper for some other unit which has
  a requirement dependency on it.
• A unit may be started when needed via activation (socket, path, timer,
  D-Bus, udev, scripted systemctl call, ...).
• In case of template units, the unit is meant to be enabled with some
  instance name specified.

After adding strings:

[Install]
WantedBy = multi-user.target

All errors are gone

$ sudo EDITOR=micro systemctl edit --full sslh.socket
Successfully installed edited file '/etc/systemd/system/sslh.socket'.
$ sudo systemctl enable sslh.socket
Created symlink /etc/systemd/system/multi-user.target.wants/sslh.socket → /etc/systemd/system/sslh.socket.

Am I doing right or is there some other way?