summaryrefslogtreecommitdiff
path: root/Init
diff options
context:
space:
mode:
authorcarlosg <carlosg>2007-09-25 23:43:27 +0000
committercarlosg <carlosg>2007-09-25 23:43:27 +0000
commit33d8edebe4960812093255b3bc1669cc2d014f38 (patch)
tree81eba2d99dfbb35c63b018146481c389abe7ce08 /Init
parentef2925c8d159d1a33ccb0d2e68b102515f295287 (diff)
2007-09-26 Carlos Garnacho <carlosg@gnome.org>
Add support for Archlinux to UsersConfig and ServicesConfig. patch provided by Ermanno Scaglione <e.scaglione@arcor.de> * Users/Users.pm (add_user): Archlinux prefers useradd. * Init/Services.pm (get_runlevels) (set_archlinux_service_status) (get_rcng_service_info) (run_rcng_script): Fixes for rcng/archlinux init.
Diffstat (limited to 'Init')
-rw-r--r--Init/Services.pm17
1 files changed, 9 insertions, 8 deletions
diff --git a/Init/Services.pm b/Init/Services.pm
index 8c532ba..675262f 100644
--- a/Init/Services.pm
+++ b/Init/Services.pm
@@ -52,6 +52,7 @@ sub get_runlevels
"vine-3.0" => "redhat-6.2",
"slackware-9.1.0" => "freebsd-5",
"gentoo" => "gentoo",
+ "archlinux" => "freebsd-5",
"freebsd-5" => "freebsd-5",
"solaris-2.11" => "freebsd-5",
);
@@ -846,7 +847,7 @@ sub get_rcng_status_by_service
# This is the only difference between rcNG and archlinux
if ($Utils::Backend::tool{"platform"} eq "archlinux")
{
- return &Utils::File::exists ("/var/run/daemons/$service");
+ return &Utils::File::exists ("/var/run/daemons/$service");
}
else
{
@@ -882,7 +883,7 @@ sub get_rcng_service_info
push @runlevels, [ "default", $SERVICE_STOP, 0 ];
}
- return ($script, $runlevels);
+ return ($script, \@runlevels);
}
sub get_rcng_services
@@ -910,13 +911,13 @@ sub run_rcng_script
if (!&Utils::File::run ("/etc/rc.d/$service $arg"))
{
- &Utils::File::do_report ("service_sysv_op_success", $service, $arg);
- &Utils::File::leave ();
+ &Utils::Report::do_report ("service_sysv_op_success", $service, $arg);
+ &Utils::Report::leave ();
return 0;
}
- &Utils::File::do_report ("service_sysv_op_failed", $service, $arg);
- &Utils::File::leave ();
+ &Utils::Report::do_report ("service_sysv_op_failed", $service, $arg);
+ &Utils::Report::leave ();
return -1;
}
@@ -977,8 +978,8 @@ sub set_archlinux_service_status
my ($script, $active) = @_;
my $rcconf = '/etc/rc.conf';
my ($daemons);
-
$daemons = &Utils::Parse::get_sh ($rcconf, "DAEMONS");
+ $daemons =~ s/[()]//;
if (($daemons =~ m/$script/) && !$active)
{
@@ -989,7 +990,7 @@ sub set_archlinux_service_status
$daemons =~ s/network/network $script/g;
}
- &Utils::Replace::set_sh ($rcconf, "DAEMONS", $daemons);
+ &Utils::Replace::set_sh ($rcconf, "DAEMONS", "($daemons)", 1);
&run_rcng_script ($service, ($active) ? "start" : "stop");
}