In this work, aiming at the master oscillator of the photoelectron gun with a variable repetition rate of electron bunches, a picosecond solid-state laser subject to delayed optoelectronic feedback and RF loss modulation is studied. Loss modulation is performed using an electro-optical modulator with zero bias at the second accelerator frequency subharmonic. Optoelectronic negative feedback uses an intracavity electro-optical modulator and a fast high-voltage photodiode mounted as close as possible to the modulator crystal. An analytical formula is obtained for the pulse duration, and estimates are given for Nd and Yb based media and L, S, C and X-band used in modern linear accelerators. Numerical simulation proves that the control is suitable for pulse-repetitive operation. The proposed approach solves the problem of laser pulse shortening and locking the master oscillator, and therefore, electron bunches in photoelectron guns, to the high-stable RF generator controlling accelerator functioning.