From 8ea0fcfde7a9ea1009f2476057e4a689c5937093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= Date: Thu, 16 Oct 2008 21:15:22 +0000 Subject: [PATCH] add hooks in debconf to create a special user to collect apache logs --- debian/alternc-slave.config | 1 + debian/alternc-slave.postinst | 12 ++++++++++++ debian/alternc-slave.templates | 11 +++++++++++ 3 files changed, 24 insertions(+) diff --git a/debian/alternc-slave.config b/debian/alternc-slave.config index 5bd3c7ee..87e04263 100644 --- a/debian/alternc-slave.config +++ b/debian/alternc-slave.config @@ -164,6 +164,7 @@ db_input low alternc-slave/mysql/client || true db_input low alternc-slave/sql/backup_type || true db_input low alternc-slave/sql/overwrite || true db_input low alternc-slave/monitor_ip || true +db_input low alternc-slave/mergelog-key || true db_go # vim: et sw=4 diff --git a/debian/alternc-slave.postinst b/debian/alternc-slave.postinst index 123b36c0..5cf6f6cc 100644 --- a/debian/alternc-slave.postinst +++ b/debian/alternc-slave.postinst @@ -43,6 +43,18 @@ case "$1" in # ajoute l'user postfix au groupe sasl adduser --quiet postfix sasl + db_get "alternc-slave/mergelog-key" + if [ "X$ret" != "" ]; then + echo "Creating alternc-mergelog account" + adduser --quiet --system --home /var/run/alternc-mergelog --shell /bin/false --ingroup adm alternc-mergelog + if [ ! grep -q "$ret" /var/run/alternc-mergelog/.ssh/authorized_keys ]; then + mkdir -p /var/run/alternc-mergelog/.ssh + echo "$ret" >> /var/run/alternc-mergelog/.ssh/authorized_keys + chown -R alternc-mergelog:adm /var/run/alternc-mergelog/.ssh + chmod -R og-rwx /var/run/alternc-mergelog/.ssh + fi + fi + # corriger les permissions du chroot mkdir -p /var/spool/postfix/var/run/saslauthd || true dpkg-statoverride --quiet --update --add root sasl 710 /var/spool/postfix/var/run/saslauthd || true diff --git a/debian/alternc-slave.templates b/debian/alternc-slave.templates index bc1d0b7b..c1a31ad6 100644 --- a/debian/alternc-slave.templates +++ b/debian/alternc-slave.templates @@ -176,3 +176,14 @@ Type: boolean _Description: Should AlternC remove bind mailboxes ? If you accept all users e-mails will be deleted +Template:alternc-slave/mergelog-key +Type: string +_Description: SSH key of the mergelog server: + + The slave nodes can be configured to accept connexions from a central + server (the mergelog server) that will merge the apache logs from all + the slave servers. + . + To do this, the server needs to have an account created and a public + key. Enter the public key here and the account will be created. If + this field is left empty, no account will be created.