From the mongodb-user mailing list:
We have a production cluster on 4.0 (one shard replicaset, one config replicaset, numbers of app servers/mongos nodes). Have just triggered the upgrade via apt-get. We noticed that in 4.0.0 to 4.0.1 our mongod.service files were getting clobbered, and losing the --replSet xxx in the ExecStart line. In preparation this time, we removed all write access (chmod a-w) from this file ahead of the upgrade, although the process still blew this away and back to default, causing our cluster not to come back up.
Is there any way we can stop this in the future? Having to go back and reconfigure the start up services every time we do an update is an absolute pain. Any suggestions to avoid this very much appreciated.