A characteristic posture is considered one of the behavioral hallmarks of sleep, and typically includes functional features such as support for the limbs and shielding of sensory organs. The nematode C. elegans exhibits a sleep-like state during a stage termed lethargus, which precedes ecdysis at the transition between larval stages. A hockey-stick-like posture is commonly observed during lethargus. What might its function be? It was previously noted that during lethargus, C. elegans nematodes abruptly rotate about their longitudinal axis. Plausibly, these "flips" facilitate ecdysis by assisting the disassociation of the old cuticle from the new one. We found that body-posture during lethargus was established using a stereotypical motor program and that body bends during lethargus quiescence were actively maintained. Moreover, flips occurred almost exclusively when the animals exhibited a single body bend, preferentially in the anterior or mid section of the body. We describe a simple biomechanical model that imposes the observed lengths of the longitudinally directed body-wall muscles on an otherwise passive elastic rod. We show that this minimal model is sufficient for generating a rotation about the anterior-posterior body axis. Our analysis suggests that posture during lethargus quiescence may serve a developmental role in facilitating flips and that the control of body wall muscles in anterior and posterior body regions are distinct.