Ejemplo n.º 1
0
def c_restart(p, h, args):
    if len(args) == 0:
        p.info( "No processes restarted" )
        return 1;

    while len(args) > 0:
        id = match_one_running( p, h, args.pop() );

        if not id:
            continue;
        
        p.info( "Restarting:", id )
        m = Monitor(h, id);
        if not m.send( commands.Restart() ):
            p.info( "Unable to restart, cleaning id:", id )
            h.clean(id);
Ejemplo n.º 2
0
def c_stop(p, h, args):
    if len(args) == 0:
        p.info( "No processes stopped" )
        return 1;
    
    while len(args) > 0:
        id = match_one_running( p, h, args.pop() );
        
        if not id:
            continue;
        
        p.info( "Shutting down:", id )
        m = Monitor(h, id);
        if not m.send( commands.Shutdown( commands.Shutdown.TERM ) ):
            p.info( "Unable to shutdown, cleaning id:", id )
            m.clean();