And obviously the runner is not out because the batter-runner is out (infield fly) and there is no reason for the runner to vacate his base - he is not being forced to leave by the advancement of the batter-runner. Makes perfect sense to me.
As for the other question (line drive)...
Once the ball is hit, the defense must be given opportunity to field the ball and make their own plays/outs. This is why the offense is called out for interference (runner hit by ball) when the defense has an opportunity to make a play. And, if the defense has no possibility of making a play (defense not in position), then the runner is not out and play continues.
So... R2 (on 2nd), hit by line drive with the shortstop in position to make a play/out (perhaps F6 could make more than one out)... Dead Ball, R2 is out even if standing on the base, no one advances, next batter.
I have found it extremely valuable to learn the reason why a rule is enforced rather than memorizing the letter of the law and trying to make reasonable enforcements. Knowing "Why" leads to much less confusion and, in the end, proper application of the rules. JMHO