In some ways this strategy isn't so far off from doing custom code development to bootstrap your company.
At one of my startups, we did a lot of custom development work that funded our company for several years. We were able to retain ownership of all of the code as well, so we were able to re-use it to create other products that we built an additional business around.
Your strategy is very similar here. You can take the open source code that you create and build a practice around it as long as it is something that will solve problems for other companies besides your industry sponsor.
The key to doing this is to ensure that the product you are developing will solve a problem that many people have. If you can do that, it shouldn't be too hard to develop a practice around the deployment and support of the product.
The question of whether or not the code is open source is almost secondary. Personally, I like open source code, but you should check with your potential customers to see what their views are. And don't just check with developers. Check with the lawyers at the companies. See which open source licenses are acceptable to them. Pay attention to whatever feedback you can get.
It also may make a difference if this code is going to be used as part of a SaaS offering or as part of something that your customers will ship to their users. (Again, a question for the attorneys.)
Whatever you do, I think the best way to do this is to just put what you want in the contract. It might not even be an issue for your customers. If it is, you might have to sell them on it a bit, but in my experience, companies who outsource development typically don't view it as part of their core competency which means that they care less about the actual ownership of the code and are happy to think of it as a license rather than ownership of the IP.
Occasionally, you may run into a company who has some piece of functionality they want you to develop that they view as a differentiator that they want to keep exclusive. So, during the development of your system, take things like this into account. Architect the system in such a way that proprietary components could be added to create this type of exclusive functionality. Make sure that the license you choose to release this under will allow this type of model as well.
One company that I can think of who has made a similar model work is Coupa. They developed an open source e-procurement system and recently got a nice chunk of funding. It's still too early to tell whether they will be successful in the long run though.
Good luck! Let me know what you end up doing. I'm really curious to see how this works for you.