I came across this issue today when I had to provision a new web application, I tried to provision the web application from the central administration server where I don’t have the Microsoft SharePoint Foundation Web Application service running, for a good reason in my opinion, this is the first service I will stop on an application server, because it is the primary role for a web server. In case you did not notice, not running this service on the server used to provision the new application will not give you the option to select an existing application pool, it gives you only the option to select an application pool running in the local IIS.
But if you are like me and decide to provision this web application from the CA server then probably you will start the Microsoft SharePoint Foundation Web Application service on this machine and wonder why it is stuck on starting, you wait 10-15-20 minutes and you decide that there is something wrong with your server, start to panic, search for solutions in places where yo don’t have to search etc…
If you started the Microsoft SharePoint Foundation Web Application service on your CA server you have to know that in my case it took almost one hour to start, during this time you can check the progress using he IIS console, you will notice web sites and application pools start to appear one by one. Just keep calm and wait.
In case you do not see any progress in IIS or in the ULS logs then you can start the deployment of this service using this STSADM command:
stsadm -o provisionservice -action start -servicetype spwebservice
But keep in mind that you have to wait a lot depending on the number of web applications you have.
Work in progress…..
Everything worked fine after the stsadm command was used. A second issue appeared as soon as I tried to stop the Microsoft SharePoint Foundation Web Application service after I finished my work. Doing so from the CA caused the service to be stuck on stopping. Again use the same command but this time with the switch -stop instead of start, finished in one minute and then I issued iisreset /noforce. Everything is back to normal now.
stsadm -o provisionservice -action stop -servicetype spwebservice