sysvol script problem

Come here to share your tips and tricks for using Samba4
Locked
Eric
Messages: 29
Registration: March 11, 2018 - 08:22

March 21, 2018 - 4:37 PM

Good morning,

I used the tis-sysvol script for DC replication but it doesn't work.

I downloaded the deb from git, then I ran create.sh to create the deb files, and then I installed the deb files on dc1 using apt-get

I followed the same procedure on DC2

On DC1 I ran tis-sysvol configure, it asked me for the root password of DC2, then after three password entries it displayed this

Code: Select all

root@bdc2.domain.eu's password:
root@bdc2.domain.eu's password:
root@bdc2.domain.eu's password:
Traceback (most recent call last):
  File "/opt/tis-sysvolsync/sysvolsync.py", line 409, in <module>
    main()
  File "/opt/tis-sysvolsync/sysvolsync.py", line 399, in main
    syncthing.add_mutual_sysvol_sync(local_dc,remote_dc)
  File "/opt/tis-sysvolsync/sysvolsync.py", line 273, in add_mutual_sysvol_sync
    remote_hostname,self.id,local_hostname,local_hostname,self.dataport),shell=True)
  File "/usr/lib/python2.7/subprocess.py", line 219, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command 'ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no bdc2.domain.eu python /opt/tis-sysvolsync/sysvolsync.py -ldebug -f /var/log/sysvolbind.log add-remote TA5PIMK-CZDJYBK-DNH4ATK-SUERFNJ-HUWNSKL-K3FOQ5K-K6NBJPX-DOTVKQY bdc1.domain.eu tcp://bdc1.domain.eu:22001' returned non-zero exit status 255

Then I launched the same script from DC2 and repeated the same steps

Initially the two servers were not in time synchronous, this has been resolved but synchronization does not occur at all.
What procedure should be followed to delete and redo without reinstalling everything?
Thank you in advance, sincerely
Eric
Initially I wasn't in sync with the time, but now it's done
Eric
Messages: 29
Registration: March 11, 2018 - 08:22

March 22, 2018 - 08:07

Hello,

excuse me, I simply forgot to restart SSH when accepting root connections.

A big thank you for this excellent work; we are entering the testing phase on a school campus with 600 laptops, desktops, tablets, etc.

Thank you,
Eric.
User avatar
vcardon
WAPT Expert
Messages: 278
Registration: Oct 06, 2017 - 10:55 p.m.
Location: Nantes, France

March 23, 2018 - 01:46

Hello, if you don't mind me asking, which academy? We at TIS are already in contact with several regarding Samba-AD and WAPT.

In any case, go all in with Samba-AD; it's robust and reliable. France loves Samba, and vice versa, and the Samba developers know this because they visit us every year in Paris, Nantes, and elsewhere, traveling from New Zealand or Germany to discuss matters with the Ministries, the people at the Inter-Ministerial level, and so on

. Best regards,

Vincent
Vincent CARDON
Tranquil IT
Eric
Messages: 29
Registration: March 11, 2018 - 08:22

June 28, 2018 - 4:31 PM

We are in the Créteil academy.

We are currently going live, but we restarted our installation from scratch to be sure we did everything correctly.

We are also encountering a problem with synchronization; I think there's an installation error, but I can't figure out what it is.

Traceback (most recent call last):
File "/opt/tis-sysvolsync/sysvolsync.py", line 409, in
main()
File "/opt/tis-sysvolsync/sysvolsync.py", line 348, in main
syncthing = SyncThing()
File "/opt/tis-sysvolsync/sysvolsync.py", line 87, in __init__
self.id = self.get_syncthing_id()
File "/opt/tis-sysvolsync/sysvolsync.py", line 158, in get_syncthing_id
return self.syncthing_rest_get('system/status')['myID']
File "/opt/tis-sysvolsync/sysvolsync.py", line 129, in syncthing_rest_get
data = requests.get('http://127.0.0.1:%s/rest/%s' % (self.apiport,path), hea ders={'X-API-Key':apikey}, proxies={'http':None,'https':None})
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 70, in get
return request('get', url, params=params, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 488, in req uest
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 609, in sen d
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 487, in sen d
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=8 385): Max retries exceeded with url: /rest/system/status (Caused by NewConnectio nError('
root@BDC2:/opt/tis-sysvolsync/deb# /etc/init.d/ssh restart
[ ok ] Restarting ssh (via systemctl): ssh.service.
root@BDC2:/opt/tis-sysvolsync/deb# /opt/tis-sysvolsync/sysvolsync.py configure
Traceback (most recent call last):
File "/opt/tis-sysvolsync/sysvolsync.py", line 409, in
main()
File "/opt/tis-sysvolsync/sysvolsync.py", line 348, in main
syncthing = SyncThing()
File "/opt/tis-sysvolsync/sysvolsync.py", line 87, in __init__
self.id = self.get_syncthing_id()
File "/opt/tis-sysvolsync/sysvolsync.py", line 158, in get_syncthing_id
return self.syncthing_rest_get('system/status')['myID']
File "/opt/tis-sysvolsync/sysvolsync.py", line 129, in syncthing_rest_get
data = requests.get('http://127.0.0.1:%s/rest/%s' % (self.apiport,path), hea ders={'X-API-Key':apikey}, proxies={'http':None,'https':None})
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 70, in get
return request('get', url, params=params, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 488, in req uest
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 609, in sen d
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 487, in sen d
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=8 385): Max retries exceeded with url: /rest/system/status (Caused by NewConnectio nError('



Could you tell me what's causing this and whether it's possible to reinstall without breaking everything?


I'm on Debian 9.
I followed the commands in your documentation:
`apt-get install git python-requests python-lxml python-ldap`,
`git clone https://github.com/
tranquilit/tis-sysvolsync`, `cd tis-sysvolsync/deb`, `
sh createdeb.sh`,

then
`apt-get install python-requests python-lxml python-ldap procps ldb-tools`
, `dpkg -i tis-sysvolsync-*.deb`.

I restarted the service, but when I check the `-xe` log on BDC1 or BDC2, there are errors

: `-- The unit tis-sysvolsync.service failed, with the result 'failed.
Jun 28 16:15:21 BDC2.lyceeader.eu systemd[1]: tis-sysvolsync.service: Failed with result 'exit-code'.`
June 28 16:15:21 BDC2.lyceeader.eu systemd[1]: tis-sysvolacl.service: Service hold-off time over, scheduling restart.
June 28 16:15:21 BDC2.lyceeader.eu systemd[1]: tis-sysvolsync.service: Start request repeated too quickly.
June 28 16:15:21 BDC2.lyceeader.eu systemd[1]: Failed to start Samba4 sysvol sync with syncthing.
-- Subject: The unit tis-sysvolsync.service failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit tis-sysvolsync.service failed, with the result failed.
June 28 16:15:21 BDC2.lyceeader.eu systemd[1]: tis-sysvolsync.service: Failed with result 'exit-code'.
June 28 16:15:21 BDC2.lyceeader.eu systemd[1]: Stopped Samba4 sysvol replication watch and fixed ACL after sync completion.
-- Subject: The unit tis-sysvolacl.service has finished shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit tis-sysvolacl.service has finished shutting down.
June 28 16:15:21 BDC2.lyceeader.eu systemd[1]: tis-sysvolacl.service: Start request repeated too quickly.
June 28 16:15:21 BDC2.lyceeader.eu systemd[1]: Failed to start Samba4 sysvol replication watch and fix ACL after sync completion.
-- Subject: The unit tis-sysvolacl.service failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit tis-sysvolacl.service failed, with the result failed.
June 28 16:15:21 BDC2.lyceeader.eu systemd[1]: tis-sysvolacl.service: Unit entered failed state.
June 28 16:15:21 BDC2.lyceeader.eu systemd[1]: tis-sysvolacl.service: Failed with result 'exit-code'.
Jun 28 16:17:01 BDC2.lyceeader.eu CRON[4349]: pam_unix(cron:session): session opened for user root by (uid=0)
Jun 28 16:17:01 BDC2.lyceeader.eu CRON[4350]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Jun 28 16:17:01 BDC2.lyceeader.eu CRON[4349]: pam_unix(cron:session): session closed for user root
Jun 28 16:23:35 BDC2.lyceeader.eu systemd[1]: Stopping OpenBSD Secure Shell server...
-- Subject: Unit ssh.service started to stop
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit ssh.service has started to shut down.
Jun 28 16:23:35 BDC2.lyceeader.eu sshd[821]: Received signal 15; terminating.
Jun 28 16:23:35 BDC2.lyceeader.eu systemd[1]: Stopped OpenBSD Secure Shell server.
-- Subject: The unit ssh.service has finished shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit ssh.service has finished shutting down.
June 28 16:23:35 BDC2.lyceeader.eu systemd[1]: Starting OpenBSD Secure Shell server...
-- Subject: The unit ssh.service started starting
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit ssh.service started starting.
June 28 16:23:35 BDC2.lyceeader.eu sshd[4391]: Server listening on 0.0.0.0 port 22. June 28 16:23:35
BDC2.lyceeader.eu sshd[4391]: Server listening on :: port 22.
June 28 16:23:35 BDC2.lyceeader.eu systemd[1]: Started OpenBSD Secure Shell server.
-- Subject: The ssh.service unit has finished starting up
Eric
Messages: 29
Registration: March 11, 2018 - 08:22

June 28, 2018 - 6:28 PM

Hello,
I've uninstalled everything and emptied all the tis-sysvol directories, and I'm starting from scratch.

The problem I'm encountering is that when I run `dpkg -i tis-sysvolsync-*.deb`, nothing happens because the package doesn't exist.
I'm using Debian 9 Stretch and Python 2.7.13.

How can I get this super synchronization working?
Thank you for your help,
Eric
Eric
Messages: 29
Registration: March 11, 2018 - 08:22

June 29, 2018 - 6:35 PM

Hello,
I solved my problem. If this can help anyone,

there's an update to the create.sh file. The wget link needs to be adapted to the latest version of Syncthing.

Replace
`wget -O syncthing.tar.gz http://archive.syncthing.net/v0.12.22/s ... .22.tar.gz`

with
`wget -O syncthing.tar.gz https://github.com/syncthing/syncthing/ ... .48.tar.gz`

and it works fine.
Good luck,
Eric
Locked