Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: syncthing: runs at startup

  1. #1

    Default syncthing: runs at startup

    Hi there,
    I am new to openSUSE, using syncthing. The problem is application starts at boot, but it seems the application is set-up to run without systemd. Do you have any information on how can I debug the program so I can disable syncthing startup at boot.

    Code:
    huya@huya:~> ps -ax |grep syncthing
     1702 ?        SNsl   0:01 /usr/bin/syncthing -no-browser -no-restart -logflags=0
     1918 ?        SNsl   0:07 /usr/bin/syncthing -no-browser -no-restart -logflags=0
     2804 pts/0    S+     0:00 grep --color=auto syncthing

    Code:
    huya@huya:~> systemctl status syncthing@service
    ● syncthing@service.service - Syncthing - Open Source Continuous File Synchronization for service
       Loaded: loaded (/usr/lib/systemd/system/syncthing@.service; disabled; vendor preset: disabled)
       Active: inactive (dead)
         Docs: man:syncthing(1)

  2. #2
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    20,219
    Blog Entries
    14

    Default Re: syncthing: runs at startup

    Have a look in /etc/init.d for startup scripts, or search /etc for a config file that triggers the autostart.
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    https://en.opensuse.org/openSUSE:Board#Members
    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  3. #3
    Join Date
    Oct 2008
    Location
    Glasgow, Scotland
    Posts
    1,188

    Default Re: syncthing: runs at startup

    Quote Originally Posted by zimci View Post
    Hi there,
    I am new to openSUSE, using syncthing. The problem is application starts at boot, but it seems the application is set-up to run without systemd.
    Hello, and welcome to the mad-house.

    I do not use this new-fangled stuff like syncthing myself (rsync is about my limit), but I did notice that the syncthing package contains
    /usr/lib/systemd/system/syncthing-resume.service
    /usr/lib/systemd/system/syncthing@.service
    /usr/lib/systemd/user/syncthing.service
    which suggests to me that you might want to try disabling syncthing-resume.service.

    Have you considered using either qsyncthingtray or syncthing-gtk to control-configure your file-syncs?
    --
    slàinte mhath,
    rayH

    ~ knowing the right answer is easier than knowing the right question.

  4. #4

    Default Re: syncthing: runs at startup

    The fact that you have 2 instances of syncthing running is a little strange . If you run the command
    Code:
    ps -aux |grep syncthing
    you will be able to see which user each instance is running as.
    It is recommended that syncthing not be run as root, but as a normal user(s). It can then be controlled with the @ service file. That is
    Code:
    sudo systemctl enable/start/status syncthing@<user>.service
    You have actually checked the status of syncthing running as user 'service' and, predictably, drawn a blank.
    So I suggest you check which user(s) are running syncthing per step 1 above, then check the status of the systemd service for each of those users per step 2 above.
    Hope that helps.

  5. #5

    Default Re: syncthing: runs at startup

    Hello, thank you for your replies.

    Quote Originally Posted by grb01 View Post
    The fact that you have 2 instances of syncthing running is a little strange . If you run the command
    Code:
    ps -aux |grep syncthing
    you will be able to see which user each instance is running as.
    It is recommended that syncthing not be run as root, but as a normal user(s). It can then be controlled with the @ service file. That is
    Code:
    sudo systemctl enable/start/status syncthing@<user>.service
    You have actually checked the status of syncthing running as user 'service' and, predictably, drawn a blank.
    So I suggest you check which user(s) are running syncthing per step 1 above, then check the status of the systemd service for each of those users per step 2 above.
    Hope that helps.
    Code:
    gdm       1701  0.5  0.8 631484 35080 ?        SNsl 15:51   0:04 /usr/bin/syncthing -no-browser -no-restart -logflags=0
    huya      1943 12.5  1.6 659380 64252 ?        SNsl 15:51   1:33 /usr/bin/syncthing -no-browser -no-restart -logflags=0
    It seems it is running both as user and as gdm.

    Quote Originally Posted by Knurpht View Post
    Have a look in /etc/init.d for startup scripts, or search /etc for a config file that triggers the autostart.
    In /etc I find no relevant script linked to syncthing, however when i look at /etc/init.d/rc5.d (openSUSE documentation says it covers GDM) i also find no files:
    Code:
    huya@huya:/etc/init.d> ls -Ra
    .:
    .  ..  boot.d  rc0.d  rc1.d  rc2.d  rc3.d  rc4.d  rc5.d  rc6.d  rcS.d
    
    ./boot.d:
    .  ..
    
    ./rc0.d:
    .  ..
    
    ./rc1.d:
    .  ..
    
    ./rc2.d:
    .  ..
    
    ./rc3.d:
    .  ..
    
    ./rc4.d:
    .  ..
    
    ./rc5.d:
    .  ..
    
    ./rc6.d:
    .  ..
    
    ./rcS.d:
    .  ..
    are these init directories in reality files? This systemd has got me confused since 2012.

    Quote Originally Posted by eng-int View Post
    Hello, and welcome to the mad-house.

    I do not use this new-fangled stuff like syncthing myself (rsync is about my limit), but I did notice that the syncthing package contains
    /usr/lib/systemd/system/syncthing-resume.service
    /usr/lib/systemd/system/syncthing@.service
    /usr/lib/systemd/user/syncthing.service
    which suggests to me that you might want to try disabling syncthing-resume.service.

    Have you considered using either qsyncthingtray or syncthing-gtk to control-configure your file-syncs?
    I use rsync too on local networks, however syncthing can sync between various machines almost simultaneously without scripting and can solve the discovery of different machines on different networks easily.

    I installed syncthing together with syncthikg-gtk and once mistakenly ran another instance by commandline. However syncthing does not allow for two instances by the same user. As of late syncthing-gtk is uninstalled because of these problems.

    Should I blacklist the syncthing-resume? It is disabled and nothing changes.

    There seems to be a strange bootup breakage in systemd bootup when i kill all the syncthing PIDs and disable all syncthing systemd instances, but after pressing Ctrl-D it then starts things as usual with 2 instances of syncthing once again.

    Best,
    zimci

  6. #6

    Default Re: syncthing: runs at startup

    Hello, thank you for your replies.

    Code:
    gdm       1701  0.5  0.8 631484 35080 ?        SNsl 15:51   0:04 /usr/bin/syncthing -no-browser -no-restart -logflags=0
    huya      1943 12.5  1.6 659380 64252 ?        SNsl 15:51   1:33 /usr/bin/syncthing -no-browser -no-restart -logflags=0
    It seems it is running both as user and as gdm.
    Now check the status of the instance running as user 'huya'.
    Code:
    sudo systemctl status syncthing@huya.service
    I presume you are using the Gnome desktop and the user 'gdm' is associated with that. I use KDE and have no useful experience with Gnome. But you could try running the above command again using
    Code:
    sudo systemctl status syncthing@gdm.service
    Another approach would be to run the command below. It should show any syncthing services that are enabled.
    Code:
    sudo systemctl -p Wants | grep syncthing

  7. #7
    Join Date
    Oct 2008
    Location
    Glasgow, Scotland
    Posts
    1,188

    Default Re: syncthing: runs at startup

    Quote Originally Posted by grb01 View Post
    I presume you are using the Gnome desktop and the user 'gdm' is associated with that. I use KDE and have no useful experience with Gnome.
    KDE users have a “~/.config/autostart/”. Does Gnome have an equivalent?
    The other place that programs or scripts can be started early is in root's crontab files with a “@reboot” time entry.
    --
    slàinte mhath,
    rayH

    ~ knowing the right answer is easier than knowing the right question.

  8. #8

    Default Re: syncthing: runs at startup

    Quote Originally Posted by grb01 View Post
    Now check the status of the instance running as user 'huya'.
    Code:
    sudo systemctl status syncthing@huya.service
    I presume you are using the Gnome desktop and the user 'gdm' is associated with that. I use KDE and have no useful experience with Gnome. But you could try running the above command again using
    Code:
    sudo systemctl status syncthing@gdm.service
    Another approach would be to run the command below. It should show any syncthing services that are enabled.
    Code:
    sudo systemctl -p Wants | grep syncthing
    Code:
    huya@huya:~> sudo systemctl status syncthing@huya.service
    ● syncthing@huya.service - Syncthing - Open Source Continuous File Synchronizati
       Loaded: loaded (/usr/lib/systemd/system/syncthing@.service; disabled; vendor 
       Active: inactive (dead)
         Docs: man:syncthing(1)
    huya@huya:~> sudo systemctl status syncthing@gdm.service
    ● syncthing@gdm.service - Syncthing - Open Source Continuous File Synchronizatio
       Loaded: loaded (/usr/lib/systemd/system/syncthing@.service; disabled; vendor 
       Active: inactive (dead)
         Docs: man:syncthing(1)
    huya@huya:~> sudo systemctl -p Wants |grep syncthing
      system-syncthing.slice                                                                   loaded    inactive dead      system-syncthing.slice
    All the same. It seems systemd does not run it at all. It must have been started by another instance before systemd can even step in.

    Quote Originally Posted by eng-int View Post
    KDE users have a “~/.config/autostart/”. Does Gnome have an equivalent?
    The other place that programs or scripts can be started early is in root's crontab files with a “@reboot” time entry.
    GDM programs run at /etc/gdm/Init/Default:

    Code:
    #!/bin/sh
    
    if test -x /etc/X11/xdm/Xsetup; then
        exec /etc/X11/xdm/Xsetup
    fi
    
    # Stolen from the debian kdm setup, aren't I sneaky
    # Plus a lot of fun stuff added
    #  -George
    
    PATH="/usr/bin:$PATH"
    OLD_IFS=$IFS
    
    gdmwhich () {
      COMMAND="$1"
      OUTPUT=
      IFS=:
      for dir in $PATH
      do
        if test -x "$dir/$COMMAND" ; then
          if test "x$OUTPUT" = "x" ; then
            OUTPUT="$dir/$COMMAND"
          fi
        fi
      done
      IFS=$OLD_IFS
      echo "$OUTPUT"
    }
    
    sysresources=/etc/X11/Xresources
    
    # merge in defaults
    if [ -f "$sysresources" ]; then
        xrdb -merge "$sysresources"
    fi
    
    sysmodmap=/etc/X11/Xmodmap
    
    XMODMAP=`gdmwhich xmodmap`
    if [ "x$XMODMAP" != "x" ] ; then
      if [ "x$GDM_PARENT_DISPLAY" = "x" ]; then
        if [ -f $sysmodmap ]; then
          $XMODMAP $sysmodmap
        fi
      else
        ( DISPLAY=$GDM_PARENT_DISPLAY XAUTHORITY=$GDM_PARENT_XAUTHORITY $XMODMAP -pke ) | $XMODMAP -
      fi
    
      #
      # Switch Sun's Alt and Meta mod mappings
      #
    
      UNAME=`gdmwhich uname`
      PROCESSOR=`$UNAME -p`
      if [ "x$PROCESSOR" = "xsparc" ]; then
        if $XMODMAP | grep mod4 | grep Alt > /dev/null 2>/dev/null
        then
          $XMODMAP -e "clear Mod1" \
                   -e "clear Mod4" \
                   -e "add Mod1 = Alt_L" \
                   -e "add Mod1 = Alt_R" \
                   -e "add Mod4 = Meta_L" \
                   -e "add Mod4 = Meta_R"
        fi
      fi
    fi
    
    SETXKBMAP=`gdmwhich setxkbmap`
    if [ "x$SETXKBMAP" != "x" ] ; then
      # FIXME: is this all right?  Is this completely on crack?
      # What this does is move the xkb configuration from the GDM_PARENT_DISPLAY
      # FIXME: This should be done in code.  Or there must be an easier way ...
      if [ -n "$GDM_PARENT_DISPLAY" ]; then
        XKBSETUP=`( DISPLAY=$GDM_PARENT_DISPLAY XAUTHORITY=$GDM_PARENT_XAUTHORITY $SETXKBMAP -v )`
        if [ -n "$XKBSETUP" ]; then
          XKBKEYMAP=`echo "$XKBSETUP" | grep '^keymap' | awk '{ print $2 }'`
          XKBTYPES=`echo "$XKBSETUP" | grep '^types' | awk '{ print $2 }'`
          XKBCOMPAT=`echo "$XKBSETUP" | grep '^compat' | awk '{ print $2 }'`
          XKBSYMBOLS=`echo "$XKBSETUP" | grep '^symbols' | awk '{ print $2 }'`
          XKBGEOMETRY=`echo "$XKBSETUP" | grep '^geometry' | awk '{ print $2 }'`
          if [ -n "$XKBKEYMAP" ]; then
            $SETXKBMAP -keymap "$XKBKEYMAP"
          elif [ -n "$XKBTYPES" -a -n "$XKBCOMPAT" -a -n "$XKBSYMBOLS" -a -n "$XKBGEOMETRY" ]; then
            $SETXKBMAP -types "$XKBTYPES" -compat "$XKBCOMPAT" -symbols "$XKBSYMBOLS" -geometry "$XKBGEOMETRY"
          elif [ -n "$XKBTYPES" -a -n "$XKBCOMPAT" -a -n "$XKBSYMBOLS" ]; then
            $SETXKBMAP -types "$XKBTYPES" -compat "$XKBCOMPAT" -symbols "$XKBSYMBOLS"
          elif [ -n "$XKBSYMBOLS" ]; then
            $SETXKBMAP -symbols "$XKBSYMBOLS"
          fi
        fi
      fi
    fi
    
    exit 0
    I am not familiar with crontab but the command "crontab -l" and "sudo crontab -l" give me no entries.

  9. #9

    Default Re: syncthing: runs at startup

    Puzzling, I'm not quite sure what to suggest.
    I had been fairly sure it was being started under systemd because the start command
    Code:
    /usr/bin/syncthing -no-browser -no-restart -logflags=0
    is the same as the start command used in the systemd service file.
    Is there any chance that you installed syncthing from the syncthing web-site rather than an openSUSE repo? A quick check with
    Code:
    sudo zypper se syncthing
    would confirm.
    I guess if all else fails you could remove the existing package and re-install it.
    Sorry I couldn't help more.

  10. #10
    Join Date
    Aug 2008
    Location
    Brazil
    Posts
    2,941

    Default Re: syncthing: runs at startup

    I've been using syncthing successfully for almost a year now, backing up 5 openSUSE boxes on my LAN. I'm not using a WAN facing server.

    First attempts where difficult, mainly due to no package availability for 13.2

    This was helpful to install under systemd:

    https://docs.syncthing.net/users/aut...=systemd#linux

    Installing the site package was reasonably successful, but depending on what permissions it was installed with (system-wide or local user), updating from the browser page would lock the program, requiring an stop-restart of the service on the command line.

    After upgrading to LEAP 42.3 I could install from the updates repo (currently version 0.14.42, older than the developer site's). I also installed qsyncthingtray from the OSS repo, which has some info and configuration options (autostart), and it's own web-like interface, among other goodies.

    You may want to disable syncthing autoupdate feature, to avoid installing a non-repo version.

    syncthing-inotify is a great tool too, with instant instead of timed backups of modified files:

    https://github.com/syncthing/syncthing-inotify

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •