Rclone mount command with --log-file flag using golang exec is getting stuck forever

What is the problem you are having with rclone?

I am running rclone mount command with –log-file flag using Golang code exec.Command(comm, args...).CombinedOutput(). The problem is that go code at this line gets hung forever, blocking execution of further logic, though rclone mount process gets created on host.

Note: Without –log-fileflag, go code runs fine, create mount process and exits successfully.

I just want to know why –log-fileis causing go code to hung. How to fix this issue?

Run the command 'rclone version' and share the full output of the command.

# rclone version
rclone v1.70.3-DEV
- os/version: ubuntu 24.04 (64 bit)
- os/kernel: 6.8.0-64-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.25.0
- go/linking: dynamic
- go/tags: none

Which cloud storage system are you using? (eg Google Drive)

IBM COS

The command you were trying to run (eg rclone copy /tmp remote:tmp)

/var/usrlocal/bin/rclone mount ibmcos:bha-rclone-aug18 /var/data/kubelet/pods/8ec481a5-b58f-47ad-b13b-ead43bb534bb/volumes/kubernetes.io~csi/pvc-09a31b6c-3130-46c8-a97c-f78dd3cf5c8e/mount --log-file=/var/log/rclone-mount6.log --vfs-cache-mode=writes --allow-other=true --config=/var/lib/coscsi-config/1ed1b834b8cd25a5f4fa1a9ac43ff00217854a4c74548f23729f8bd957645e52/rclone.conf --daemon=true --daemon-timeout=5s

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[ibmcos]
type = s3
endpoint = https://s3.direct.us-south.cloud-object-storage.appdomain.cloud
provider = IBMCOS
env_auth = true
access_key_id = xxxx
secret_access_key = xxxx
location_constraint = us-south-standard
bucket_acl=private
max_upload_parts=64
memory_pool_flush_time=30s
acl=private
upload_cutoff=256Mi
chunk_size=64Mi
disable_checksum=true
low_level_retries=3

A log from the command that you were trying to run with the -vv flag

Paste  log here

Note that rclone mount does not return control - it needs to be running to service the mount. So it not returning sounds like it is working correctly.

If you want it to return control then you'll need to use the --daemon flag. However I don't recommend that as daemonising Go programs is really hard!

We have requirement to run rclone mount process in the background only using Go Code. Hence, we are running rclone mount command with –daemon and –log-fileflag.
But looks like when starting rclone process in background using Go code, something is happening due to –log-fileflag which is causing Golang code exec.Command(comm, args...).CombinedOutput()to get stuck forever.

Note: Without –log-fileflag, daemonization using Go code works perfectly. But in this case, we are loosing rclone logs.

My recommendation is do not use --daemon. Restructure your program to run a go routine to wait for the mount termination or wait for 5 seconds (say) for an error and if you haven't got one, return.