"net ads join" fails with "User session deleted" in systemd
Jeremy Allison
jra at samba.org
Wed Jan 16 01:01:46 UTC 2019
On Fri, Jan 11, 2019 at 07:13:50PM +0000, Youzhong Yang wrote:
> Hello Samba gurus,
>
> I am struggling with a net ads join issue.
>
> Here is what I need to do: we use openstack to spawn Debian VM, before handing the VM to user, we need to join it to Windows domain. This needs to be done automatically.
>
> We run the following two commands to do the job:
>
> kinit -k -t /path/to/keytab_file username at DOMAIN
> net ads join --no-dns-updates createcomputer=... -k
>
> If I run the above commands manually (in a terminal window), it works perfectly.
>
> But since we need to run them in an automatic way, so first we tried clound-init, it failed; second we tried to run as a systemd service, the same failure:
>
> Failed to join domain: failed to lookup DC info for domain 'DOMAIN' over rpc: User session deleted
>
> It is definitely not an issue of some system services not ready, because when the host is ready for use, running the above two commands inside systemd produces the same error.
>
> Could someone shed some light on what could be going wrong? By the way, I am running Debian 9.3, the Samba version installed on it is 4.5.12.
Debug logs - set to level 10 and start taking a look.
My naive guess would be a DNS issue, but this is a
stab in the dark.
Jeremy.
More information about the samba-technical
mailing list