From f3669b421cac30e070f6d83739af1b92ff1e5c4d Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 20 May 2016 16:01:30 +0200 Subject: [PATCH] debian: deprecate usage of /etc/init.d/authentic2 manage (fixes #11008) adding a command to /etc/init.d/authentic2 was a bad idea anyway and would force us to use sudo -E so that /etc/default/authentic2 is visible from authentic2-ctl. Also replace cron.hourly files by cron.d files. --- debian-jessie/authentic2-ctl | 4 ++++ debian-jessie/authentic2-multitenant.cron.d | 5 +++++ debian-jessie/authentic2-multitenant.cron.hourly | 4 +--- debian-jessie/authentic2.cron.d | 6 ++++++ debian-jessie/authentic2.cron.hourly | 4 +--- debian-jessie/authentic2.init | 8 -------- debian-wheezy/authentic2-ctl | 4 ++++ debian-wheezy/authentic2-multitenant.cron.d | 5 +++++ debian-wheezy/authentic2-multitenant.cron.hourly | 4 +--- debian-wheezy/authentic2.cron.d | 6 ++++++ debian-wheezy/authentic2.cron.hourly | 4 +--- debian-wheezy/authentic2.init | 8 -------- 12 files changed, 34 insertions(+), 28 deletions(-) create mode 100644 debian-jessie/authentic2-multitenant.cron.d create mode 100644 debian-jessie/authentic2.cron.d create mode 100644 debian-wheezy/authentic2-multitenant.cron.d create mode 100644 debian-wheezy/authentic2.cron.d diff --git a/debian-jessie/authentic2-ctl b/debian-jessie/authentic2-ctl index df6b26c..0143c13 100644 --- a/debian-jessie/authentic2-ctl +++ b/debian-jessie/authentic2-ctl @@ -13,6 +13,10 @@ if [ "$(whoami)" != "authentic" ]; then fi fi +if [ -f /etc/default/authentic2 ]; then + . /etc/default/authentic2 +fi + if [ -f /etc/authentic2/db.conf ]; then . /etc/authentic2/db.conf fi diff --git a/debian-jessie/authentic2-multitenant.cron.d b/debian-jessie/authentic2-multitenant.cron.d new file mode 100644 index 0000000..f824b0e --- /dev/null +++ b/debian-jessie/authentic2-multitenant.cron.d @@ -0,0 +1,5 @@ +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +0 * * * * authentic authentic2-multitenant-manage tenant_command clearsessions --all-tenants +5 * * * * authentic authentic2-multitenant-manage tenant_command cleanupauthentic --all-tenants +10 * * * * authentic authentic2-multitenant-manage tenant_command sync-ldap-users --all-tenants diff --git a/debian-jessie/authentic2-multitenant.cron.hourly b/debian-jessie/authentic2-multitenant.cron.hourly index c89a0e0..c52d3c2 100644 --- a/debian-jessie/authentic2-multitenant.cron.hourly +++ b/debian-jessie/authentic2-multitenant.cron.hourly @@ -1,5 +1,3 @@ #!/bin/sh -authentic2-multitenant-manage tenant_command clearsessions --all-tenants -authentic2-multitenant-manage tenant_command cleanupauthentic --all-tenants -authentic2-multitenant-manage tenant_command sync-ldap-users --all-tenants +exit 0 diff --git a/debian-jessie/authentic2.cron.d b/debian-jessie/authentic2.cron.d new file mode 100644 index 0000000..0521534 --- /dev/null +++ b/debian-jessie/authentic2.cron.d @@ -0,0 +1,6 @@ +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +0 * * * * authentic authentic2-ctl clearsessions +5 * * * * authentic authentic2-ctl cleanupauthentic +10 * * * * authentic authentic2-ctl sync-ldap-users + diff --git a/debian-jessie/authentic2.cron.hourly b/debian-jessie/authentic2.cron.hourly index 39102fa..c52d3c2 100644 --- a/debian-jessie/authentic2.cron.hourly +++ b/debian-jessie/authentic2.cron.hourly @@ -1,5 +1,3 @@ #!/bin/sh -/usr/sbin/service authentic2 manage clearsessions -/usr/sbin/service authentic2 manage cleanupauthentic -/usr/sbin/service authentic2 manage sync-ldap-users +exit 0 diff --git a/debian-jessie/authentic2.init b/debian-jessie/authentic2.init index 71cdbd7..cd7645e 100644 --- a/debian-jessie/authentic2.init +++ b/debian-jessie/authentic2.init @@ -195,14 +195,6 @@ case "$1" in ;; esac ;; - manage) - shift - if [ $(id -un) != "$USER" ]; then - sudo -u $USER -- $MANAGE_SCRIPT "$@" - else - $MANAGE_SCRIPT "$@" - fi - ;; *) echo "Usage: $SCRIPTNAME {start|stop|status|restart|update|reload}" >&2 exit 3 diff --git a/debian-wheezy/authentic2-ctl b/debian-wheezy/authentic2-ctl index df6b26c..0143c13 100644 --- a/debian-wheezy/authentic2-ctl +++ b/debian-wheezy/authentic2-ctl @@ -13,6 +13,10 @@ if [ "$(whoami)" != "authentic" ]; then fi fi +if [ -f /etc/default/authentic2 ]; then + . /etc/default/authentic2 +fi + if [ -f /etc/authentic2/db.conf ]; then . /etc/authentic2/db.conf fi diff --git a/debian-wheezy/authentic2-multitenant.cron.d b/debian-wheezy/authentic2-multitenant.cron.d new file mode 100644 index 0000000..f824b0e --- /dev/null +++ b/debian-wheezy/authentic2-multitenant.cron.d @@ -0,0 +1,5 @@ +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +0 * * * * authentic authentic2-multitenant-manage tenant_command clearsessions --all-tenants +5 * * * * authentic authentic2-multitenant-manage tenant_command cleanupauthentic --all-tenants +10 * * * * authentic authentic2-multitenant-manage tenant_command sync-ldap-users --all-tenants diff --git a/debian-wheezy/authentic2-multitenant.cron.hourly b/debian-wheezy/authentic2-multitenant.cron.hourly index c89a0e0..c52d3c2 100644 --- a/debian-wheezy/authentic2-multitenant.cron.hourly +++ b/debian-wheezy/authentic2-multitenant.cron.hourly @@ -1,5 +1,3 @@ #!/bin/sh -authentic2-multitenant-manage tenant_command clearsessions --all-tenants -authentic2-multitenant-manage tenant_command cleanupauthentic --all-tenants -authentic2-multitenant-manage tenant_command sync-ldap-users --all-tenants +exit 0 diff --git a/debian-wheezy/authentic2.cron.d b/debian-wheezy/authentic2.cron.d new file mode 100644 index 0000000..0521534 --- /dev/null +++ b/debian-wheezy/authentic2.cron.d @@ -0,0 +1,6 @@ +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +0 * * * * authentic authentic2-ctl clearsessions +5 * * * * authentic authentic2-ctl cleanupauthentic +10 * * * * authentic authentic2-ctl sync-ldap-users + diff --git a/debian-wheezy/authentic2.cron.hourly b/debian-wheezy/authentic2.cron.hourly index 39102fa..c52d3c2 100644 --- a/debian-wheezy/authentic2.cron.hourly +++ b/debian-wheezy/authentic2.cron.hourly @@ -1,5 +1,3 @@ #!/bin/sh -/usr/sbin/service authentic2 manage clearsessions -/usr/sbin/service authentic2 manage cleanupauthentic -/usr/sbin/service authentic2 manage sync-ldap-users +exit 0 diff --git a/debian-wheezy/authentic2.init b/debian-wheezy/authentic2.init index 71cdbd7..cd7645e 100644 --- a/debian-wheezy/authentic2.init +++ b/debian-wheezy/authentic2.init @@ -195,14 +195,6 @@ case "$1" in ;; esac ;; - manage) - shift - if [ $(id -un) != "$USER" ]; then - sudo -u $USER -- $MANAGE_SCRIPT "$@" - else - $MANAGE_SCRIPT "$@" - fi - ;; *) echo "Usage: $SCRIPTNAME {start|stop|status|restart|update|reload}" >&2 exit 3 -- 2.1.4