Stoppare un servizio di Windows in stato “arresto in corso”

By cillo at May 20, 2010 00:06
Filed Under:

Può capitare che alcuni servizi si blocchino in uno stato non gestibile tramite mmc che è appunto lo stato “starting” o “stopping” ovvero “avvio in corso” e “arresto in corso”.

Quando mi capita, solo in caso di emergenza e cercando di non fare questa operazione su server di produzione, interrogo dal prompt dei comandi il servizio in questione tramite il comando:

 

 sc queryex nomeservizio

 

Il risultato è simile a questo:

 

NOME_SERVIZIO: nomeservizio
        TIPO                   : 10  WIN32_OWN_PROCESS
        STATO                  : 3  STOP_PENDING
                                (STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
        CODICE_USCITA_WIN32    : 0  (0x0)
        CODICE_USCITA_SERVIZIO : 0  (0x0)
        PUNTO_CONTROLLO          : 0x21ff
        INDICAZIONE_ATTESA     : 0xea60
        PID                    : 1234
        FLAG                   :

 

Da cui prendo nota del PID e quindi lancio sempre da prompt:

 

taskkill /PID 1234 /F

 

L’opzione /F indica che la chiusura deve essere forzata.

Poi faccio uno start del servizio da mcc per essere sicuro che tutto riprenda correttamente.

Comments

Comments are closed

About Me

My work experience began in the second half of the nineties, designing and developing mainly internet-based solutions for businesses.
As a natural evolution, I started focusing on the architectural aspect of IT systems.
I have been a system administrator and IT manager for years now, and I take care of designing, implementing and maintaining customer IT infrastructures.

If you want to know more, please take a look on

Recent comments

Comment RSS

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in  anyway.

© Copyright 2008