From 59beb0a6caca334c39c677fe65c93b2d9f51ba7e Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 14 Jun 2010 08:14:19 +0000 Subject: [PATCH] service not in Debian5, only newer Ubuntu, which complains about /etc/init.d/xx --- doc/rpm-build/post_install.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/rpm-build/post_install.php b/doc/rpm-build/post_install.php index 3cc4de3ec9..3610e56980 100755 --- a/doc/rpm-build/post_install.php +++ b/doc/rpm-build/post_install.php @@ -102,9 +102,18 @@ function set_distro_defaults($distro=null) $config['ldap_group_context'] = 'ou=group,$base'; break; case 'debian': - $config['start_db'] = '/usr/sbin/service mysql'; + // service not in Debian5, only newer Ubuntu, which complains about /etc/init.d/xx + if (file_exists('/usr/sbin/service')) + { + $config['start_db'] = '/usr/sbin/service mysql'; + $config['start_webserver'] = '/usr/sbin/service apache2'; + } + else + { + $config['start_db'] = '/etc/init.d/mysql'; + $config['start_webserver'] = '/etc/init.d/apache2'; + } $config['autostart_db'] = '/usr/sbin/update-rc.d mysql defaults'; - $config['start_webserver'] = '/usr/sbin/service apache2'; $config['autostart_webserver'] = '/usr/sbin/update-rc.d apache2 defaults'; break; case 'mandriva':