RexOps / Rex

Rex, the friendly automation framework
https://www.rexify.org
716 stars 223 forks source link

Rex::Service::SuSE on openSUSE Leap #1114

Closed LeMerP closed 7 years ago

LeMerP commented 7 years ago

Since openSUSE Leap uses systemd instead of System V as service manager, a service does not need to be symlinked under /etc/rc.d anymore. Running 'service "foo" => "reload";' on such machine will often produce strange output like:

Rex::Helper::Run::i_run('/etc/rc.d/bareos-fd restart', 'nohup', 1) called at /usr/lib/perl5/site_perl/5.18.2/Rex/Service/Base.pm line 58
    Rex::Service::Base::_execute('Rex::Service::SuSE=HASH(0x3d25488)', '/etc/rc.d/bareos-fd restart') called at /usr/lib/perl5/site_perl/5.18.2/Rex/Service/Base.pm line 92

I would suggest to use the /usr/sbin/service %s command for operations like "start, restart, stop, reload, status" and /usr/bin/systemctl to manage service autostart.

LeMerP commented 7 years ago

This issue is related to the development-1.x branch. master branch is working as expected.

ferki commented 7 years ago

This issue is related to the development-1.x branch

So I'd like to keep it open to don't accidentally release this bug with the next 1.x release :)

Thanks for reporting!

LeMerP commented 7 years ago

As I can see, there are systemd modules (i.e. Rex::Service::SuSE::systemd). It seems they just will not be used.

ferki commented 7 years ago

I think what we need to do:

Until then service_provider_for can be used to override the automatic selection:

service_provider_for SuSE => 'systemd';
krimdomu commented 7 years ago

This might be a problem of the development-1.x branch solved by #1126 i have to create a suse leap test system

krimdomu commented 7 years ago

i just tested it, and indeed it was fixed with #1126