Friday, September 9, 2016

Development In a X Integrated Environment

It's been almost 7.5 years since I last released anything through Open Source development. At that time I was using SourceForge and storing the source code in CVS.

Today I made a comeback. I started a project on GitHub called dixie, which is short for Development In a X Integrated Environment.

It is partially to have a practical task for learning Vagrant, Ansible and Kickstart, but in the end I think it can result in a pretty usable product too.

Using a Windows server as slave node for Hudson

Installed Cygwin64, and on the Select Packages screen I manually had to choose to install openssh and cygrunsrv as they are not picked by default. 

Created local Windows user sshd on SLAVESRV1. Unchecked "Change password at first login". Checked "Password never expires".

Created local Windows user cyg_server on SLAVESRV1. Unchecked "Change password at first login". Checked "Password never expires".

Added local Windows user cyg_server to local Administrators group.

Created local Windows user hudson on SLAVESRV1. Unchecked "Change password at first login". Checked "Password never expires".

Added local hudson Windows user to local 'Remote Desktop Users' group.

Started "Cygwin64 Terminal" with "Run as Administrator"

Initially I had some issue with "/bin/bash: Operation not permitted", but then I found https://cygwin.com/ml/cygwin/2016-03/msg00097.html with a solution:
Edited the file /bin/ssh-host-config, and after the line CSIH_SCRIPT=/usr/share/csih/cygwin-service-installation-helper.sh I added the following:
editrights -a SeAssignPrimaryTokenPrivilege -u cyg_server
editrights -a SeCreateTokenPrivilege -u cyg_server
editrights -a SeTcbPrivilege -u cyg_server
editrights -a SeServiceLogonRight -u cyg_server

Ran the ssh-host-config script
*** Query: you have the required privileges) (yes/no) yes
*** Query: Should StrictModes be used? (yes/no) no
*** Query: Should privilege separation be used? (yes/no) yes
*** Query: (Say "no" if it is already installed as a service) (yes/no) yes
*** Query: Enter the value of CYGWIN for the daemon: [] binmode ntsec
*** Info: 'SLAVESRV1+cyg_server' will only be used by registered services.
*** Query: Do you want to use a different name? (yes/no) no
*** Query: Please enter the password for user 'SLAVESRV1+cyg_server':

Started Windows service 'CYGWIN sshd'

Verified that SSH was started on port 22 with: netstat -an | grep LISTEN

Logged on to Windows as hudson through Remote Desktop

As hudson user started Cygwin. This ensured /home/hudson folder was created.

Now I was finally ready to add the SLAVESRV1 as a node from the Hudson master using the SLAVESRV1+hudson user for SSH connections. It was colleague that discovered that we needed to prefix the user with SLAVESRV1+ since it was a local user and not a domain user.