From c7be859d21006b2f798bc2480970316485fad930 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 19 Aug 2013 13:51:22 -0400 Subject: [PATCH] puppet: Run zephyr_mirror.py via supervisord. (imported from commit 09086a1dd298e7ee9b655ccd6c58ac720bbc7798) --- .../zulip/files/supervisord/conf.d/zmirror.conf | 11 +++++++++++ servers/puppet/modules/zulip/manifests/zmirror.pp | 12 ++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 servers/puppet/modules/zulip/files/supervisord/conf.d/zmirror.conf diff --git a/servers/puppet/modules/zulip/files/supervisord/conf.d/zmirror.conf b/servers/puppet/modules/zulip/files/supervisord/conf.d/zmirror.conf new file mode 100644 index 0000000000..7de224a041 --- /dev/null +++ b/servers/puppet/modules/zulip/files/supervisord/conf.d/zmirror.conf @@ -0,0 +1,11 @@ +[program:zmirror] +command=python /home/humbug/humbug/bots/zephyr_mirror.py --root-path=/home/humbug/ --user=tabbott/extra --enable-log=/home/humbug/all_zephyrs_log --forward-class-messages --enable-log=/home/humbug/logs/mirror-log +priority=200 ; the relative start priority (default 999) +autostart=true ; start at supervisord start (default: true) +autorestart=true ; whether/when to restart (default: unexpected) +stopsignal=TERM ; signal used to kill process (default TERM) +stopwaitsecs=30 ; max num secs to wait b4 SIGKILL (default 10) +user=humbug ; setuid to this UNIX account to run the program +redirect_stderr=true ; redirect proc stderr to stdout (default false) +stdout_logfile=/var/log/humbug/zmirror.log ; stdout log path, NONE for none; default AUTO +environment=HOME="/home/humbug",USER="humbug" diff --git a/servers/puppet/modules/zulip/manifests/zmirror.pp b/servers/puppet/modules/zulip/manifests/zmirror.pp index 43593a01f1..6c579e3c57 100644 --- a/servers/puppet/modules/zulip/manifests/zmirror.pp +++ b/servers/puppet/modules/zulip/manifests/zmirror.pp @@ -1,5 +1,6 @@ class zulip::zmirror { class { 'zulip::base': } + class { 'zulip::supervisor': } $zmirror_packages = [ "cython", "libzephyr-dev", "comerr-dev", "python-dev", "libzephyr4-krb5", "zephyr-clients", "krb5-config", "krb5-user", "krb5-clients", "debathena-kerberos-config", "debathena-zephyr-config"] @@ -12,11 +13,18 @@ class zulip::zmirror { group => "root", source => 'puppet:///modules/zulip/debathena.list', } + file { "/etc/supervisor/conf.d/zmirror.conf": + require => Package[supervisor], + ensure => file, + owner => "root", + group => "root", + mode => 644, + source => "puppet:///modules/zulip/supervisord/conf.d/zmirror.conf", + notify => Service["supervisor"], + } # TODO: Do the rest of our setup, which includes at least: # Building python-zephyr after cloning it from https://github.com/ebroder/python-zephyr # Putting tabbott/extra's keytab on the system at /home/humbug/tabbott.extra.keytab # Setting api/bots/zephyr-mirror-crontab to be the humbug user's crontab - # Running the mirroring bot in a screen session with these arguments: - # /home/humbug/api/bots/zephyr_mirror.py --root-path=/home/humbug/ --user=tabbott/extra --enable-log=/home/humbug/all_zephyrs_log --forward-class-messages }