Stains, sagging, or peeling paint are signs that there is excess water on your ceiling drywall. Where would this water come from? Roof damage, missing tiles, or blocked gutters are top culprits; others are surplus water from broken pipes or leaks from an upstairs bathroom.
If your home has too much humidity - especially in the kitchen and bathrooms - your ceilings are more susceptible to mold and mildew stains. If this is the case, install proper ventilation in these rooms.
A crack running the whole length of the ceiling and down a wall is most likely an indication that you have a damaged wall stud or your home has settled improperly. This is a serious issue.