jaystrictor / gnome-shell-extension-syncthing

GNU General Public License v3.0
87 stars 14 forks source link

off on button always of when syncthing is running #57

Closed x0rld closed 4 years ago

x0rld commented 4 years ago

Describe the bug the button off on is always on off and when I turn it on there is a danger flag

Screenshots image

Version information:

Logs Add the output of

systemctl --user -n0 status syncthing.service
● syncthing.service - Syncthing - Open Source Continuous File Synchronization
     Loaded: loaded (/usr/lib/systemd/user/syncthing.service; disabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Wed 2020-05-13 14:03:30 CEST; 2min 33s ago
       Docs: man:syncthing(1)
    Process: 20752 ExecStart=/usr/bin/syncthing -no-browser -no-restart -logflags=0 (code=exited, status=1/FAILURE)
   Main PID: 20752 (code=exited, status=1/FAILURE)
        CPU: 45ms

journalctl -b /usr/bin/gnome-shell | grep syncthingicon mai 13 13:54:29 ldlcpc gnome-shell[3469]: [syncthingicon] found syncthing config file in /home/x0rld/.config/syncthing mai 13 13:59:17 ldlcpc gnome-shell[3469]: [syncthingicon] found syncthing config file in /home/x0rld/.config/syncthing


it's write fail but when i do this command it work
```systemctl status syncthing@x0rld
● syncthing@x0rld.service - Syncthing - Open Source Continuous File Synchronization for x0rld
     Loaded: loaded (/usr/lib/systemd/system/syncthing@.service; enabled; vendor preset: disabled)
     Active: active (running) since Wed 2020-05-13 13:37:46 CEST; 30min ago
       Docs: man:syncthing(1)
   Main PID: 1220 (syncthing)
      Tasks: 22 (limit: 18791)
     Memory: 127.2M
        CPU: 11.344s
     CGroup: /system.slice/system-syncthing.slice/syncthing@x0rld.service
             ├─1220 /usr/bin/syncthing -no-browser -no-restart -logflags=0
             └─1373 /usr/bin/syncthing -no-browser -no-restart -logflags=0```
jaystrictor commented 4 years ago

It seems that you have accidentally switched on the systemd system service instead of the systemd user service. Try switching off the systemd system service by running

systemctl disable syncthing
systemctl stop syncthing

After that the on/off switch should work.

x0rld commented 4 years ago

oh yes thanks but it will automaticly start when i start my computer ?

jaystrictor commented 4 years ago

If you enable the user service and enable linger, yes.

systemctl --user enable syncthing
loginctl enable-linger
awdav commented 4 years ago

Thanks. I was also using Syncthing as a system service instead of a user service on Fedora 32. Using your solution solved the problem for me too.

tmortagne commented 4 years ago

I reproduce the same issue but the service seems to be associated with the user

$ systemctl --user status syncthing
● syncthing.service - Syncthing - Open Source Continuous File Synchronization
     Loaded: loaded (/usr/lib/systemd/user/syncthing.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Wed 2020-08-12 11:29:56 CEST; 1s ago
       Docs: man:syncthing(1)
    Process: 8437 ExecStart=/usr/bin/syncthing -no-browser -no-restart -logflags=0 (code=exited, status=1/FAILURE)
   Main PID: 8437 (code=exited, status=1/FAILURE)
$ systemctl status syncthing
Unit syncthing.service could not be found.

System: Ubuntu 20.04 64b

tmortagne commented 4 years ago

It just started to work for me after upgrading to Syncthing 1.8.0 (the Debian package), was failing on 1.7.1.

jaystrictor commented 4 years ago

@tmortagne If you are using a user service, then it should be a distinct issue and I would prefer a second GitHub issue being opened. However, I am glad it works for you now.