public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Robin H. Johnson" <robbat2@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/elections:master commit in: /
Date: Fri,  1 Jul 2022 19:12:58 +0000 (UTC)	[thread overview]
Message-ID: <1656702766.6fb33c7d84a6e9fefe03ec6b0af77a01eaf1d421.robbat2@gentoo> (raw)

commit:     6fb33c7d84a6e9fefe03ec6b0af77a01eaf1d421
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  1 19:12:46 2022 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Fri Jul  1 19:12:46 2022 +0000
URL:        https://gitweb.gentoo.org/proj/elections.git/commit/?id=6fb33c7d

infra-schedule-countify-collect: new tool to schedule countify --collect

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 README.md                       | 20 +++++++++++++++++--
 infra-schedule-countify-collect | 44 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index a59ed18..1afdba0 100644
--- a/README.md
+++ b/README.md
@@ -85,8 +85,24 @@ Trustees.
 Just wait. `election-stats-count` runs every 30 minutes by cronjob, and prints
 status files into the home directories of election officials: `voter-turnout-${election_name}`.
 
-4. Close of election:
----------------------
+4.a. Automated "Close of election"
+----------------------------------
+Before the end of the election, run the script to schedule automated
+`countify --collect`:
+```
+$ sudo su
+# cd /etc/elections
+# ./infra-schedule-countify-collect ${election_name}
+````
+
+The job can be verified with:
+```
+# atq
+# at -c $JOB_ID
+```
+
+4.b. Manual "Close of election"
+-------------------------------
 This is the only step where the infra contact is absolutely required.
 The infra contact must run `countify --collect ${election_name}` as root,
 which will write the master ballot & confirmation stub file to all officials:

diff --git a/infra-schedule-countify-collect b/infra-schedule-countify-collect
new file mode 100755
index 0000000..f44f343
--- /dev/null
+++ b/infra-schedule-countify-collect
@@ -0,0 +1,44 @@
+#!/bin/bash
+# This will schedule an at(1) job to run for countify --collect
+# Any special ballots must be in place before the end of the election.
+# Infra needs to run this script, and it will schedule the rest, so infra does
+# NOT need to be on hand at the end closing time.
+election_name=$1
+
+UID=$(id -u)
+if test $UID -ne 0; then
+	echo "You must be root to run this" 1>&2
+	exit 1
+fi
+
+# Find the dir, validate
+for d in /etc/elections/$election_name ./$election_name ; do
+	files=( start stop voters ballot officials )
+	good=1
+	for f in ${files[@]}; do
+		test -e $d/${f}-$election_name || good=0
+	done
+	if test $good -eq 1 ; then
+		export election_dir=$d
+		break
+	fi
+	unset good
+done
+
+if test -z "$election_dir" ; then
+	echo "Could not find election $election_name in /etc/elections" 1>&2
+	exit 1
+fi
+
+stopfile=$election_dir/stop-$election_name
+t=$(date -u +%Y%m%d%H%M.%S -d @$(<$stopfile) )
+
+cd /etc/elections
+unset MAIL PWD SSH_CLIENT SSH_CONNECTION SSH_TTY
+
+at -t $t <<-EOF
+#!/bin/sh
+# This was scheduled by $SUDO_USER at $(date -uR)
+cd /etc/elections
+./countify --collect ${election_name}
+EOF


             reply	other threads:[~2022-07-01 19:13 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-01 19:12 Robin H. Johnson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-06-02  0:13 [gentoo-commits] proj/elections:master commit in: / Robin H. Johnson
2024-05-25 17:14 Robin H. Johnson
2023-04-19 22:28 Robin H. Johnson
2022-07-01 15:50 Robin H. Johnson
2022-06-30 22:36 Robin H. Johnson
2022-06-25 16:31 Robin H. Johnson
2022-06-25 13:58 Jorge Manuel B. S. Vicetto
2021-06-18  6:57 Robin H. Johnson
2021-06-18  6:57 Robin H. Johnson
2020-07-06  5:10 Robin H. Johnson
2020-06-20  5:17 Robin H. Johnson
2020-06-20  5:17 Robin H. Johnson
2017-06-25  0:04 Robin H. Johnson
2017-06-24 23:54 Robin H. Johnson
2016-07-21 18:07 Robin H. Johnson
2016-07-21 18:07 Robin H. Johnson
2016-07-03 15:01 Robin H. Johnson
2016-07-03 11:04 Jorge Manuel B. S. Vicetto
2016-06-19 12:13 Jorge Manuel B. S. Vicetto
2016-06-19 12:13 Jorge Manuel B. S. Vicetto
2016-06-18 17:28 Robin H. Johnson
2016-06-18 17:28 Robin H. Johnson
2016-06-18 17:28 Robin H. Johnson
2016-06-18 17:28 Robin H. Johnson
2015-06-28  0:12 Jorge Manuel B. S. Vicetto
2015-06-27 16:18 Robin H. Johnson
2013-06-30  6:32 Jorge Manuel B. S. Vicetto
2013-02-06  0:09 Jorge Manuel B. S. Vicetto
2012-07-16 19:01 Christian Ruppert
2012-06-18 21:08 Christian Ruppert
2012-02-15  2:07 Robin H. Johnson
2011-06-20  6:14 Robin H. Johnson
2011-06-20  6:13 Robin H. Johnson
2011-06-20  6:13 Robin H. Johnson
2011-06-20  6:13 Robin H. Johnson
2011-06-20  6:13 Robin H. Johnson
2011-06-20  6:08 Robin H. Johnson
2011-06-09  7:46 Robin H. Johnson
2011-04-09  0:09 Robin H. Johnson
2011-03-12 18:41 Robin H. Johnson
2011-03-12 10:57 Robin H. Johnson
2011-03-12 10:56 Robin H. Johnson
2011-02-13  2:21 Robin H. Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1656702766.6fb33c7d84a6e9fefe03ec6b0af77a01eaf1d421.robbat2@gentoo \
    --to=robbat2@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox