Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve systemd/user is not supported on CentOS / RHEL (Issue #131) #132

Merged
merged 5 commits into from
Aug 27, 2018

Conversation

abraunegg
Copy link
Owner

@abraunegg abraunegg commented Aug 19, 2018

  • Initial work on resolving systemd issues on CentOS

Actual error being resolved:

2018-Aug-19 13:46:38.8706412 Loading config ...
2018-Aug-19 13:46:38.8708594 Using Config Dir: /.config/onedrive
2018-Aug-19 13:46:38.8711192 No config file found, using defaults
2018-Aug-19 13:46:38.8711988 Initializing the OneDrive API ...

Note the incorrect Config Dir when running as a systemd service on CentOS

If application is authorised, application creates /~/OneDrive/ as the sync dir, because ~ is not being correctly expanded due to reduced environment variables when running as a service

* Initial work on resolving issues on CentOS as a service
update makefile
* Update readme
@abraunegg
Copy link
Owner Author

abraunegg commented Aug 19, 2018

Validated the changes on the following OS's:

  • CentOS 7.x
  • Arch Linux
  • Ubuntu
  • OpenSuSE
  • Fedora 28
  • Debian

Tested the following:

  • onedrive --synchronize --verbose & detected correct default home / config directories as root user
  • onedrive --synchronize --verbose & detected correct default home / config directories as non-root user
  • onedrive --monitor --verbose & detected correct default home / config directories as root user
  • onedrive --monitor --verbose & detected correct default home / config directories as non-root user
  • Ran via systemd service file as root user & detected correct default home / config directories

Only issue encountered under Debian, is this (as root user):

systemctl --user enable onedrive

generates this error:

Failed to connect to bus: No such file or directory

this appears to be because, on Debian, as root user the following environment variables are not set (at least on my headless, no X Windows test system):

DBUS_SESSION_BUS_ADDRESS
XDG_RUNTIME_DIR
XDG_SESSION_ID

Running systemctl --user enable onedrive as a non-root user works without issue however.

@abraunegg abraunegg changed the title Initial work on resolving systemd issues on CentOS Resolving systemd issues on CentOS Aug 19, 2018
@abraunegg
Copy link
Owner Author

@robertjf
Can you help test this PR & any scenario's you can think of? I have tried the 5 main use cases across 6 different OS's - all 'appear' to be working - that is - the correct config / home directory is found / automatically detected.

One thing I have not tested is what happens if --confdir & --syncdir is passed through on CLI or as a config option, or if they are set via a systemd configuration file.

The readme probably needs to be updated as well to say that if using --confdir & --syncdir in configuration file or systemd file use the full path and not a path that starts with ~

@robertjf
Copy link

will do...

* update homepath configuration to be more consistent with original code
@abraunegg
Copy link
Owner Author

Any update on looking at this PR from a regression perspective?

@robertjf
Copy link

well, I haven't found any problems with it with the testing I did over the weekend; the only thing that threw me was running as a systemd service in a root context (which I'm not entirely happy about) but it does run...

@abraunegg abraunegg changed the title Resolving systemd issues on CentOS Resolve systemd/user is not supported on CentOS / RHEL (Issue #131) Aug 24, 2018
* update readme
Copy link

@robertjf robertjf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good

@abraunegg abraunegg merged commit a3f69d4 into master Aug 27, 2018
@abraunegg abraunegg deleted the Issue-#131 branch August 27, 2018 03:22
@lock
Copy link

lock bot commented Jan 5, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Jan 5, 2019
darrenedale pushed a commit to darrenedale/onedrive that referenced this pull request Aug 4, 2022
* By default the DNS timeout on HTTP.method is too short. If DNS
resolution takes too long, a resolution error is thrown. Increase DNS
timeout to 5 seconds.
* Cleanup unittest - double declaration
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants