Ticket #126: openrc-0.4.0-warn-sysinit-stop.patch

File openrc-0.4.0-warn-sysinit-stop.patch, 740 bytes (added by Matthias Schwarzott <zzam@gentoo.org>, 21 months ago)

untested patch adding proposed warning

  • openrc-0.4.0/src/rc/runscript.c

    old new  
    965965        hook_out = RC_HOOK_SERVICE_STOP_OUT; 
    966966        rc_plugin_run(RC_HOOK_SERVICE_STOP_IN, applet); 
    967967 
    968         if (!rc_runlevel_stopping() && 
    969             rc_service_in_runlevel(service, RC_LEVEL_BOOT)) 
    970                 ewarn ("WARNING: you are stopping a boot service"); 
     968        if (!rc_runlevel_stopping()) { 
     969                if (rc_service_in_runlevel(service, RC_LEVEL_SYSINIT)) 
     970                        ewarn ("WARNING: you are stopping a sysinit service"); 
     971                else if (rc_service_in_runlevel(service, RC_LEVEL_BOOT)) 
     972                        ewarn ("WARNING: you are stopping a boot service"); 
     973        } 
    971974 
    972975        if (deps && !(state & RC_SERVICE_WASINACTIVE)) { 
    973976                errno = 0;