From f53b418b143b195b76f7c6d6c9047925775f1976 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 30 Dec 2003 14:40:16 +0000 Subject: Use invoke-rc.d (if it exists) to run the init script. --- debian/postinst | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'debian/postinst') diff --git a/debian/postinst b/debian/postinst index af0f8a21c..f3d4cf6d5 100644 --- a/debian/postinst +++ b/debian/postinst @@ -289,7 +289,11 @@ fix_conffile_permissions() { setup_startup() { db_get ssh/run_sshd if [ "$RET" = "false" ] ; then - /etc/init.d/ssh stop 2>&1 >/dev/null + if [ -x /usr/sbin/invoke-rc.d ]; then + invoke-rc.d --quiet ssh stop + else + /etc/init.d/ssh stop + fi touch /etc/ssh/sshd_not_to_be_run else rm -f /etc/ssh/sshd_not_to_be_run 2>/dev/null @@ -298,9 +302,13 @@ setup_startup() { setup_init() { - if [ -e /etc/init.d/ssh ]; then + if [ -x /etc/init.d/ssh ]; then update-rc.d ssh defaults >/dev/null - /etc/init.d/ssh restart + if [ -x /usr/sbin/invoke-rc.d ]; then + invoke-rc.d ssh restart + else + /etc/init.d/ssh restart + fi fi } -- cgit v1.2.3