summaryrefslogtreecommitdiffstats
path: root/perl-install/services.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-01-20 10:38:36 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-01-20 10:38:36 +0000
commit5e6c3ece2fbf784e7dcf61abc8a4f8ed2886b044 (patch)
tree8e45bf2d09f1ca85c4f142fe33664ed6871bd3b5 /perl-install/services.pm
parent7439b0e43e5cfabfde8833a89d302cce5786fa84 (diff)
downloaddrakx-backup-do-not-use-5e6c3ece2fbf784e7dcf61abc8a4f8ed2886b044.tar
drakx-backup-do-not-use-5e6c3ece2fbf784e7dcf61abc8a4f8ed2886b044.tar.gz
drakx-backup-do-not-use-5e6c3ece2fbf784e7dcf61abc8a4f8ed2886b044.tar.bz2
drakx-backup-do-not-use-5e6c3ece2fbf784e7dcf61abc8a4f8ed2886b044.tar.xz
drakx-backup-do-not-use-5e6c3ece2fbf784e7dcf61abc8a4f8ed2886b044.zip
fix prefix usage
Diffstat (limited to 'perl-install/services.pm')
-rw-r--r--perl-install/services.pm27
1 files changed, 12 insertions, 15 deletions
diff --git a/perl-install/services.pm b/perl-install/services.pm
index 9d5809f9b..c4a2399e3 100644
--- a/perl-install/services.pm
+++ b/perl-install/services.pm
@@ -288,46 +288,43 @@ sub services {
# the following functions are mostly by printer related modules
-#-if we are in an DrakX config
-our $prefix = "";
-
sub restart ($) {
my ($service) = @_;
# Exit silently if the service is not installed
- return 1 if !(-x "$prefix/etc/rc.d/init.d/$service");
- run_program::rooted($prefix, "/etc/rc.d/init.d/$service", "restart");
+ return 1 if !(-x "$::prefix/etc/rc.d/init.d/$service");
+ run_program::rooted($::prefix, "/etc/rc.d/init.d/$service", "restart");
}
sub start ($) {
my ($service) = @_;
# Exit silently if the service is not installed
- return 1 if !(-x "$prefix/etc/rc.d/init.d/$service");
- run_program::rooted($prefix, "/etc/rc.d/init.d/$service", "start");
+ return 1 if !(-x "$::prefix/etc/rc.d/init.d/$service");
+ run_program::rooted($::prefix, "/etc/rc.d/init.d/$service", "start");
return (($? >> 8) != 0) ? 0 : 1;
}
sub start_not_running_service ($) {
my ($service) = @_;
# Exit silently if the service is not installed
- return 1 if !(-x "$prefix/etc/rc.d/init.d/$service");
- run_program::rooted($prefix, "/etc/rc.d/init.d/$service", "status");
+ return 1 if !(-x "$::prefix/etc/rc.d/init.d/$service");
+ run_program::rooted($::prefix, "/etc/rc.d/init.d/$service", "status");
return (($? >> 8) != 0) ? 0 : 1;
}
sub stop ($) {
my ($service) = @_;
# Exit silently if the service is not installed
- return 1 if !(-x "$prefix/etc/rc.d/init.d/$service");
- run_program::rooted($prefix, "/etc/rc.d/init.d/$service", "stop");
+ return 1 if !(-x "$::prefix/etc/rc.d/init.d/$service");
+ run_program::rooted($::prefix, "/etc/rc.d/init.d/$service", "stop");
return (($? >> 8) != 0) ? 0 : 1;
}
sub is_service_running ($) {
my ($service) = @_;
# Exit silently if the service is not installed
- return 0 if !(-x "$prefix/etc/rc.d/init.d/$service");
- run_program::rooted($prefix, "/etc/rc.d/init.d/$service", "status");
+ return 0 if !(-x "$::prefix/etc/rc.d/init.d/$service");
+ run_program::rooted($::prefix, "/etc/rc.d/init.d/$service", "status");
# The exit status is not zero when the service is not running
return (($? >> 8) != 0) ? 0 : 1;
}
@@ -335,7 +332,7 @@ sub is_service_running ($) {
sub starts_on_boot ($) {
my ($service) = @_;
local *F;
- open F, ($::testing ? $prefix : "chroot $prefix/ ") .
+ open F, ($::testing ? $::prefix : "chroot $::prefix/ ") .
"/bin/sh -c \"export LC_ALL=C; /sbin/chkconfig --list $service 2>&1\" |" or
return 0;
while (my $line = <F>) {
@@ -351,7 +348,7 @@ sub starts_on_boot ($) {
sub start_service_on_boot ($) {
my ($service) = @_;
- run_program::rooted($prefix, "/sbin/chkconfig", "--add", $service)
+ run_program::rooted($::prefix, "/sbin/chkconfig", "--add", $service)
or return 0;
return 1;
}