In order to be able to handle newer distros (fedora17+, ...) that uses 
exclusively systemd, I need to fix how system services are handeled (start, 
stop, restart, enable, disable, ...) (example: on fedora17+, /etc/init.d/gmond 
doesn't exists. (it's /lib/systemd/system/gmond.service that is used)).

Instead of doing if else statement each time a service needs to be started or 
enabled, I've seen that the base stuffs are already in place 
(SystemService.pm). Unfortunately, it's not quite ready to support systemd, so 
I need to fix things on the following components:

1/ OSCAR::OCA::OS_Detect (Added a service_mgt field: containing either systemd, 
initscripts, manual).
Set it in the distro specific pm file. typically, debian is manual (start 
scripts by calling /etc/init.d/service. redhat is initscripts (use the service 
command), fedora15+ is "systemd" (systemctl used to enable, disable, start, ...)

2/ OSCAR::OCA::OS_Settings: will remove absolute path for the init script. will 
keep only the name. Then we will read the os specific http_daemon and start it 
using SystemService::
We should be able to avoid this in the future: (from ganglia opkg: 
edit_ganglia_conf)
>    # autoload apache in levels 345 and start it up
>    my $HTTPD;
>    for my $srv ("httpd", "apache2", "apache") {
>        if (-x "/etc/init.d/$srv") {
>            $HTTPD=$srv;
>            last;
>        }
>    }

SystemServices.pm: Instead of gessing the right command to use based on sitro 
packaging system, we use the os->{service_mgt} from OS_Detect::open. the we 
clean up SystemServices.pm and now starting or restarting a service will be 
usable.

Then use this code instead of checking -x /etc/init.d/daemon or blindly use 
chkconfig wich fails on ubuntu as it's not mandatory for the system to have 
/sbin/chkconfig installed.

Hopefully, it should be ok in a few days provided I don't find any code 
elsewhere that can't be updated

Olivier.


--
   Olivier LAHAYE
   CEA DRT/LIST/DM2I/DIR
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Oscar-devel mailing list
Oscar-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oscar-devel

Reply via email to