We consider deterministic mixed-line flow shop systems that are composed of controllable and uncontrollable machines. Arrival times and completion deadlines of jobs are assumed to be known, and they are processed in the order they arrive at the machines. We model these flow shops as serial networks of queues operating under a non-preemptive first-come-first-served policy, and employ max-plus algebra to characterize the system dynamics. Defining completion-time costs for jobs and service costs at controllable machines, a non-convex optimization problem is formulated where the control variables are the constrained service times at the controllable machines. In order to simplify this optimization problem, under some cost assumptions, we show that no waiting is observed on the optimal sample path at the downstream of the first controllable machine. We also present a method to decompose the optimization problem into convex subproblems. A solution algorithm utilizing these findings is proposed, and a numerical study is presented to evaluate the performance improvement due to this algorithm.