sylverpyro

Members
  • Posts

    2
  • Joined

  • Last visited

sylverpyro's Achievements

New User

New User (1/3)

  1. Ok, I think I have identified why some users (including myself) are experiencing this as a bug. "pid_file" : "/home/<ussername>/.btsync/btsync.pid", When this parameter is supplied in the config file, everything works perfectly. However, when it is not supplied (when you are also spcifying UID/GID and the storage_direcctory) everything stops working - but only when run via the init script. It works just fine if you run btsync-daemon --config=/etc/btsync/<config without the pid_file parameter>. However the init script simply silently fails to start the daemon when it tries to run a config without this set. I don't know if this is a bug in btsync (I doubt it as it runs just fine from the command line), but it would be really helpful if the init script did some sanity checking to see if a user has created a config that is impossable for the init script to start (such as when the UID is specified with a storage_dir and no pid_file). So, I guess please inturpet this as a feature request. Thanks for your help identifiying this, and thanks for providing the packages!
  2. So, I think I have identified a bug that affects running btsync with the packaged init script under credentials other than root. 1. btsync expects a per-user PID file sync.pid to get created in the folder indicated by "storage_path" = in the config file - but the init script staticly creates the file in /var/run/<username>.$1.pid - So, when btsync gets launched under a UID/GID other than root, the PID file location needs get changed from /var/run/ to the storage_path location - and needs to happen for each user the daemon is going to spawn under (I think). For storage_path = /home/<username>/.btsync/ start-stop-daemon --start --quiet --oknodo --pidfile /var/run/btsync.<username>.pid --make-pidfile --chuid <username>:<username> --background --umask 0113 --verbose --exec /usr/lib/btsync/btsync-daemon -- --nodaemon --config /etc/btsync/<username>.conf : Can't open pid file /home/<username>/.btsync/sync.pid. Permission denied 2. After manually coding the PID path into the init script for testing, it also appears that btsync wants write permissions to this PID file. The PID file created by start-stop-daemon, even with //DAEMON_UID= set in the config file, gets created with ownership 'root:root -rw-rw-r' - This file then needs to be read by btsync, however btsync appears to do an additional check against this PID file to see if its writeable: start-stop-daemon --start --quiet --oknodo --pidfile /home/<username>/.btsync/sync.pid --make-pidfile --chuid <username>:<username> --background --umask 0113 --verbose --exec /usr/lib/btsync/btsync-daemon -- --nodaemon --config /etc/btsync/<username>.conf : Can't open pid file /home/<username>/.btsync/sync.pid. Permission denied ls -al /home/<username>/.btsync/sync.pid : -rw-rw-r-- 1 root root 6 Aug 4 09:21 sync.pid If you make the group get set to <username> via chgrp <username> and chmod g+s on the storage_path folder (which ends up giving effective permissions of g+rw to the sync.pid file when it gets created), the issue appears to go away. For storage_path = /home/<username>/.btsync chgrp <username> /home/<username>/.btsync chmod g+s /home/<username>/.btsync ls -ald /home/<username>/.btsync drwxrwsr-x 2 xbmc xbmc 4096 Aug 4 09:55 /home/<username>/.btsync/ start-stop-daemon --start --quiet --oknodo --pidfile /home/<username>/.btsync/sync.pid --make-pidfile --chuid <username>:<username> --background --umask 0113 --verbose --exec /usr/lib/btsync/btsync-daemon -- --nodaemon --config /etc/btsync/<username>.conf : Starting /usr/lib/btsync/btsync-daemon... By using this application, you agree to our Privacy Policy and Terms. http://www.bittorrent.com/legal/privacy http://www.bittorrent.com/legal/terms-of-use So, the init script is probably going to have to be modified to accomidate this PID requirement of btsync when running under users other than root and with different storage_path variables.