Design and control problems of failure-prone production lines are explored by means of simple mathematical models. The fluctuations of the performances are introduced via random environments which are modelled by non-Markovian alternating renewal processes. The production output can either be discrete or continuous processes. For these modelling frameworks, we calculate explicitly the average and the variance of the following quantities: (1) the cumulate production output, (2) the random time needed to complete a given production batch and (3) the output of a buffered production dipole. Finally, the optimal control of a single failure prone machine which delivers a single part type is considered. The demand rate is taken to be constant. Deviations of the production output from the demand are penalized by a convex cost function. The operating states of the machine are again modelled by a non-Markovian alternating process. Under the assumption that a hedging point policy is optimal, we calculate explicitly the position of this hedging stock as a function of the coefficient of variation of the time to failure.