<commit_before>Contents:

	README: this file
	RUNBOOK:  a list of state descriptions, validations, and remedial actions


	replicate.sh:  the all-singing, all-dancing HA (re)activator
	this installs and sets up the HA function for a controller pair.

	appdcontroller.sh: a file intended to be placed into /etc/init.d to control
	the controller, watchdog, and assassin

	appdcontroller-db.sh: a file intended to be placed into /etc/init.d to control
	the mysql database

	appdynamics-machine-agent.sh: a file to start the machine agent

	assassin.sh:  a script run on a failed-over primary to kill the old primary

	failover.sh:  a script run on a secondary to become the new primary

	install-init.sh:  an installer for the appdcontroller.sh

	uninstall-init.sh:  an uninstaller for the appdcontroller.sh

	watchdog.sh:  run on a secondary to watch the primary and maybe failover

	watchdog.settings.template:  copy this to watchdog.settings to override defaults

	appdservice-root.sh:  a null privilege escalation wrapper

	appdservice-pbrun.sh:  a privilege escalation wrapper around pbrun

	appdservice.c:  a privilege escalation c program

	numa.settings.template: a template file containing numa static node assignments

	numa-patch-controller.sh:  a script to edit numa hooks into controller.sh

	appdcontroller-db.sysconfig: source files for system configuration
	appdcontroller.sysconfig
	appdynamics-machine-agent.sysconfig

	save_mysql_passwd.sh: a script used to obfuscate and save the mysql root password
	getaccess.sh:  a script to extract the access key from a database to set
			up monitoring

	setmonitor.sh:  a script to patch various files to set up controller
			monitoring

	appdstatus.sh: a script to replace 'service appdcontroller status' on 
		systemd machines

Installation notes:
This software is intended to connect the appdynamics controller into linux's
service machinery.  This optionally includes a watchdog process running on the
secondary HA node that will initiate a failover if a failure is detected in
the primary controller or database.

Permissions: 
	If the controller is to be run as a non-root user, part of the 
installation cannot be directly automated, as it involves installing of a 
system service into /etc/init.d and ancillary directories using install-init.sh

Prerequisites:
--------------
	1) Ssh must be installed in such a way that the user the controller is to 
be run as has symmetrical passwordless ssh access.  This is done by generating 
a key pair on each node, and placing the other's public key into the appropriate
authorized_keys file.  in detail, assuming user appduser, node1 and node2

	on node1:

	su - appduser
	mkdir -p .ssh
	ssh-keygen -t rsa -N "" -f .ssh/id_rsa
	scp .ssh/id_rsa.pub node2:/tmp

	on node2:

	su - appduser
	mkdir -p .ssh
	ssh-keygen -t rsa -N "" -f .ssh/id_rsa
	cat /tmp/id_rsa.pub >> .ssh/authorized_keys
	scp .ssh/id_rsa.pub node1:/tmp

	on node1:
	cat /tmp/id_rsa.pub >> ~/.ssh/authorized_keys

All of the above commands may not be needed, and some of them may prompt for a
password.

	2) reliable symmetrical reverse host lookup must be configured.  the best
way is to place the host names into each /etc/hosts file.   reverse DNS adds 
an additional point of failure.  
		a) /etc/nsswitch.conf should have files placed before dns. example:
			hosts:      files dns
		b) /etc/hosts:
			192.168.144.128 host1
			192.168.144.137 host2

	3) each machine must have the root and data directory writable by the 
appropriate appdynamics user:

	ls -lad /opt/AppDynamics/Controller
drwxr-xr-x. 18 appduser users    4096 Jan 26 18:18 /opt/AppDynamics/Controller

	4) the primary controller should be installed as a standalone controller;
the secondary should not be installed at all.

Installation:
-------------
On the primary, unpack the shar file using bash into a directory HA under the 
controller root install subdirectory.

	cd /opt/AppDynamics/Controller<commit_msg>update README.txt for setting permissions on ssh directory<commit_after>Contents:

	README: this file
	RUNBOOK:  a list of state descriptions, validations, and remedial actions


	replicate.sh:  the all-singing, all-dancing HA (re)activator
	this installs and sets up the HA function for a controller pair.

	appdcontroller.sh: a file intended to be placed into /etc/init.d to control
	the controller, watchdog, and assassin

	appdcontroller-db.sh: a file intended to be placed into /etc/init.d to control
	the mysql database

	appdynamics-machine-agent.sh: a file to start the machine agent

	assassin.sh:  a script run on a failed-over primary to kill the old primary

	failover.sh:  a script run on a secondary to become the new primary

	install-init.sh:  an installer for the appdcontroller.sh

	uninstall-init.sh:  an uninstaller for the appdcontroller.sh

	watchdog.sh:  run on a secondary to watch the primary and maybe failover

	watchdog.settings.template:  copy this to watchdog.settings to override defaults

	appdservice-root.sh:  a null privilege escalation wrapper

	appdservice-pbrun.sh:  a privilege escalation wrapper around pbrun

	appdservice.c:  a privilege escalation c program

	numa.settings.template: a template file containing numa static node assignments

	numa-patch-controller.sh:  a script to edit numa hooks into controller.sh

	appdcontroller-db.sysconfig: source files for system configuration
	appdcontroller.sysconfig
	appdynamics-machine-agent.sysconfig

	save_mysql_passwd.sh: a script used to obfuscate and save the mysql root password
	getaccess.sh:  a script to extract the access key from a database to set
			up monitoring

	setmonitor.sh:  a script to patch various files to set up controller
			monitoring

	appdstatus.sh: a script to replace 'service appdcontroller status' on 
		systemd machines

Installation notes:
This software is intended to connect the appdynamics controller into linux's
service machinery.  This optionally includes a watchdog process running on the
secondary HA node that will initiate a failover if a failure is detected in
the primary controller or database.

Permissions: 
	If the controller is to be run as a non-root user, part of the 
installation cannot be directly automated, as it involves installing of a 
system service into /etc/init.d and ancillary directories using install-init.sh

Prerequisites:
--------------
	1) Ssh must be installed in such a way that the user the controller is to 
be run as has symmetrical passwordless ssh access.  This is done by generating 
a key pair on each node, and placing the other's public key into the appropriate
authorized_keys file.  in detail, assuming user appduser, node1 and node2

	on node1:

	su - appduser
	mkdir -p .ssh
	ssh-keygen -t rsa -N "" -f .ssh/id_rsa
	scp .ssh/id_rsa.pub node2:/tmp

	on node2:

	su - appduser
	mkdir -p .ssh
	ssh-keygen -t rsa -N "" -f .ssh/id_rsa
	cat /tmp/id_rsa.pub >> .ssh/authorized_keys
	scp .ssh/id_rsa.pub node1:/tmp

	on node1:
	cat /tmp/id_rsa.pub >> ~/.ssh/authorized_keys

All of the above commands may not be needed, and some of them may prompt for a
password.

Permissions need to be as below:

    chmod 700 .ssh
    chmod 644 .ssh/id_rsa.pub
    chmod 600 .ssh/id_rsa
    chmod 600 .ssh/authorized_keys

To check if the passwordless ssh succeeds test it with the command below.

ssh -oNumberOfPasswordPrompts=0 other_node "echo success"

	2) reliable symmetrical reverse host lookup must be configured.  the best
way is to place the host names into each /etc/hosts file.   reverse DNS adds 
an additional point of failure.  
		a) /etc/nsswitch.conf should have files placed before dns. example:
			hosts:      files dns
		b) /etc/hosts:
			192.168.144.128 host1
			192.168.144.137 host2

	3) each machine must have the root and data directory writable by the 
appropriate appdynamics user:

	ls -lad /opt/AppDynamics/Controller
drwxr-xr-x. 18 appduser users    4096 Jan 26 18:18 /opt/AppDynamics/Controller

	4) the primary controller should be installed as a standalone controller;
the secondary should not be installed at all.

Installation:
-------------
On the primary, unpack the shar file using bash into a directory HA under the 
controller root install subdirectory.

	cd /opt/AppDynamics/Controller
{'fraction_non_alphanumeric': 0.057902403495994174, 'fraction_numerical': 0.013474144209759651, 'mean_word_length': 3.710691823899371, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3331833', 'n_tokens_mistral': 2619, 'n_tokens_neox': 2377, 'n_words': 1104}