Repository navigation
--password-command is run twice when using --daemon #7341
Copy link
Copy link
Closed
Labels
Description
When using the --daemon flag to daemonize the rclone process, the command given to --password-command is run twice. I guess in some cases this is not an issue, but in my case, the password-command is pass show rclone/config which retrieves the password from a gpg encrypted file through pass, and that requires me to touch a security key. So instead of touching it once, I have to touch it twice.
Starting rclone like this requires only a single authentication (touch of the security key):
rclone mount gdrive: ~/gdrive --password-command="pass show rclone/config"
And starting it like this requires double authentication (touching it two times):
rclone mount gdrive: ~/gdrive --password-command="pass show rclone/config" --daemon
What is your rclone version (output from rclone version)
~ on master ❯ rclone version
rclone v1.63.1
- os/version: arch (64 bit)
- os/kernel: 6.5.3-arch1-1 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.20.6
- go/linking: dynamic
- go/tags: noneWhich cloud storage system are you using? (e.g. Google Drive)
I'm using google drive in my example.
A log from the command with the -vv flag (e.g. output from rclone -vv copy /tmp remote:tmp)
~ on master ❯ rclone mount gdrive: ~/gdrive --password-command="pass show rclone/config" --daemon -vv
<7>DEBUG : rclone: Version "v1.63.1" starting with parameters ["rclone" "mount" "gdrive:" "/home/phisch/gdrive" "--password-command=pass show rclone/config" "--daemon" "-vv"]
<7>DEBUG : rclone: systemd logging support activated
<7>DEBUG : Creating backend with remote "gdrive:"
<7>DEBUG : saving configKey to temp file
<7>DEBUG : attempting to obtain configKey from temp file /tmp/rclone1758618437
<7>DEBUG : using _RCLONE_CONFIG_KEY_FILE for configKey
<7>DEBUG : Using config file from "/home/phisch/.config/rclone/rclone.conf"
<7>DEBUG : rclone: Version "v1.63.1" finishing with parameters ["/usr/bin/rclone" "mount" "gdrive:" "/home/phisch/gdrive" "--password-command=pass show rclone/config" "--daemon" "-vv"]This log shows that rclone is run twice. So is there a way to avoid this, or have the processes share the result of the password-command?
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Reactions are currently unavailable
Activity
ncw commentedon Sep 27, 2023
Argh - another
--daemonbug!I believe this works correctly if you type in the password manually - we have a mechanism for that, so hopefully it won't be too difficult to fix.
Do you want to have a go @phisch ?
PS I really hate the
--daemonflag! The go runtime means we can't fork rclone, we have to start a new process, but that leads straight to this problem and lots of similar ones!phisch commentedon Sep 27, 2023
I'd rather not dig my head into Go right now. Sorry 😛
ncw commentedon Sep 8, 2026
I've merged @hsdfat fix for this this to master now which means it will be in the latest beta in 15-30 minutes and released in v1.75.2 most likely
fs/config: only run --password-command once when using --daemon
fs/config: only run --password-command once when using --daemon