In the framework of process optimization, the use of measurements to compensate the effect of uncertainty has become an active area of research. One of the ideas therein is to enforce optimality by tracking the necessary conditions of optimality (NCO tracking). Most techniques assume that the set of active constraints remains the same even in the presence of uncertainty and disturbances. Consequently, changes in the active set are difficult to handle. In this paper, this assumption on active set tracking is relaxed by using a logarithmic-linear barrier-penalty function. This way, none of the constraints is active and no assumption regarding the active set is required. Optimization with this barrier-penalty function is shown to have the same convergence properties as optimization with the standard barrier function while, at the same time, avoiding a separate logic to guarantee feasibility. Thus, the adaptation can be more aggressive and lead to better performance. The gradient of the augmented objective function is computed using finite perturbations and forced to zero with PI-type controllers. The approach is illustrated in simulation via the static optimization of an isothermal continuous stirred-tank reactor.