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

v1.0. RC1 Need to show warning if onedrive is already running when starting the GUI #55

Closed
rogercreagh opened this issue Aug 22, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@rogercreagh
Copy link

By default onedrive runs automatically in monitor mode on system login. When the GUI starts it doesn't detect that onedrive is already running and reports "Onedrive is sync not running" (which is also bad English - should be "Onedrive sync is not running") which of course is not true.
If you press the play button it hangs with the message Initializing the Onedrive API"
In the log you find the following lines:

2022-08-22 22:32:24,479 [OneDriveGUI.py:1995][fn=run][INFO] - [Roger] Opening the item database ...
2022-08-22 22:32:24,479 [OneDriveGUI.py:1995][fn=run][INFO] - [Roger] - Use 'sudo ps aufxw | grep onedrive' to potentially determine acive running process
2022-08-22 22:32:24,479 [OneDriveGUI.py:1995][fn=run][INFO] - [Roger] 
2022-08-22 22:32:24,753 [OneDriveGUI.py:2130][fn=run][INFO] - @ERROR 

So it looks like it is detecting that onedrive is already running when you manually try to start it from the GUI.
Shouldn't it also run this check when the GUI is initialised so it can report that onedrive --monitor is running?

bpozdena added a commit that referenced this issue Aug 23, 2022
@bpozdena
Copy link
Owner

Thanks for reporting the issues @rogercreagh .

The GUI will now handle this situation more gracefully. It will automatically stop the failed worker and show the bellow status message.
image

Just note that this message will only appear after you attempt to start sync from the GUI manually or after GUI startup if you have auto-sync enabled. I do not plan to monitor or manage processes which were started outside the GUI scope.

I had to remove RC1 due to another critical issue I discovered. Feel free to test updated v1.0.0-RC2 AppImage .

@bpozdena bpozdena self-assigned this Aug 23, 2022
@bpozdena bpozdena added the bug Something isn't working label Aug 23, 2022
@rogercreagh
Copy link
Author

This is a good fix to the immediate bug of it hanging if another instance of onedrive is running but it leaves the underlying problem.
The onedrive app somehow makes itself automatically run in monitor mode on system start - which means you have to find the process and kill it before you can run onedrive.
I have been unable to find how onedrive is autorunning on boot - it doesn't seem to be in any of the obvious places so I can't change this behaviour which is a pain. That makes OneDriveGUI pretty unusable for simple use.
Since you can detect it is already running (as it usually will be by default) could you not provide a button to kill the exiting process?
Alternatively perhaps you need to bundle a non-autorunning version of onedrive client with the GUI and advise the need to uninstall the existing client and add the GUI to the Startup Applications list if you want onedrive to always be running (which seems normal to me)

@bpozdena
Copy link
Owner

Depending on how you have installed OneDrive client, you should be able to stop the systemd service with systemctl --user stop onedrive or systemctl stop onedrive@<username>.service.

To prevent OneDrive client from starting on startup, you should be able to disable the systemd service with systemctl --user disable onedrive or systemctl disable onedrive@<username>.service .

You can check the official documentation at https://github.com/abraunegg/onedrive/blob/master/docs/USAGE.md#running-onedrive-as-a-system-service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants