Config Create to specific location

Sorry this is what I get below, so the sh script works fine when I run it from terminal but then I put it into a simple package and this happens - debug log when run pkg installer in terminal:

hitlocaladmin@Holistics-Air ~ % sudo installer -pkg /Users/hitlocaladmin/Desktop/RClone\ Install/build/rclone.pkg -target / -dumplog
installer: Package name is rclone
Mar 25 19:48:27 installer[57209] : Referenced component packages (1) trustLevel=100
installer: Installing at base path /
Mar 25 19:48:27 installer[57209] : -[IFPKGDerivedDocument sortedPackageLocations]: result = (
"file://localhost"
)
Mar 25 19:48:27 installer[57209] : -[IFDInstallController(Private) _buildInstallPlanReturningError:]: location = file://localhost
Mar 25 19:48:27 installer[57209] : -[IFDInstallController(Private) _buildInstallPlanReturningError:]: file://localhost/Users/hitlocaladmin/Desktop/RClone%20Install/build/rclone.pkg
Mar 25 19:48:27 installer[57209] : Set authorization level to root for session
Mar 25 19:48:27 installer[57209] : Administrator authorization granted.
Mar 25 19:48:27 installer[57209] : Will use PK session
Mar 25 19:48:27 installer[57209] : Using authorization level of root for IFPKInstallElement
Mar 25 19:48:27 installer[57209] : Starting installation:
Mar 25 19:48:27 installer[57209] : Configuring volume "Macintosh HD"
Mar 25 19:48:27 installer[57209] : Preparing disk for local booted install.
Mar 25 19:48:27 installer[57209] : Free space on "Macintosh HD": 64.41 GB (64413216768 bytes).
Mar 25 19:48:27 installer[57209] : Create temporary directory "/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T//Install.57209En1zO7"
Mar 25 19:48:27 installer[57209] : IFPKInstallElement (1 packages)
Mar 25 19:48:27 installer[57209] : PackageKit: Enqueuing install with framework-specified quality of service (utility)
Mar 25 19:48:28 installer[57209] : install:didFailWithError:Error Domain=PKInstallErrorDomain Code=112 "An error occurred while running scripts from the package “rclone.pkg”." UserInfo={NSFilePath=./preinstall, NSURL=file://localhost/Users/hitlocaladmin/Desktop/RClone%20Install/build/rclone.pkg, PKInstallPackageIdentifier=com.mygreatcompany.pkg.rclone, NSLocalizedDescription=An error occurred while running scripts from the package “rclone.pkg”.}
Mar 25 19:48:28 installer[57209] : Install failed: The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.
installer: The install failed. (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance. An error occurred while running scripts from the package “rclone.pkg”.)

Kind Regards

Jack

Unfortunately, there isn' t much in those logs to clue in on any error. Are you able to generate more debug or see anything else?

Trying to get more logs but failing as all are coming back the same. The only difference is that the PKG will run as root user and the script is running as the current user with sudo password so this must be breaking it?

Kind Regards

Jack

You'd need to add a NOPASSWD in your sudo file for that command if you wanted to not enter a password.

I use a broad sudo as I am the only person using the machine so my visudo looks like:

felix ALL=(ALL) NOPASSWD: ALL

You mentioned you used a few commands to create the conf file running as root would you be able to share them?

Kind regards

Jack

Scroll up and look as my sudo command as that's what I used.

Hi again I have taken the command above and it appear to work in creating the file however I get an error when connecting to my Sharepoint here is the command:

sudo -- bash -c export RCLONE_CONFIG=/tmp/rclone.conf;sudo rclone config create Sharepoint webdav url "URL" sharepoint user "USER@DOMAIN.com" pass "PASSWORD"

Error when running command sudo rclone ls Sharepoint:

Failed to create file system for "Sharepoint:": wst:InvalidRequest: Invalid Request (AADSTS90023: Invalid STS request.)

When I copy and paste the contents of my command to create the config manually it works?

Kind Regards

Jack

Can you share the rclone.conf when you create it both ways and so we can compare the two?

The issues seems to be that its not encrypting the password. My password I use is:

yek9gEPSFXNP5yKF2PCr5FAUNE2zdp

which has no special characters but if I just use:

pass password

This get encrypted any ideas?

Kind Regards

Jack

Can you share specifically what command you are running to create the config file as a whole and what the output of the rclone.conf is?

sudo rclone config create Sharepoint webdav url "URL" sharepoint user "USER@DOMAIN.com" pass "PASSWORD"

--------------------
[Sharepoint]
type = webdav
url = "URL"
vendor = sharepoint
user = "USER@DOMAIN.com"
pass = *** ENCRYPTED ***
--------------------```

Doesn't work:

felix@gemini:~$ rclone config create Sharepoint webdav url "URL" sharepoint user "USER@DOMAIN.com" pass "PASSWORD"
Error: found key without value
Usage:
  rclone config create <name> <type> [<key> <value>]* [flags]

Flags:
  -h, --help   help for create

Use "rclone [command] --help" for more information about a command.
Use "rclone help flags" for to see the global flags.
Use "rclone help backends" for a list of supported services.

2020/03/27 07:03:20 Fatal error: found key without value

rclone.conf

[Sharepoint]
type = webdav
url = URL
vendor = sharepoint
user = USER@DOMAIN.com
pass = yek9gEPSFXNP5yKF2PCr5FAUNE2zdp - NOT ENCRYPTED

Don't put in the double quote marks I'm only putting them in to show you where my variable is

Kind Regards

Jack

So specifically what command are you running to generate the rclone.conf.

I can't share the username and password on this forum, just take out the double quote marks around my variable and that's where I put my email and url and password

sudo rclone config create Sharepoint webdav url URL sharepoint user USER@DOMAIN.com pass PASSWORD

Doesn't work:

felix@gemini:~$ rclone config create Sharepoint webdav url URL sharepoint user USER@DOMAIN.com pass PASSWORD
Error: found key without value
Usage:
  rclone config create <name> <type> [<key> <value>]* [flags]

Flags:
  -h, --help   help for create

Use "rclone [command] --help" for more information about a command.
Use "rclone help flags" for to see the global flags.
Use "rclone help backends" for a list of supported services.

2020/03/27 07:05:25 Fatal error: found key without value

Can you make a test one / an example / something that shows what you are running.

Sorry try again with vendor here is an example:

sudo rclone config create Sharepoint webdav url https://google.com/ vendor sharepoint user user1@outlook.com pass helloworld

Then try again with this password:

sudo rclone config create Sharepoint webdav url https://google.com/ vendor sharepoint user user1@outlook.com pass yek9gEPSFXNP5yKF2PCr5FAUNE2zdp

check the conf file and the password is unencrypted?