There is a story relating to the life of Mrikanda Rishi. He was an old strict sage who did meditation for many years. He called upon Lord Shiva, and finally Shiva gave him 'darshan', that is sight or blessing. Shiva asked him what does he want then Mrikanda said that he want a son, who can continue his family tree.
Lord Shiva in return replied to Mrikanda that he had grown old and had been meditating for these years and now wants to have a son. The lord endowed with two choices before Mrikanda. One is that he will give him a stupid son with a long life or a very wise son with a very short life. It is Mrikanda's choice to pick any one of them.
Mrikanda thought for a moment and then he decided to take the intelligent son with short life. His son was known as Markandeya.
Markandeya as he grew up was supposed to leave his body at an early age, and as the time approached for him to leave his body, his father, Mrikanda got more and more dejected and depressed. Markandeya went to his father, Mrikanda and asked why his father was so sad. Mrikanda said that he did not want to disclose the reason but as he had asked he related told about the blessing of Lord Shiva. Now the time has come and anytime the ambassadors of Yama or Yamaduta, the God of Death will come and take his son from him. But Mrikanda wants his son to stay with him.
Markandeya assured his Mrikanda that there was no reason to be anxious and feel restless because he must have faith in Lord Shiva. Lord Shiva was the benefactor for his boon and now He will only rescue Mrikanda from trouble. Markandeya started meditating and impress the Lord Shiva so that He saves his life from death.
He sat down by the Shiva Lingam, and chanted, "Om Namah Shivaya" several times. Yama who was sitting in the kingdom of death, and Chitragupta, his prime minister turned to him and said that it is time to pick up Markandeya. Chitragupta said that Markandeya, who thinks himself to be a kid on earth that by rhyming Om Namah Shivaya he is going to save him. And Yama called his ambassadors, he said that Yamaduta, ambassadors of the God of Death, to go down and bring the soul of Markandeya before him.
And the ambassadors of the God of Death came, and Markandeya was saying, "Om Namah Shivaya Om Namah Shivaya." And they said him to come with them. Markandeya said that he is not leaving but they insisted, him on going. They ordered him to go because he cannot deny and refuse the God of Death, the power that controls. And Markandeya refused said, "I'm not coming." And the ambassadors from the God of Death said, "If you don't come with us peacefully, we're gonna take you by force." And they grabbed hold of the kid.
The kid, Markandeya, grabbed on to the Shiva lingam. And pull as they tried, they couldn't break him free from the Shiva lingam, he was holding on to that Shiva lingam and they were pulling and pulling and pulling. And finally Lord Shiva came down and ordered the Yamaduta to leave Markandeya alone as he will bestow him imperishable life or the Mahamrityunjaya that is the victory over the Great Death.
The ambassadors went back to Yama, the God of Death, and Yama said, nobody can resist the order of Yama, but if it's Lord Shiva's order then he can stay. Of course Markandeya went on to expound the Markandeya Purana from which comes the Chandi Path. He was the first seer of the Mahamrityunjaya mantra. So in the same way that he found imperishable life.