Meaning 4 here covers soldiers and sailors
mess (ms)
n.
1. A disorderly or dirty accumulation, heap, or jumble: left a mess in the yard.
2.
a. A cluttered, untidy, usually dirty condition: The kitchen was a mess.
b. A confused, troubling, or embarrassing condition; a muddle: With divorce and bankruptcy proceedings pending, his personal life was in a mess.
c. One that is in such a condition: clothes that were a mess after painting the ceiling; made a mess of their marriage.
3.
a. An amount of food, as for a meal, course, or dish: cooked up a mess of fish.
b. A serving of soft, semiliquid food: a mess of porridge.
4.
a. A group of people, usually soldiers or sailors, who regularly eat meals together.
b. Food or a meal served to such a group: took mess with the enlistees.
c. A mess hall.