We investigate a production-inventory model under the assumptions that demand for product is governed by a compound Poisson process, and the machine is subjected to random failures. A two-critical-number policy (m, M) is used to control machine's setups and shutdowns, namely, machine is shut down whenever the inventory level reaches M, and is resumed to operate only when the inventory level falls below the critical number m (m <= M). Our objective is to determine optimal control parameters which minimize system costs consisting of setup costs, inventory holding costs, and backorder costs. The problem arises in many practical production situations. The results can be used by production planners to design new production systems or to reduce costs of existing systems.