box-linux-sync icon indicating copy to clipboard operation
box-linux-sync copied to clipboard

setup went well, but cant run as nomal user..

Open Dutchglory opened this issue 12 years ago • 21 comments

Hi,

André here.

Setup went well, but cant run as nomal user. i'v installed davfs2 setup username and pass in ./davfs2/secrets setup correct path to box folder in etc/fstab

NOTE: www.box.net should be www.box.com

try to start box sync... ~/BOX-SYNC/bin$ ./box-sync start /sbin/mount.davfs: program is not setuid root. Failed to mount sync dir.

as root maybe.. ~/BOX-SYNC/bin$ gksu ./box-sync start mount: can't find /root/Box in /etc/fstab or /etc/mtab. Failed to mount sync dir.

so what should i do?

Dutchglory avatar Jul 15 '12 00:07 Dutchglory

Sorry, found the Debian forum post faster than this one. Can't debug it right now, you did well posting to Debian too. Hope I can debug this tomorrow night.

vitorbrandao avatar Jul 19 '12 09:07 vitorbrandao

not sure how Gentoo runs WebDAV maybe on Gentoo a normal user is allowed to run this. on Debian only root is allowd to run WebDAV unless you add normal users to sudoers ( etc\sudoers )

so i'm not sure on how to implement this in to the code....

Dutchglory avatar Jul 19 '12 10:07 Dutchglory

but i'll keep testing...

Dutchglory avatar Jul 19 '12 10:07 Dutchglory

run as normal user:

  • box-sync still requires " /root/Box/ to be available within /etc/fstab

If /home/NormalUser/Box/ is available within /etc/fstab i should be able to run as normal user.

  • box-sync should look at ./davfs2/secrets for username & password to be able run box-sync at boot or crontab

Dutchglory avatar Jul 19 '12 10:07 Dutchglory

In /etc/fstab I have https://www.box.com/dav /home/me/Box davfs rw,user,noauto 0 0. Also a ~/.davfs2/secrets file exist with my Box credentials.

I saw a suggestion to run sudo dpkg-reconfigure davfs2 and answering "yes" to the setuid question. After that check you belong to the davfs2 group: groups | grep davfs2

vitorbrandao avatar Jul 20 '12 21:07 vitorbrandao

when i try to start box-sync

wrong permissions set for cache directory /home/verwijs/.davfs2/cache/www.box.com-dav+home-verwijs-Box+verwijs

witch permisson(s) need this to be? the number, like 600 or 775 etc.

Andre

Dutchglory avatar Jul 21 '12 09:07 Dutchglory

Should be 0700. And that directory is not created by box-sync. I'm adding a new entry in box-sync to create that directory with the right permissions.

vitorbrandao avatar Jul 21 '12 23:07 vitorbrandao

ok :) thanks. this folder is created by davfs ? i didden't make it.

Dutchglory avatar Jul 22 '12 06:07 Dutchglory

it works..!! :) maybe add entry to change permission with all required files/folders. Stopping box-sync still requires root.

Dutchglory avatar Jul 22 '12 07:07 Dutchglory

Have you tried the dpkg-reconfigure davfs2 command?

vitorbrandao avatar Jul 22 '12 21:07 vitorbrandao

yes i did... starting works great. stopping not for some reason...

Dutchglory avatar Jul 22 '12 22:07 Dutchglory

I'll have access to a Ubuntu machine tomorrow. I will be able to test it there. In Gentoo stopping works fine.

I will also add some tests, tag box-sync 0.1.0 and upload it to PyPI. Hope to close this issue as soon as possible.

vitorbrandao avatar Jul 22 '12 22:07 vitorbrandao

ok :) if i need to tes, let me know..

Dutchglory avatar Jul 22 '12 22:07 Dutchglory

OK, thanks for all the support @Dutchglory

vitorbrandao avatar Jul 22 '12 23:07 vitorbrandao

Instead of https://www.box.com/dav in my /etc/fstab, I used https://dav.box.com/dav and it now works! (syncing as of this moment)

How do i start this at boot and stop on shutdown?

ghost avatar Jan 29 '14 12:01 ghost

How do i start this at boot and stop on shutdown?

Depends on the Linux distro you are using. Some distros provide a /etc/rc.local where you put the the scripts you want to be run at boot. In Gentoo you would create a /etc/local.d/boxsync.start and add the following statements:

#!/bin/sh
/path/to/bin/box-sync start

and make it chmox +x /etc/local.d/boxsync.start.

To stop the service replicate these steps for /etc/local.d/boxsync.stop.

vitorbrandao avatar Jan 30 '14 13:01 vitorbrandao

I'm having a somewhat similar issue. I cannot run ./box-sync start as an unprivileged user, but it's because davfs2 does not recognize my user as belonging to the davfs2 group even though I responded "yes" after running sudo dpkg-reconfigure davfs2.

The other odd thing is that when I run groups jake it shows that I am a member of the davfs2 group. Any idea why box-sync isn't recognizing that my user belongs to the davfs2 group?

Thanks

jakebruemmer avatar Jun 05 '15 17:06 jakebruemmer

Hi @gr1zzly-be4r, can you tell me what distro are you using?

vitorbrandao avatar Jun 05 '15 20:06 vitorbrandao

Ubuntu GNOME 15.04

jakebruemmer avatar Jun 07 '15 15:06 jakebruemmer

I am using Debian 7.2 x86_64

Is the box directory supposed to be it's own file system? Why should the box sync directory be mounted in /etc/fstab?

walter@fir:~/box-linux-sync/bin$ ./box-sync start mount: can't find /home/walter/Box in /etc/fstab or /etc/mtab Failed to mount sync dir.

wallyreport avatar Jul 10 '15 02:07 wallyreport

Hi @walterbyrd

Is the box directory supposed to be it's own file system?

No. You can use your current filesystem (rootfs or /home or anything else).

Why should the box sync directory be mounted in /etc/fstab?

To make the remote WebDAV share locally available. In order to do so we create a directory as a mount point and add it to /etc/fstab to have it automatically mounted.

vitorbrandao avatar Jul 11 '15 19:07 vitorbrandao