We address the issue of finding a strategy to sustain structural profitability of an investment project, whose production activity depends on the market price of a number of underlying commodities. Depending on the fluctuating prices of these commodities, the activity will either continue until the project's profitability reaches a critical low level at which it is stopped and starts again when it becomes profitable. But, if the structural nonprofitability remains for a while, the investment project will face the risk to be abandoned or be definitely closed. We suggest a general probabilistic set up to model profitability as a function of the market price of a set of commodities, and find the related optimal strategy to sustain it, under the constraint that the project faces the abandonment risk when being nonprofitable under a fixed finite time interval. When the market price dynamics is described by a diffusion process, we show that the optimal strategy is related to viscosity solutions of a system of two variational inequalities with inter-connected obstacles.