Skip to content

--password-command is run twice when using --daemon #7341

Closed

Description

@phisch

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: none

Which 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.

Activity

  1. ncw commented on Sep 27, 2023

    @ncw
    Member

    Argh - another --daemon bug!

    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 --daemon flag! 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!

  2. phisch commented on Sep 27, 2023

    @phisch
    Author

    Do you want to have a go @phisch ?

    I'd rather not dig my head into Go right now. Sorry 😛

  3. ncw commented on Sep 8, 2026

    @ncw
    Member

    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

  4. added a commit that references this issue on Sep 8, 2026
    03783be
  5. added a commit that references this issue on Oct 6, 2026
    219851e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions