SunCoastConnection / ClaimsToLEHR

Consume X12N837 claims and inject into EMR database.
0 stars 0 forks source link

Implement Gearman worker with remote connections #11

Closed samlikins closed 7 years ago

samlikins commented 7 years ago

Gearman is being used to parallel process claims files across the domain, will need to create a worker script to receive information for a MySQL and SFTP connection, then process the remote (or local) file and cache into remote (or local) database. Additionally test worker management (upstart/restart) with Supervisor as mentioned in Issue-161: Implement Parallel Claims Processing.

samlikins commented 7 years ago

Performed the same setup as mentioned in Issue-161: Implement Parallel Claims Processing, tested and verified dependency packages were installed and referenced correctly. All seems to work so far.

samlikins commented 7 years ago

Performed general repository cleanup of unnecessary files Moved superfluous files out or root directory Created development environment setup script Added Gearman-PHP and PhpSecLib libraries Created migration schema and model for pqrs_import_files database table Added getSubset method to Options class Added getManager method to Database class Created configuration and code for Gearman workers Created Gearman workers script

I ended up needing to update the software for my development evironment (ie: VirtualBox, Vagrent, and Homestead)

samlikins commented 7 years ago

Performing integration testing with Gearman and the workers; I utilized the same test environment to test both sides of the Gearman process.

I installed both Gearman Job Server and Gearman Tools:

$ sudo apt-get install gearman-job-server gearman-tools

I created a password-less SSH login:

$ ssh-copy-id vagrant@localhost

Performed a database migration to add all the needed tables:

$ ./Claims2OEMR/claims2oemr migrate

Generated a credentials files for a test client (placing it in Claims2OEMR/cache/credentials/test.json):

{
    "client": "test",
    "ssh": {
        "host": "127.0.0.1",
        "port": "22",
        "site": "/home/vagrant/ClaimsToOEMR/cache"
    },
    "mysql": {
        "host": "127.0.0.1",
        "port": "3306",
        "database": "homestead",
        "username": "homestead",
        "password": "secret"
    }
}

Started up the workers:

$ ./Claims2OEMR/gearman-workers

Copied two claims files into the X12N837 directory:

$ cp Claims2OEMR/INBOX/ARSP/file1.txt Claims2OEMR/cache/sites/PQRS/X12N837/
$ cp Claims2OEMR/INBOX/ARSP/file2.txt Claims2OEMR/cache/sites/PQRS/X12N837/dir1/

Logged into MySQL and added records to pqrs_import_files for the two claims files:

mysql> INSERT INTO `pqrs_import_files` (`id`, `status`, `relative_path`, `size`, `md5`, `staged_datetime`) VALUES (123, "Staged", "file1.txt", 831, "f34fc1129c1036ee859120e3d894d3d0", NOW());
mysql> INSERT INTO `pqrs_import_files` (`id`, `status`, `relative_path`, `size`, `md5`, `staged_datetime`) VALUES (321, "Staged", "dir1/file2.txt", 981, "f0195f47c841c0497fea45f18bf0de38", NOW());

With the test credentials having the incorrect ssh.site directory path, I processed a claims file:

gearman -b -f importClaims '{"client": "test", "fileId": 123}'

That generated the expected result (an error in the table):

mysql> SELECT * FROM `pqrs_import_files`;
+-----+--------+----------------+------+----------------------------------+---------------------+-----------------+---------------------+---------------+---------------------+--------------------------------------------------------------------------------------------------+---------------------+
| id  | status | relative_path  | size | md5                              | staged_datetime     | queued_datetime | processing_datetime | processing_id | failed_datetime     | failed_reason                                                                                    | completed_datetime  |
+-----+--------+----------------+------+----------------------------------+---------------------+-----------------+---------------------+---------------+---------------------+--------------------------------------------------------------------------------------------------+---------------------+
| 123 | Failed | file1.txt      |  831 | f34fc1129c1036ee859120e3d894d3d0 | 2016-12-21 16:54:54 | NULL            | 2016-12-21 18:29:23 |          NULL | 2016-12-21 18:29:24 | Failed connecting to remote site claims directory: /home/vagrant/ClaimsToOEMR/cache/PQRS/X12N837 | NULL                |
| 321 | Staged | dir1/file2.txt |  981 | f0195f47c841c0497fea45f18bf0de38 | 2016-12-21 16:55:40 | NULL            | NULL                |          NULL | NULL                | NULL                                                                                             | NULL                |
+-----+--------+----------------+------+----------------------------------+---------------------+-----------------+---------------------+---------------+---------------------+--------------------------------------------------------------------------------------------------+---------------------+
2 rows in set (0.00 sec)

I corrected the ssh.site directory path to include the sites directory at the end of the path, and processed both claims files:

$ gearman -b -f importClaims '{"client": "test", "fileId": 123}'
$ gearman -b -f importClaims '{"client": "test", "fileId": 321}'

That generated the expected results (both records completed):

mysql> SELECT * FROM `pqrs_import_files`;
+-----+-----------+----------------+------+----------------------------------+---------------------+-----------------+---------------------+---------------+---------------------+--------------------------------------------------------------------------------------------------+---------------------+
| id  | status    | relative_path  | size | md5                              | staged_datetime     | queued_datetime | processing_datetime | processing_id | failed_datetime     | failed_reason                                                                                    | completed_datetime  |
+-----+-----------+----------------+------+----------------------------------+---------------------+-----------------+---------------------+---------------+---------------------+--------------------------------------------------------------------------------------------------+---------------------+
| 123 | Completed | file1.txt      |  831 | f34fc1129c1036ee859120e3d894d3d0 | 2016-12-21 16:54:54 | NULL            | 2016-12-21 19:21:26 |          NULL | 2016-12-21 18:29:24 | Failed connecting to remote site claims directory: /home/vagrant/ClaimsToOEMR/cache/PQRS/X12N837 | 2016-12-21 19:21:26 |
| 321 | Completed | dir1/file2.txt |  981 | f0195f47c841c0497fea45f18bf0de38 | 2016-12-21 16:55:40 | NULL            | 2016-12-21 19:25:11 |          NULL | NULL                | NULL                                                                                             | 2016-12-21 19:25:12 |
+-----+-----------+----------------+------+----------------------------------+---------------------+-----------------+---------------------+---------------+---------------------+--------------------------------------------------------------------------------------------------+---------------------+
2 rows in set (0.00 sec)

I re-ran the PHP unit tests:

$ ./Claims2OEMR/utilities/phpunit.sh
PHPUnit 5.3.5 by Sebastian Bergmann and contributors.

...............................................................  63 / 255 ( 24%)
............................................................... 126 / 255 ( 49%)
............................................................... 189 / 255 ( 74%)
............................................................... 252 / 255 ( 98%)
...                                                             255 / 255 (100%)

Time: 1.73 minutes, Memory: 8.00MB

OK (255 tests, 314 assertions)

Generating code coverage report in Clover XML format ... done

Generating code coverage report in HTML format ... done

Everything looks good to me!

@aethelwulffe, @leebc any thoughts?!?

leebc commented 7 years ago

Are you ready for me to set you up with an account on the testing system?

I'm not really sure where to start with reviewing this code...

Is there anything in particular you want me to look at?

samlikins commented 7 years ago

The last step is to determine how to install and setup Supervisor.

I followed the Supervisor Installation documentation; as a synopsys, the following are the steps I performed in my test environment:

Install application via setuptools:

$ sudo easy_install supervisor
Searching for supervisor
Best match: supervisor 3.2.0
Adding supervisor 3.2.0 to easy-install.pth file
Installing echo_supervisord_conf script to /usr/local/bin
Installing pidproxy script to /usr/local/bin
Installing supervisorctl script to /usr/local/bin
Installing supervisord script to /usr/local/bin

Using /usr/lib/python2.7/dist-packages
Processing dependencies for supervisor
Finished processing dependencies for supervisor

Display the Supervisor default configuration:

$ echo_supervisord_conf
; Sample supervisor config file.
;
; For more information on the config file, please see:
; http://supervisord.org/configuration.html
;
; Notes:
;  - Shell expansion ("~" or "$HOME") is not supported.  Environment
;    variables can be expanded using this syntax: "%(ENV_HOME)s".
;  - Comments must have a leading space: "a=b ;comment" not "a=b;comment".

[unix_http_server]
file=/tmp/supervisor.sock   ; (the path to the socket file)
;chmod=0700                 ; socket file mode (default 0700)
;chown=nobody:nogroup       ; socket file uid:gid owner
;username=user              ; (default is no username (open server))
;password=123               ; (default is no password (open server))

;[inet_http_server]         ; inet (TCP) server disabled by default
;port=127.0.0.1:9001        ; (ip_address:port specifier, *:port for all iface)
;username=user              ; (default is no username (open server))
;password=123               ; (default is no password (open server))

[supervisord]
logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB        ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10           ; (num of main logfile rotation backups;default 10)
loglevel=info                ; (log level;default info; others: debug,warn,trace)
pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
nodaemon=false               ; (start in foreground if true;default false)
minfds=1024                  ; (min. avail startup file descriptors;default 1024)
minprocs=200                 ; (min. avail process descriptors;default 200)
;umask=022                   ; (process file creation umask;default 022)
;user=chrism                 ; (default is current user, required if root)
;identifier=supervisor       ; (supervisord identifier, default is 'supervisor')
;directory=/tmp              ; (default is not to cd during start)
;nocleanup=true              ; (don't clean up tempfiles at start;default false)
;childlogdir=/tmp            ; ('AUTO' child log dir, default $TEMP)
;environment=KEY="value"     ; (key value pairs to add to environment)
;strip_ansi=false            ; (strip ansi escape codes in logs; def. false)

; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL  for a unix socket
;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket
;username=chris              ; should be same as http_username if set
;password=123                ; should be same as http_password if set
;prompt=mysupervisor         ; cmd line prompt (default "supervisor")
;history_file=~/.sc_history  ; use readline history if available

; The below sample program section shows all possible program subsection values,
; create one or more 'real' program: sections to be able to control them under
; supervisor.

;[program:theprogramname]
;command=/bin/cat              ; the program (relative uses PATH, can take args)
;process_name=%(program_name)s ; process_name expr (default %(program_name)s)
;numprocs=1                    ; number of processes copies to start (def 1)
;directory=/tmp                ; directory to cwd to before exec (def no cwd)
;umask=022                     ; umask for process (default None)
;priority=999                  ; the relative start priority (default 999)
;autostart=true                ; start at supervisord start (default: true)
;startsecs=1                   ; # of secs prog must stay up to be running (def. 1)
;startretries=3                ; max # of serial start failures when starting (default 3)
;autorestart=unexpected        ; when to restart if exited after running (def: unexpected)
;exitcodes=0,2                 ; 'expected' exit codes used with autorestart (default 0,2)
;stopsignal=QUIT               ; signal used to kill process (default TERM)
;stopwaitsecs=10               ; max num secs to wait b4 SIGKILL (default 10)
;stopasgroup=false             ; send stop signal to the UNIX process group (default false)
;killasgroup=false             ; SIGKILL the UNIX process group (def false)
;user=chrism                   ; setuid to this UNIX account to run the program
;redirect_stderr=true          ; redirect proc stderr to stdout (default false)
;stdout_logfile=/a/path        ; stdout log path, NONE for none; default AUTO
;stdout_logfile_maxbytes=1MB   ; max # logfile bytes b4 rotation (default 50MB)
;stdout_logfile_backups=10     ; # of stdout logfile backups (default 10)
;stdout_capture_maxbytes=1MB   ; number of bytes in 'capturemode' (default 0)
;stdout_events_enabled=false   ; emit events on stdout writes (default false)
;stderr_logfile=/a/path        ; stderr log path, NONE for none; default AUTO
;stderr_logfile_maxbytes=1MB   ; max # logfile bytes b4 rotation (default 50MB)
;stderr_logfile_backups=10     ; # of stderr logfile backups (default 10)
;stderr_capture_maxbytes=1MB   ; number of bytes in 'capturemode' (default 0)
;stderr_events_enabled=false   ; emit events on stderr writes (default false)
;environment=A="1",B="2"       ; process environment additions (def no adds)
;serverurl=AUTO                ; override serverurl computation (childutils)

; The below sample eventlistener section shows all possible
; eventlistener subsection values, create one or more 'real'
; eventlistener: sections to be able to handle event notifications
; sent by supervisor.

;[eventlistener:theeventlistenername]
;command=/bin/eventlistener    ; the program (relative uses PATH, can take args)
;process_name=%(program_name)s ; process_name expr (default %(program_name)s)
;numprocs=1                    ; number of processes copies to start (def 1)
;events=EVENT                  ; event notif. types to subscribe to (req'd)
;buffer_size=10                ; event buffer queue size (default 10)
;directory=/tmp                ; directory to cwd to before exec (def no cwd)
;umask=022                     ; umask for process (default None)
;priority=-1                   ; the relative start priority (default -1)
;autostart=true                ; start at supervisord start (default: true)
;startsecs=1                   ; # of secs prog must stay up to be running (def. 1)
;startretries=3                ; max # of serial start failures when starting (default 3)
;autorestart=unexpected        ; autorestart if exited after running (def: unexpected)
;exitcodes=0,2                 ; 'expected' exit codes used with autorestart (default 0,2)
;stopsignal=QUIT               ; signal used to kill process (default TERM)
;stopwaitsecs=10               ; max num secs to wait b4 SIGKILL (default 10)
;stopasgroup=false             ; send stop signal to the UNIX process group (default false)
;killasgroup=false             ; SIGKILL the UNIX process group (def false)
;user=chrism                   ; setuid to this UNIX account to run the program
;redirect_stderr=false         ; redirect_stderr=true is not allowed for eventlisteners
;stdout_logfile=/a/path        ; stdout log path, NONE for none; default AUTO
;stdout_logfile_maxbytes=1MB   ; max # logfile bytes b4 rotation (default 50MB)
;stdout_logfile_backups=10     ; # of stdout logfile backups (default 10)
;stdout_events_enabled=false   ; emit events on stdout writes (default false)
;stderr_logfile=/a/path        ; stderr log path, NONE for none; default AUTO
;stderr_logfile_maxbytes=1MB   ; max # logfile bytes b4 rotation (default 50MB)
;stderr_logfile_backups=10     ; # of stderr logfile backups (default 10)
;stderr_events_enabled=false   ; emit events on stderr writes (default false)
;environment=A="1",B="2"       ; process environment additions
;serverurl=AUTO                ; override serverurl computation (childutils)

; The below sample group section shows all possible group values,
; create one or more 'real' group: sections to create "heterogeneous"
; process groups.

;[group:thegroupname]
;programs=progname1,progname2  ; each refers to 'x' in [program:x] definitions
;priority=999                  ; the relative start priority (default 999)

; The [include] section can just contain the "files" setting.  This
; setting can list multiple files (separated by whitespace or
; newlines).  It can also contain wildcards.  The filenames are
; interpreted as relative to this file.  Included files *cannot*
; include files themselves.

;[include]
;files = relative/directory/*.ini

Based on the init service script (ie: /etc/init.d/supervisor) I located the system config file:

$ cat /etc/supervisor/supervisord.conf
; supervisor config file

[unix_http_server]
file=/var/run/supervisor.sock   ; (the path to the socket file)
chmod=0700                       ; sockef file mode (default 0700)

[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor            ; ('AUTO' child log dir, default $TEMP)

; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL  for a unix socket

; The [include] section can just contain the "files" setting.  This
; setting can list multiple files (separated by whitespace or
; newlines).  It can also contain wildcards.  The filenames are
; interpreted as relative to this file.  Included files *cannot*
; include files themselves.

[include]
files = /etc/supervisor/conf.d/*.conf

I created a Gearman ClaimsToOEMR configuration file:

$ sudo nano /etc/supervisor/conf.d/gearman-claimstooemr.conf
[program:gearman-claimstooemr]
directory=/home/vagrant/ClaimsToOEMR
command=/home/vagrant/ClaimsToOEMR/gearman-workers
autorestart=true
process_name=%(program_name)s-%(process_num)s
numprocs=10

I stopped the Supervisor service and checked the status output:

$ sudo service supervisor stop
$ sudo service supervisor status
● supervisor.service - Supervisor process control system for UNIX
   Loaded: loaded (/lib/systemd/system/supervisor.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Fri 2016-12-23 09:52:40 UTC; 7s ago
     Docs: http://supervisord.org
  Process: 13341 ExecStop=/usr/bin/supervisorctl $OPTIONS shutdown (code=exited, status=0/SUCCESS)
  Process: 13286 ExecStart=/usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf (code=exited, status=0/SUCCESS)
 Main PID: 13286 (code=exited, status=0/SUCCESS)

Dec 23 09:52:40 ClaimsToOEMR supervisord[13286]: 2016-12-23 09:52:40,842 INFO stopped: gearman-claimstooemr-6 (terminated by SIGTERM)
Dec 23 09:52:40 ClaimsToOEMR supervisord[13286]: 2016-12-23 09:52:40,842 INFO stopped: gearman-claimstooemr-7 (terminated by SIGTERM)
Dec 23 09:52:40 ClaimsToOEMR supervisord[13286]: 2016-12-23 09:52:40,842 INFO stopped: gearman-claimstooemr-0 (terminated by SIGTERM)
Dec 23 09:52:40 ClaimsToOEMR supervisord[13286]: 2016-12-23 09:52:40,843 INFO stopped: gearman-claimstooemr-1 (terminated by SIGTERM)
Dec 23 09:52:40 ClaimsToOEMR supervisord[13286]: 2016-12-23 09:52:40,843 INFO stopped: gearman-claimstooemr-2 (terminated by SIGTERM)
Dec 23 09:52:40 ClaimsToOEMR supervisord[13286]: 2016-12-23 09:52:40,843 INFO stopped: gearman-claimstooemr-3 (terminated by SIGTERM)
Dec 23 09:52:40 ClaimsToOEMR supervisord[13286]: 2016-12-23 09:52:40,843 INFO stopped: gearman-claimstooemr-8 (terminated by SIGTERM)
Dec 23 09:52:40 ClaimsToOEMR supervisord[13286]: 2016-12-23 09:52:40,843 INFO stopped: gearman-claimstooemr-9 (terminated by SIGTERM)
Dec 23 09:52:40 ClaimsToOEMR supervisorctl[13341]: Shut down
Dec 23 09:52:40 ClaimsToOEMR systemd[1]: Stopped Supervisor process control system for UNIX.

I ran a test startup to check for errors:

$ sudo /usr/bin/python /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
2016-12-23 09:49:38,097 CRIT Supervisor running as root (no user in config file)
2016-12-23 09:49:38,098 WARN Included extra file "/etc/supervisor/conf.d/gearman-claimstooemr.conf" during parsing
2016-12-23 09:49:38,104 INFO RPC interface 'supervisor' initialized
2016-12-23 09:49:38,104 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2016-12-23 09:49:38,104 INFO supervisord started with pid 13208
2016-12-23 09:49:39,108 INFO spawned: 'gearman-claimstooemr-4' with pid 13211
2016-12-23 09:49:39,114 INFO spawned: 'gearman-claimstooemr-5' with pid 13212
2016-12-23 09:49:39,117 INFO spawned: 'gearman-claimstooemr-6' with pid 13213
2016-12-23 09:49:39,122 INFO spawned: 'gearman-claimstooemr-7' with pid 13214
2016-12-23 09:49:39,125 INFO spawned: 'gearman-claimstooemr-0' with pid 13215
2016-12-23 09:49:39,129 INFO spawned: 'gearman-claimstooemr-1' with pid 13216
2016-12-23 09:49:39,132 INFO spawned: 'gearman-claimstooemr-2' with pid 13217
2016-12-23 09:49:39,136 INFO spawned: 'gearman-claimstooemr-3' with pid 13218
2016-12-23 09:49:39,150 INFO spawned: 'gearman-claimstooemr-8' with pid 13219
2016-12-23 09:49:39,164 INFO spawned: 'gearman-claimstooemr-9' with pid 13220
2016-12-23 09:49:40,175 INFO success: gearman-claimstooemr-4 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-12-23 09:49:40,175 INFO success: gearman-claimstooemr-5 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-12-23 09:49:40,175 INFO success: gearman-claimstooemr-6 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-12-23 09:49:40,175 INFO success: gearman-claimstooemr-7 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-12-23 09:49:40,175 INFO success: gearman-claimstooemr-0 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-12-23 09:49:40,176 INFO success: gearman-claimstooemr-1 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-12-23 09:49:40,176 INFO success: gearman-claimstooemr-2 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-12-23 09:49:40,176 INFO success: gearman-claimstooemr-3 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-12-23 09:49:40,176 INFO success: gearman-claimstooemr-8 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-12-23 09:49:40,176 INFO success: gearman-claimstooemr-9 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Looks good to me, so sent a SIGINT:

^C2016-12-23 09:51:14,740 WARN received SIGINT indicating exit request
2016-12-23 09:51:14,756 INFO waiting for gearman-claimstooemr-4, gearman-claimstooemr-5, gearman-claimstooemr-6, gearman-claimstooemr-7, gearman-claimstooemr-0, gearman-claimstooemr-1, gearman-claimstooemr-2, gearman-claimstooemr-3, gearman-claimstooemr-8, gearman-claimstooemr-9 to die
2016-12-23 09:51:14,757 INFO stopped: gearman-claimstooemr-4 (terminated by SIGTERM)
2016-12-23 09:51:14,757 INFO stopped: gearman-claimstooemr-5 (terminated by SIGTERM)
2016-12-23 09:51:14,757 INFO stopped: gearman-claimstooemr-6 (terminated by SIGTERM)
2016-12-23 09:51:14,758 INFO stopped: gearman-claimstooemr-7 (terminated by SIGTERM)
2016-12-23 09:51:14,758 INFO stopped: gearman-claimstooemr-0 (terminated by SIGTERM)
2016-12-23 09:51:14,758 INFO stopped: gearman-claimstooemr-1 (terminated by SIGTERM)
2016-12-23 09:51:14,758 INFO stopped: gearman-claimstooemr-2 (terminated by SIGTERM)
2016-12-23 09:51:14,758 INFO stopped: gearman-claimstooemr-3 (terminated by SIGTERM)
2016-12-23 09:51:14,759 INFO stopped: gearman-claimstooemr-8 (terminated by SIGTERM)
2016-12-23 09:51:14,759 INFO stopped: gearman-claimstooemr-9 (terminated by SIGTERM)

I started the Supervisor service and checked status:

$ sudo service supervisor start
$ sudo service supervisor status
● supervisor.service - Supervisor process control system for UNIX
   Loaded: loaded (/lib/systemd/system/supervisor.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2016-12-23 09:54:57 UTC; 3s ago
     Docs: http://supervisord.org
  Process: 13341 ExecStop=/usr/bin/supervisorctl $OPTIONS shutdown (code=exited, status=0/SUCCESS)
 Main PID: 13396 (supervisord)
    Tasks: 11
   Memory: 89.5M
      CPU: 412ms
   CGroup: /system.slice/supervisor.service
           ├─13396 /usr/bin/python /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
           ├─13401 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─13402 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─13403 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─13404 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─13405 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─13406 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─13407 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─13408 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─13409 php /home/vagrant/ClaimsToOEMR/gearman-workers
           └─13410 php /home/vagrant/ClaimsToOEMR/gearman-workers

Dec 23 09:54:59 ClaimsToOEMR supervisord[13396]: 2016-12-23 09:54:59,958 INFO success: gearman-claimstooemr-4 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 09:54:59 ClaimsToOEMR supervisord[13396]: 2016-12-23 09:54:59,959 INFO success: gearman-claimstooemr-5 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 09:54:59 ClaimsToOEMR supervisord[13396]: 2016-12-23 09:54:59,960 INFO success: gearman-claimstooemr-6 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 09:54:59 ClaimsToOEMR supervisord[13396]: 2016-12-23 09:54:59,960 INFO success: gearman-claimstooemr-7 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 09:54:59 ClaimsToOEMR supervisord[13396]: 2016-12-23 09:54:59,961 INFO success: gearman-claimstooemr-0 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 09:54:59 ClaimsToOEMR supervisord[13396]: 2016-12-23 09:54:59,962 INFO success: gearman-claimstooemr-1 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 09:54:59 ClaimsToOEMR supervisord[13396]: 2016-12-23 09:54:59,962 INFO success: gearman-claimstooemr-2 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 09:54:59 ClaimsToOEMR supervisord[13396]: 2016-12-23 09:54:59,963 INFO success: gearman-claimstooemr-3 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 09:54:59 ClaimsToOEMR supervisord[13396]: 2016-12-23 09:54:59,963 INFO success: gearman-claimstooemr-8 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 09:54:59 ClaimsToOEMR supervisord[13396]: 2016-12-23 09:54:59,964 INFO success: gearman-claimstooemr-9 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Everything looks to be in good shape, time to restart the system and see if everything takes!

$ sudo service supervisor status
● supervisor.service - Supervisor process control system for UNIX
   Loaded: loaded (/lib/systemd/system/supervisor.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2016-12-23 10:00:01 UTC; 28s ago
     Docs: http://supervisord.org
 Main PID: 1218 (supervisord)
    Tasks: 11
   Memory: 100.7M
      CPU: 629ms
   CGroup: /system.slice/supervisor.service
           ├─1218 /usr/bin/python /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
           ├─1869 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─1870 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─1871 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─1872 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─1873 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─1874 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─1875 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─1876 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─1877 php /home/vagrant/ClaimsToOEMR/gearman-workers
           └─1878 php /home/vagrant/ClaimsToOEMR/gearman-workers

Dec 23 10:00:20 ClaimsToOEMR supervisord[1218]: 2016-12-23 10:00:20,310 INFO success: gearman-claimstooemr-4 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 10:00:20 ClaimsToOEMR supervisord[1218]: 2016-12-23 10:00:20,310 INFO success: gearman-claimstooemr-5 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 10:00:20 ClaimsToOEMR supervisord[1218]: 2016-12-23 10:00:20,310 INFO success: gearman-claimstooemr-6 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 10:00:20 ClaimsToOEMR supervisord[1218]: 2016-12-23 10:00:20,310 INFO success: gearman-claimstooemr-7 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 10:00:20 ClaimsToOEMR supervisord[1218]: 2016-12-23 10:00:20,310 INFO success: gearman-claimstooemr-0 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 10:00:20 ClaimsToOEMR supervisord[1218]: 2016-12-23 10:00:20,310 INFO success: gearman-claimstooemr-1 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 10:00:20 ClaimsToOEMR supervisord[1218]: 2016-12-23 10:00:20,311 INFO success: gearman-claimstooemr-2 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 10:00:20 ClaimsToOEMR supervisord[1218]: 2016-12-23 10:00:20,311 INFO success: gearman-claimstooemr-3 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 10:00:20 ClaimsToOEMR supervisord[1218]: 2016-12-23 10:00:20,311 INFO success: gearman-claimstooemr-8 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 10:00:20 ClaimsToOEMR supervisord[1218]: 2016-12-23 10:00:20,312 INFO success: gearman-claimstooemr-9 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Looks to be running with the correct process count.

Taking a look at supervisorctl:

$ sudo supervisorctl
gearman-claimstooemr:gearman-claimstooemr-0   RUNNING   pid 1873, uptime 0:07:09
gearman-claimstooemr:gearman-claimstooemr-1   RUNNING   pid 1874, uptime 0:07:09
gearman-claimstooemr:gearman-claimstooemr-2   RUNNING   pid 1875, uptime 0:07:09
gearman-claimstooemr:gearman-claimstooemr-3   RUNNING   pid 1876, uptime 0:07:09
gearman-claimstooemr:gearman-claimstooemr-4   RUNNING   pid 1869, uptime 0:07:09
gearman-claimstooemr:gearman-claimstooemr-5   RUNNING   pid 1870, uptime 0:07:09
gearman-claimstooemr:gearman-claimstooemr-6   RUNNING   pid 1871, uptime 0:07:09
gearman-claimstooemr:gearman-claimstooemr-7   RUNNING   pid 1872, uptime 0:07:09
gearman-claimstooemr:gearman-claimstooemr-8   RUNNING   pid 1877, uptime 0:07:09
gearman-claimstooemr:gearman-claimstooemr-9   RUNNING   pid 1878, uptime 0:07:09
supervisor> version
3.2.0
supervisor> avail
gearman-claimstooemr:gearman-claimstooemr-0 in use    auto      999:999
gearman-claimstooemr:gearman-claimstooemr-1 in use    auto      999:999
gearman-claimstooemr:gearman-claimstooemr-2 in use    auto      999:999
gearman-claimstooemr:gearman-claimstooemr-3 in use    auto      999:999
gearman-claimstooemr:gearman-claimstooemr-4 in use    auto      999:999
gearman-claimstooemr:gearman-claimstooemr-5 in use    auto      999:999
gearman-claimstooemr:gearman-claimstooemr-6 in use    auto      999:999
gearman-claimstooemr:gearman-claimstooemr-7 in use    auto      999:999
gearman-claimstooemr:gearman-claimstooemr-8 in use    auto      999:999
gearman-claimstooemr:gearman-claimstooemr-9 in use    auto      999:999
supervisor> maintail
04 INFO spawned: 'gearman-claimstooemr-3' with pid 1876
2016-12-23 10:00:19,305 INFO spawned: 'gearman-claimstooemr-8' with pid 1877
2016-12-23 10:00:19,307 INFO spawned: 'gearman-claimstooemr-9' with pid 1878
2016-12-23 10:00:20,310 INFO success: gearman-claimstooemr-4 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-12-23 10:00:20,310 INFO success: gearman-claimstooemr-5 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-12-23 10:00:20,310 INFO success: gearman-claimstooemr-6 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-12-23 10:00:20,310 INFO success: gearman-claimstooemr-7 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-12-23 10:00:20,310 INFO success: gearman-claimstooemr-0 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-12-23 10:00:20,310 INFO success: gearman-claimstooemr-1 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-12-23 10:00:20,311 INFO success: gearman-claimstooemr-2 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-12-23 10:00:20,311 INFO success: gearman-claimstooemr-3 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-12-23 10:00:20,311 INFO success: gearman-claimstooemr-8 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-12-23 10:00:20,312 INFO success: gearman-claimstooemr-9 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

supervisor> exit

Everything is looking in tip top shape, time to script the install process.

aethelwulffe commented 7 years ago

Looks like the script should be trivial after documenting all this. Can the install script be written to provide a tail report file (log), or would that never be needed?

samlikins commented 7 years ago

@aethelwulffe: a log file is handled by Supervisor, defaultly in my install at /var/log/supervisor/supervisord.log, any additional logs can be determined as we get things moving.

samlikins commented 7 years ago

Added the following to the utilities/vagrant/after.sh script:

echo "## Installing dependent Python packages"
sudo easy_install supervisor

echo "## Configuring Supervisor Gearman initialization settings"
sudo bash -c "cat > /etc/supervisor/conf.d/gearman-claimstooemr.conf" << EOL
[program:gearman-claimstooemr]
directory=/home/vagrant/ClaimsToOEMR
command=/home/vagrant/ClaimsToOEMR/gearman-workers
autorestart=true
process_name=%(program_name)s-%(process_num)s
numprocs=10
EOL

echo "## Restarting Supervisor service"
sudo service supervisor restart

Destroying development environment:

$ vagrant destroy
    ClaimsToOEMR: Are you sure you want to destroy the 'ClaimsToOEMR' VM? [y/N] y
==> ClaimsToOEMR: Discarding saved state of VM...
==> ClaimsToOEMR: Destroying VM and associated drives...

Recreating and provisioning new development environment:

$ vagrant up
Bringing machine 'ClaimsToOEMR' up with 'virtualbox' provider...
==> ClaimsToOEMR: Importing base box 'laravel/homestead'...
==> ClaimsToOEMR: Matching MAC address for NAT networking...
==> ClaimsToOEMR: Checking if box 'laravel/homestead' is up to date...
==> ClaimsToOEMR: Setting the name of the VM: ClaimsToOEMR
==> ClaimsToOEMR: Clearing any previously set network interfaces...
==> ClaimsToOEMR: Preparing network interfaces based on configuration...
    ClaimsToOEMR: Adapter 1: nat
    ClaimsToOEMR: Adapter 2: hostonly
==> ClaimsToOEMR: Forwarding ports...
    ClaimsToOEMR: 80 (guest) => 8000 (host) (adapter 1)
    ClaimsToOEMR: 443 (guest) => 44300 (host) (adapter 1)
    ClaimsToOEMR: 3306 (guest) => 33060 (host) (adapter 1)
    ClaimsToOEMR: 5432 (guest) => 54320 (host) (adapter 1)
    ClaimsToOEMR: 22 (guest) => 2222 (host) (adapter 1)
==> ClaimsToOEMR: Running 'pre-boot' VM customizations...
==> ClaimsToOEMR: Booting VM...
==> ClaimsToOEMR: Waiting for machine to boot. This may take a few minutes...
    ClaimsToOEMR: SSH address: 127.0.0.1:2222
    ClaimsToOEMR: SSH username: vagrant
    ClaimsToOEMR: SSH auth method: private key
    ClaimsToOEMR: Warning: Remote connection disconnect. Retrying...
    ClaimsToOEMR: 
    ClaimsToOEMR: Vagrant insecure key detected. Vagrant will automatically replace
    ClaimsToOEMR: this with a newly generated keypair for better security.
    ClaimsToOEMR: 
    ClaimsToOEMR: Inserting generated public key within guest...
    ClaimsToOEMR: Removing insecure key from the guest if it's present...
    ClaimsToOEMR: Key inserted! Disconnecting and reconnecting using new SSH key...
==> ClaimsToOEMR: Machine booted and ready!
==> ClaimsToOEMR: Checking for guest additions in VM...
==> ClaimsToOEMR: Setting hostname...
==> ClaimsToOEMR: Configuring and enabling network interfaces...
==> ClaimsToOEMR: Mounting shared folders...
    ClaimsToOEMR: /vagrant => /opt/gitrepo/Clients/SunCoast Connection/ClaimsToOEMR
    ClaimsToOEMR: /home/vagrant/ClaimsToOEMR => /opt/gitrepo/Clients/SunCoast Connection/ClaimsToOEMR
==> ClaimsToOEMR: Running provisioner: shell...
    ClaimsToOEMR: Running: inline script
==> ClaimsToOEMR: 
==> ClaimsToOEMR: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwhkjaVCo+10LzuJ5FCwTCNpu6kGKumT8fuwCJmk3QPcZpDC7HHMidaIuqlqnAvA7ggeCrIBnfm+RVtlXSJpuREl1blVrG3PUE9+FTYWhW4PibA0uP0brUqPkq+YAfc4Q2YYrWsHSynPdp7WxxJAIhIN6SaDsHm6GT6kMHCKCsvpeqrteK0huNF2tttDk0oQzWQR7Q0W0ItkymB44buzL3sEKDjMA1tSlbQgBXQ2/jxhePfdrvPwcPZxlKBgIMDRXBG3UeuCu6r/4X74hiEm2erWBcts1h5owB9AEVXjPdwFRo2eihcG7PTdPE641dNjrEm0QetxF2z5ZdAtKB4BHj slikins@ih-s76kudu
==> ClaimsToOEMR: Running provisioner: shell...
    ClaimsToOEMR: Running: inline script
==> ClaimsToOEMR: Running provisioner: shell...
    ClaimsToOEMR: Running: /tmp/vagrant-shell20161223-31740-17z4b8g.sh
==> ClaimsToOEMR: Running provisioner: shell...
    ClaimsToOEMR: Running: script: Creating Site: claimstooemr.homestead
==> ClaimsToOEMR: Running provisioner: shell...
    ClaimsToOEMR: Running: script: Restarting Nginx
==> ClaimsToOEMR: Running provisioner: shell...
    ClaimsToOEMR: Running: script: Creating MySQL Database
==> ClaimsToOEMR: Running provisioner: shell...
    ClaimsToOEMR: Running: script: Creating Postgres Database
==> ClaimsToOEMR: Running provisioner: shell...
    ClaimsToOEMR: Running: script: Clear Variables
==> ClaimsToOEMR: Running provisioner: shell...
    ClaimsToOEMR: Running: script: Update Composer
==> ClaimsToOEMR: Updating to version 1.2.4 (stable channel).
==> ClaimsToOEMR:     Downloading: Connecting...
==> ClaimsToOEMR: 
==> ClaimsToOEMR:     Downloading: 100%
==> ClaimsToOEMR:          
==> ClaimsToOEMR: 
==> ClaimsToOEMR: Use composer self-update --rollback to return to version 1.2.3
==> ClaimsToOEMR: Running provisioner: shell...
    ClaimsToOEMR: Running: /tmp/vagrant-shell20161223-31740-u902w0.sh
==> ClaimsToOEMR: ## Vagrant post install script...
==> ClaimsToOEMR: ## Enabling XDebug PHP Module
==> ClaimsToOEMR: ## Refreshing the system packages
==> ClaimsToOEMR: Hit:1 http://ppa.launchpad.net/chris-lea/redis-server/ubuntu xenial InRelease
==> ClaimsToOEMR: Get:2 http://dl.hhvm.com/ubuntu xenial InRelease [2,106 B]
==> ClaimsToOEMR: Hit:3 http://ppa.launchpad.net/nginx/development/ubuntu xenial InRelease
==> ClaimsToOEMR: Hit:4 http://us.archive.ubuntu.com/ubuntu xenial InRelease
==> ClaimsToOEMR: Get:5 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
==> ClaimsToOEMR: Get:6 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease [23.9 kB]
==> ClaimsToOEMR: Get:7 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
==> ClaimsToOEMR: Get:8 http://dl.hhvm.com/ubuntu xenial/main amd64 Packages [1,769 B]
==> ClaimsToOEMR: Get:9 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
==> ClaimsToOEMR: Get:10 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 Packages [42.5 kB]
==> ClaimsToOEMR: Get:11 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [444 kB]
==> ClaimsToOEMR: Get:12 https://deb.nodesource.com/node_6.x xenial InRelease [3,914 B]
==> ClaimsToOEMR: Get:13 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [195 kB]
==> ClaimsToOEMR: Get:14 https://deb.nodesource.com/node_6.x xenial/main Sources [766 B]
==> ClaimsToOEMR: Get:15 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main i386 Packages [42.5 kB]
==> ClaimsToOEMR: Get:16 https://deb.nodesource.com/node_6.x xenial/main amd64 Packages [960 B]
==> ClaimsToOEMR: Get:17 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main Translation-en [24.5 kB]
==> ClaimsToOEMR: Get:18 https://deb.nodesource.com/node_6.x xenial/main i386 Packages [960 B]
==> ClaimsToOEMR: Get:19 http://packages.blackfire.io/debian any InRelease [23.3 kB]
==> ClaimsToOEMR: Get:20 http://us.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages [436 kB]
==> ClaimsToOEMR: Get:21 http://security.ubuntu.com/ubuntu xenial-security/main i386 Packages [189 kB]
==> ClaimsToOEMR: Get:22 http://us.archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [173 kB]
==> ClaimsToOEMR: Get:23 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [370 kB]
==> ClaimsToOEMR: Get:24 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [81.0 kB]
==> ClaimsToOEMR: Get:25 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [66.1 kB]
==> ClaimsToOEMR: Get:26 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [367 kB]
==> ClaimsToOEMR: Get:27 http://security.ubuntu.com/ubuntu xenial-security/universe i386 Packages [63.8 kB]
==> ClaimsToOEMR: Get:28 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [136 kB]
==> ClaimsToOEMR: Get:29 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [36.4 kB]
==> ClaimsToOEMR: Get:30 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [2,756 B]
==> ClaimsToOEMR: Get:31 http://security.ubuntu.com/ubuntu xenial-security/multiverse i386 Packages [2,928 B]
==> ClaimsToOEMR: Get:32 http://us.archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [7,376 B]
==> ClaimsToOEMR: Get:33 http://packages.blackfire.io/debian any/main amd64 Packages [1,221 B]
==> ClaimsToOEMR: Get:34 http://us.archive.ubuntu.com/ubuntu xenial-updates/multiverse i386 Packages [6,172 B]
==> ClaimsToOEMR: Get:35 http://us.archive.ubuntu.com/ubuntu xenial-updates/multiverse Translation-en [3,080 B]
==> ClaimsToOEMR: Get:36 http://packages.blackfire.io/debian any/main i386 Packages [1,225 B]
==> ClaimsToOEMR: Fetched 3,055 kB in 4s (704 kB/s)
==> ClaimsToOEMR: Reading package lists...
==> ClaimsToOEMR: Reading package lists...
==> ClaimsToOEMR: Building dependency tree...
==> ClaimsToOEMR: Reading state information...
==> ClaimsToOEMR: Calculating upgrade...
==> ClaimsToOEMR: The following packages have been kept back:
==> ClaimsToOEMR:   hhvm
==> ClaimsToOEMR: The following packages will be upgraded:
==> ClaimsToOEMR:   apport apt apt-transport-https apt-utils blackfire-agent
==> ClaimsToOEMR:   cloud-initramfs-copymods cloud-initramfs-dyn-netconf dh-php ghostscript
==> ClaimsToOEMR:   grub-legacy-ec2 ifupdown initramfs-tools initramfs-tools-bin
==> ClaimsToOEMR:   initramfs-tools-core isc-dhcp-client isc-dhcp-common libapt-inst2.0
==> ClaimsToOEMR:   libapt-pkg5.0 libc-bin libc-dev-bin libc6 libc6-dev libgs9 libgs9-common
==> ClaimsToOEMR:   liblxc1 libpam-systemd libprocps4 libssl-dev libsystemd0 libudev1 libxml2
==> ClaimsToOEMR:   linux-firmware linux-libc-dev locales lxc-common lxcfs multiarch-support
==> ClaimsToOEMR:   nodejs open-iscsi openssl overlayroot php-common php-igbinary php-json
==> ClaimsToOEMR:   php-msgpack php7.0-common php7.0-json php7.1-bcmath php7.1-cli php7.1-common
==> ClaimsToOEMR:   php7.1-curl php7.1-dev php7.1-fpm php7.1-gd php7.1-imap php7.1-intl
==> ClaimsToOEMR:   php7.1-json php7.1-mbstring php7.1-mysql php7.1-opcache php7.1-pgsql
==> ClaimsToOEMR:   php7.1-readline php7.1-soap php7.1-sqlite3 php7.1-xml php7.1-zip procps
==> ClaimsToOEMR:   python3-apport python3-distupgrade python3-problem-report
==> ClaimsToOEMR:   python3-software-properties snapd software-properties-common systemd
==> ClaimsToOEMR:   systemd-sysv tzdata ubuntu-release-upgrader-core udev
==> ClaimsToOEMR: 78 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
==> ClaimsToOEMR: Need to get 92.0 MB of archives.
==> ClaimsToOEMR: After this operation, 101 kB disk space will be freed.
==> ClaimsToOEMR: Do you want to continue? [Y/n] Abort.
==> ClaimsToOEMR: ## Installing dependent system packages
==> ClaimsToOEMR: Reading package lists...
==> ClaimsToOEMR: Building dependency tree...
==> ClaimsToOEMR: Reading state information...
==> ClaimsToOEMR: The following additional packages will be installed:
==> ClaimsToOEMR:   libgearman8 libhiredis0.13
==> ClaimsToOEMR: The following NEW packages will be installed:
==> ClaimsToOEMR:   gearman-job-server gearman-tools libgearman8 libhiredis0.13
==> ClaimsToOEMR: 0 upgraded, 4 newly installed, 0 to remove and 79 not upgraded.
==> ClaimsToOEMR: Need to get 374 kB of archives.
==> ClaimsToOEMR: After this operation, 905 kB of additional disk space will be used.
==> ClaimsToOEMR: Get:1 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 libhiredis0.13 amd64 0.13.3-2 [25.0 kB]
==> ClaimsToOEMR: Get:2 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 gearman-job-server amd64 1.1.13-1+deb.sury.org~xenial+4 [160 kB]
==> ClaimsToOEMR: Get:3 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 libgearman8 amd64 1.1.13-1+deb.sury.org~xenial+4 [109 kB]
==> ClaimsToOEMR: Get:4 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 gearman-tools amd64 1.1.13-1+deb.sury.org~xenial+4 [80.5 kB]
==> ClaimsToOEMR: dpkg-preconfigure: unable to re-open stdin: No such file or directory
==> ClaimsToOEMR: Fetched 374 kB in 1s (340 kB/s)
==> ClaimsToOEMR: Selecting previously unselected package libhiredis0.13:amd64.
==> ClaimsToOEMR: (Reading database ... 
==> ClaimsToOEMR: (Reading database ... 5%
==> ClaimsToOEMR: (Reading database ... 10%
==> ClaimsToOEMR: (Reading database ... 15%
==> ClaimsToOEMR: (Reading database ... 20%
==> ClaimsToOEMR: (Reading database ... 25%
==> ClaimsToOEMR: (Reading database ... 30%
==> ClaimsToOEMR: (Reading database ... 35%
==> ClaimsToOEMR: (Reading database ... 40%
==> ClaimsToOEMR: (Reading database ... 45%
==> ClaimsToOEMR: (Reading database ... 50%
==> ClaimsToOEMR: (Reading database ... 55%
==> ClaimsToOEMR: (Reading database ... 60%
==> ClaimsToOEMR: (Reading database ... 65%
==> ClaimsToOEMR: (Reading database ... 70%
==> ClaimsToOEMR: (Reading database ... 75%
==> ClaimsToOEMR: (Reading database ... 80%
==> ClaimsToOEMR: (Reading database ... 85%
==> ClaimsToOEMR: (Reading database ... 90%
==> ClaimsToOEMR: (Reading database ... 95%
==> ClaimsToOEMR: (Reading database ... 100%
==> ClaimsToOEMR: (Reading database ... 
==> ClaimsToOEMR: 90291 files and directories currently installed.)
==> ClaimsToOEMR: Preparing to unpack .../libhiredis0.13_0.13.3-2_amd64.deb ...
==> ClaimsToOEMR: Unpacking libhiredis0.13:amd64 (0.13.3-2) ...
==> ClaimsToOEMR: Selecting previously unselected package gearman-job-server.
==> ClaimsToOEMR: Preparing to unpack .../gearman-job-server_1.1.13-1+deb.sury.org~xenial+4_amd64.deb ...
==> ClaimsToOEMR: Unpacking gearman-job-server (1.1.13-1+deb.sury.org~xenial+4) ...
==> ClaimsToOEMR: Selecting previously unselected package libgearman8:amd64.
==> ClaimsToOEMR: Preparing to unpack .../libgearman8_1.1.13-1+deb.sury.org~xenial+4_amd64.deb ...
==> ClaimsToOEMR: Unpacking libgearman8:amd64 (1.1.13-1+deb.sury.org~xenial+4) ...
==> ClaimsToOEMR: Selecting previously unselected package gearman-tools.
==> ClaimsToOEMR: Preparing to unpack .../gearman-tools_1.1.13-1+deb.sury.org~xenial+4_amd64.deb ...
==> ClaimsToOEMR: Unpacking gearman-tools (1.1.13-1+deb.sury.org~xenial+4) ...
==> ClaimsToOEMR: Processing triggers for libc-bin (2.23-0ubuntu4) ...
==> ClaimsToOEMR: Processing triggers for systemd (229-4ubuntu12) ...
==> ClaimsToOEMR: Processing triggers for ureadahead (0.100.0-19) ...
==> ClaimsToOEMR: Processing triggers for man-db (2.7.5-1) ...
==> ClaimsToOEMR: Setting up libhiredis0.13:amd64 (0.13.3-2) ...
==> ClaimsToOEMR: Setting up gearman-job-server (1.1.13-1+deb.sury.org~xenial+4) ...
==> ClaimsToOEMR: Setting up libgearman8:amd64 (1.1.13-1+deb.sury.org~xenial+4) ...
==> ClaimsToOEMR: Setting up gearman-tools (1.1.13-1+deb.sury.org~xenial+4) ...
==> ClaimsToOEMR: Processing triggers for libc-bin (2.23-0ubuntu4) ...
==> ClaimsToOEMR: Processing triggers for systemd (229-4ubuntu12) ...
==> ClaimsToOEMR: Processing triggers for ureadahead (0.100.0-19) ...
==> ClaimsToOEMR: ## Installing dependent Python packages
==> ClaimsToOEMR: Searching for supervisor
==> ClaimsToOEMR: Best match: supervisor 3.2.0
==> ClaimsToOEMR: Adding supervisor 3.2.0 to easy-install.pth file
==> ClaimsToOEMR: Installing echo_supervisord_conf script to /usr/local/bin
==> ClaimsToOEMR: Installing pidproxy script to /usr/local/bin
==> ClaimsToOEMR: Installing supervisorctl script to /usr/local/bin
==> ClaimsToOEMR: Installing supervisord script to /usr/local/bin
==> ClaimsToOEMR: 
==> ClaimsToOEMR: Using /usr/lib/python2.7/dist-packages
==> ClaimsToOEMR: Processing dependencies for supervisor
==> ClaimsToOEMR: Finished processing dependencies for supervisor
==> ClaimsToOEMR: ## Configuring Supervisor Gearman initialization settings
==> ClaimsToOEMR: ## Restarting Supervisor service

Looks like everything went off without a hitch!

Verifying running Supervisor service and processes:

$ vagrant ssh
Welcome to Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-51-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

78 packages can be updated.
13 updates are security updates.

$ sudo service supervisor status
● supervisor.service - Supervisor process control system for UNIX
   Loaded: loaded (/lib/systemd/system/supervisor.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2016-12-23 10:51:12 UTC; 2min 2s ago
     Docs: http://supervisord.org
  Process: 3318 ExecStop=/usr/bin/supervisorctl $OPTIONS shutdown (code=exited, status=0/SUCCESS)
 Main PID: 3322 (supervisord)
    Tasks: 11
   Memory: 89.5M
      CPU: 448ms
   CGroup: /system.slice/supervisor.service
           ├─3322 /usr/bin/python /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
           ├─3336 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─3337 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─3338 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─3339 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─3340 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─3341 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─3342 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─3343 php /home/vagrant/ClaimsToOEMR/gearman-workers
           ├─3344 php /home/vagrant/ClaimsToOEMR/gearman-workers
           └─3345 php /home/vagrant/ClaimsToOEMR/gearman-workers

Dec 23 10:51:14 ClaimsToOEMR supervisord[3322]: 2016-12-23 10:51:14,726 INFO success: gearman-claimstooemr-4 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 10:51:14 ClaimsToOEMR supervisord[3322]: 2016-12-23 10:51:14,727 INFO success: gearman-claimstooemr-5 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 10:51:14 ClaimsToOEMR supervisord[3322]: 2016-12-23 10:51:14,728 INFO success: gearman-claimstooemr-6 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 10:51:14 ClaimsToOEMR supervisord[3322]: 2016-12-23 10:51:14,728 INFO success: gearman-claimstooemr-7 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 10:51:14 ClaimsToOEMR supervisord[3322]: 2016-12-23 10:51:14,729 INFO success: gearman-claimstooemr-0 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 10:51:14 ClaimsToOEMR supervisord[3322]: 2016-12-23 10:51:14,730 INFO success: gearman-claimstooemr-1 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 10:51:14 ClaimsToOEMR supervisord[3322]: 2016-12-23 10:51:14,730 INFO success: gearman-claimstooemr-2 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 10:51:14 ClaimsToOEMR supervisord[3322]: 2016-12-23 10:51:14,731 INFO success: gearman-claimstooemr-3 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 10:51:14 ClaimsToOEMR supervisord[3322]: 2016-12-23 10:51:14,732 INFO success: gearman-claimstooemr-8 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Dec 23 10:51:14 ClaimsToOEMR supervisord[3322]: 2016-12-23 10:51:14,732 INFO success: gearman-claimstooemr-9 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Looks to me to be working!

samlikins commented 7 years ago

@leebc:

Nothing in particular, just thought we were going with a peer-review method, didn't want to make a mess again. Plus, since you're handling the provisioning of the testing and production systems, I though it reasonable to keep you in the loop of new/additional system components. Any questions, I got answers:exclamation:

samlikins commented 7 years ago

Branch Issue-11 merged into master