I am trying to initiate mongod with replSet=1 as below:
$mongod --dbpath /x/y --replSet 1

But I kept getting errors like "you need to initialize the replication set by calling rs.initiate()", then I start a mongo shell to issue rs.initiate() and the problem gets resolved. 

But my question is why a separate mongo shell is needed? Is there a way to do it using mongod option?