Closed mpeter50 closed 2 years ago
Have you tried mounting using the --database
option?
That way it works on the command line, but I can't put it into fstab :/ Unless if I put that into the mount helper script too.
Yes, it would make sense to add to helper script. If you get it working and submit PR I'll merge.
Thanks Paul
On Fri, 7 Jan 2022, 12:25 mpeter50, @.***> wrote:
That way it works on the command line, but I can't put it into fstab :/ Unless if I put that into the mount helper script too.
— Reply to this email directly, view it on GitHub https://github.com/oniony/TMSU/issues/239#issuecomment-1007367875, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABOB5DCHVL7EL5DFVJ3PDUU3LTVANCNFSM5LMYK5ZA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you commented.Message ID: @.***>
Ok, but before I do that, I would like to ask something.
What was the original concept with the DB_PATH argument of the tmsu mount
command?
I ask this mostly so I know if placing this in the mount helper script is a workaround or 'the way it's done'.
Also, I if it is the latter, I would like to change the tmsu mount
command's help documentation, so it doesn't show anymore that argument.
I've made some changes to the mount helper script to fix this issue, and also changed the documentation shows by tmsu help mount
.
Could you take a look please?
As you can see earlier I've modified the script so that it prints some information useful for debugging.
I've put half of that behind a variable which disables it by default, but I've kept the --verbose
option on the TMSU command, because I didn't find a way to make it conditional while keeping the script easy to follow.
What do you think of that? Is it ok? Do you have a suggestion on how to change it?
What I tried is moving the global options into a variable, that is modified at 2 places, and referencing that variable in the commands at the bottom, but I found it unnecessarily hard to follow.
Oh, umm, pull request. I forgot that.
Tried running
tmsu mount "/mnt/longpath/.tmsu/db" /mnt/longpath/mediumpath/mountags/
, and it works if I run it from a subdir of the dir that contains the db, but if I run it from home, or try to mount the VFS with fstab, it fails withtmsu: no database found: use 'tmsu init' to create one
, however, there is a database on the first path.I don't know much about Go, but I think I found what is the problem.
In
src/github.com/oniony/TMSU/cli/cli.go::Run()
, it tries to find a database by the--database
option, then by theTMSU_DB
env var, and then by discovery, starting from the current working directory and going back to root. If it fails in it, it prints errors and setsdatabasePath
tonil
, which it gets fromsrc/github.com/oniony/TMSU/cli/common.go::openDatabase()
. Then,src/github.com/oniony/TMSU/cli/mount.go::mountExec()
gets called with thenil
databasePath
, and since theopenDatabase
in it fails again, it won't get to reading the database path from the args, because it returns with the error right there.It seems a workaround is having a database in the root directory, but I'm not sure if that's a good idea to do.