Whenever a person is committed upon process in a civil action or proceeding, except when the people of this State are a party thereto, the sheriff is not bound to receive such person, unless security is given on the part of the party at whose instance the process is issued, by a deposit of money, to meet the expenses for him of necessary food, clothing, and bedding, or to detain such person any longer than these expenses are provided for. This section does not apply to cases where a party is committed as a punishment for disobedience to the mandates, process, writs, or orders of court.
Ca. Pen. Code § 4016