GitJournal / git-auto-sync

Automatically Sync Git Repos
Apache License 2.0
139 stars 13 forks source link

Deamon registration fails on Windows 11 #7

Open millokeller opened 2 years ago

millokeller commented 2 years ago

I ran git-auto-sync d add <repo> and I am getting:

Installing git-auto-sync as a daemon
Starting git-auto-sync-daemon
2022/05/15 13:54:16 The dependency service does not exist or has been marked for deletion.

I checked for the process called git-auto-sync-daemon, but there is none.

I am using git-auto-sync on Windows 11 and manual synchronization works.

vHanda commented 2 years ago

Thanks for filling this.

I've mostly only tested this on MacOS, and Linux. I haven't used Windows in some ... 14 years. I'll download it, and try it run it over there :)

nithinphilips commented 2 years ago

This issue is due to the dependencies on network-online.target and syslog.target services, which do not exist on Windows. (https://github.com/GitJournal/git-auto-sync/blob/master/common/service.go#L46).

You can verify this by running:

sc qc git-auto-sync-daemon

Look for the DEPENDENCIES line.

To manually fix the service, open Command Prompt as Administrator and run:

sc config git-auto-sync-daemon depend= /
sc start git-auto-sync-daemon

The service should start.

vHanda commented 2 years ago

I've just released version 1.5 without the dependencies. Could you please confirm that it works for you?

(Maybe then I'll try to find an hour or two to create a proper installer for windows and try to get it into winget)

nithinphilips commented 2 years ago

@vHanda This solves the issue. Thank you!

git-auto-sync daemon add now gives this output and the service appears to be running:

...
Installing git-auto-sync as a daemon
Starting git-auto-sync-daemon

There is no longer an error message about the dependency.

millokeller commented 2 years ago

For me this tool is still not doing the trick. I am facing multiple issues. I wiped all data from the initial installation and did a fresh registration of the daemon (Windows Service). The installation seems to work and the daemon appears up and running now. But there is still no synchronization. Neither for new added files, nor for changes in existing files. I have been waiting for over 20 Minutes to verify this. What am I missing?

Nimja commented 2 years ago

If I run the commands as admin, it will run the daemon and status works as expected.

However, commits are still not done.

git-auto-sync.exe sync command works fine and pushes/pulls as expected.

Arty2 commented 1 year ago

Facing the same issue with the v1.5 release on Windows 10. The daemon status reports the directory is properly monitored, the manual sync works, but it has to happen manually.

sudo-robot-destroy commented 3 months ago

Same for me on Windows 10. Manual sync works as expected. I have to add the folder to the daemon as admin and the daemon appears to start and monitor the folder, but it doesn't actually ever do commits.