SUPERCILEX / clipboard-history

Ringboard—the clipboard manager for Linux
Apache License 2.0
143 stars 5 forks source link

Ringboard server not starting #24

Closed leviska closed 1 month ago

leviska commented 1 month ago

After boot the servers don't start While writing this I think I found the issue:

systemctl --user enable ringboard-server.service
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 these kinds of units are:
• A unit may be statically enabled by being symlinked from another unit's
  .wants/, .requires/, or .upholds/ 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.

Adding

[Install]
WantedBy=graphical-session.target

to the ringboard-server.service seems to fix enabling, but I didn't test the boot yet after boot it still doesn't start

All other info:

systemctl --user status ringboard-x11
○ ringboard-x11.service - X11 Ringboard clipboard listener
     Loaded: loaded (/home/leviska/.config/systemd/user/ringboard-x11.service; enabled; preset: enabled)
     Active: inactive (dead)
       Docs: https://github.com/SUPERCILEX/clipboard-history

systemctl --user status ringboard-server
○ ringboard-server.service - Ringboard server
     Loaded: loaded (/home/leviska/.config/systemd/user/ringboard-server.service; static)
     Active: inactive (dead)
       Docs: https://github.com/SUPERCILEX/clipboard-history

The services:

cat ~/.config/systemd/user/ringboard-server.service
[Unit]
Description=Ringboard server
Documentation=https://github.com/SUPERCILEX/clipboard-history
After=multi-user.target

[Service]
Type=notify
Environment=RUST_LOG=trace
ExecStart=/bin/sh -c 'PATH=~/.cargo/bin:$PATH exec ringboard-server'
Restart=on-failure

cat ~/.config/systemd/user/ringboard-x11.service
[Unit]
Description=X11 Ringboard clipboard listener
Documentation=https://github.com/SUPERCILEX/clipboard-history
Requires=ringboard-server.service
After=ringboard-server.service
BindsTo=graphical-session.target
After=graphical-session.target

[Service]
Type=exec
Environment=RUST_LOG=trace
ExecStart=/bin/sh -c 'PATH=~/.cargo/bin:$PATH exec ringboard-x11'
Restart=on-failure

[Install]
WantedBy=graphical-session.target

There is no logs from this boot (and old logs looks good), meaning that the service just didn't start(?) Starting the services manually works great System: Arch Linux

leviska commented 1 month ago
systemctl list-units --type target --state active

  UNIT                   LOAD   ACTIVE SUB    DESCRIPTION
  basic.target           loaded active active Basic System
  bluetooth.target       loaded active active Bluetooth Support
  cryptsetup.target      loaded active active Local Encrypted Volumes
  getty.target           loaded active active Login Prompts
  graphical.target       loaded active active Graphical Interface
  integritysetup.target  loaded active active Local Integrity Protected Volumes
  local-fs-pre.target    loaded active active Preparation for Local File Systems
  local-fs.target        loaded active active Local File Systems
  multi-user.target      loaded active active Multi-User System
  network-online.target  loaded active active Network is Online
  network.target         loaded active active Network
  nss-lookup.target      loaded active active Host and Network Name Lookups
  nss-user-lookup.target loaded active active User and Group Name Lookups
  paths.target           loaded active active Path Units
  remote-fs.target       loaded active active Remote File Systems
  slices.target          loaded active active Slice Units
  sockets.target         loaded active active Socket Units
  sound.target           loaded active active Sound Card
  swap.target            loaded active active Swaps
  sysinit.target         loaded active active System Initialization
  time-set.target        loaded active active System Time Set
  timers.target          loaded active active Timer Units
  tpm2.target            loaded active active Trusted Platform Module
  veritysetup.target     loaded active active Local Verity Protected Volumes

Legend: LOAD   → Reflects whether the unit definition was properly loaded.
        ACTIVE → The high-level unit activation state, i.e. generalization of SUB.
        SUB    → The low-level unit activation state, values depend on unit type.

24 loaded units listed.
systemctl is-active graphical-session.target

inactive

hmmm

leviska commented 1 month ago

Ah that's was system targets Here's users

systemctl list-units --type target --all --user

  UNIT                          LOAD      ACTIVE   SUB    DESCRIPTION
  basic.target                  loaded    active   active Basic System
● blockdev@dev-nvme0n1p1.target not-found inactive dead   blockdev@dev-nvme0n1p1.target
  bluetooth.target              loaded    inactive dead   Bluetooth
  default.target                loaded    active   active Main User Target
  graphical-session.target      loaded    inactive dead   Current graphical user session
  paths.target                  loaded    active   active Paths
  shutdown.target               loaded    inactive dead   Shutdown
  sockets.target                loaded    active   active Sockets
  sound.target                  loaded    inactive dead   Sound Card
  timers.target                 loaded    active   active Timers

Legend: LOAD   → Reflects whether the unit definition was properly loaded.
        ACTIVE → The high-level unit activation state, i.e. generalization of SUB.
        SUB    → The low-level unit activation state, values depend on unit type.

10 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.
leviska commented 1 month ago

It seems that the problem is more with "why my desktop environment (cinnamon) doesn't start the graphical-session.target" and not with ringboard exactly

leviska commented 1 month ago

Changing graphical-session.target to default.target (as advised by someone on the internet) seems to work! My config now seems fixed, you can close the issue if you don't want to dive into it

SUPERCILEX commented 1 month ago

Well that's weird. I'm not sure there's anything I can do to improve this as the graphical session target is supposed to be started with your DE.

Thanks for figuring out the bug!