As per Army Act 1950, committing a suicide is a punishable offence for MIlitary Personnel. Read at (c) below:
64. Miscellaneous offences. Any person subject to this Act who commits any of the following offences, that is to say,- (a) being in command at any post or on the march, and receiving a complaint that any one under his command has beaten or otherwise maltreated or oppressed any person, or has disturbed any fair or market, or committed any riot or trespass, fails to have due reparation made to the injured person or to report the case to the proper authority; or (b) by defiling any place of worship, or otherwise, intentionally insults the religion or wounds the religious feelings of any person; or (c) attempts to commit suicide, and in such attempt does any act towards the commission of such offence; or (d) being below the rank of warrant officer, when off duty, appears without proper authority, in or about camp or cantonments, or in or about, or when going to or returning from, any town or bazar, carrying a rifle, sword or other offensive weapon; or (e) directly or indirectly accepts or obtains, or agrees to accept or attempts to obtain, for himself or for any other person, any gratification as a motive or reward for procuring the enrolment' of any person, or leave of absence, promotion or any other advantage or indulgence for any person in the service; or (f) commits any offence against the property or person of any inhabitant of, or resident in, the country in which he is serving; shall, on conviction by court- martial, be liable to suffer imprison- ment for a term which may extend to seven years or such less punishment as is in this Act mentioned.