When major disruptions occur in a rail network, the infrastructure manager and train operating companies may be forced to stop trains until the normal status is recovered. A crucial aspect is to identify, for each train, a location (a safe place) where the train can hold during the disruption, avoiding to disconnect the network and allowing a quick recovering of the plan, at restart. We give necessary and sufficient conditions for a safe place assignment to have the desired property. We then translate such conditions into constraints of a suitable binary formulation of the problem. Computational results on a set of instances provided by a class 1 U.S. railroad show how the approach can be used effectively in the real-life setting that motivates the study, by returning optimal assignments in a fraction of a second.