I think you've just contradicted yourself. If you're using the second definition, "morality refers to an ideal code of conduct, one which would be espoused in preference to alternatives by all rational people, under specified conditions", then suicide would be deemed an irrational act.
But then you said that no person could commit suicide in terms of only wanting to die and that other factors have driven a person to this end. That would be a rational thought process to what, by your preferred definition, is an irrational act.
I do believe suicide is a selfish act. But I also believe that some selfish acts are perfectly justified, even within the realm of rationality. A terminally ill patient who chooses to put an end to their suffering is one such example.