Has the United States ever had mandatory National Service

And no I do not mean the current registration for selective service. Conscription in the US seems to have been based upon a draft; meaning that conscription was employed to cover the shortfall in manpower that existed after regular recruitment. Has the US ever had a system of mandatory service, meaning that all males of a certain age had to serve a specific time in the armed forces. Such as was in the UK or in the USSR?

Nope. During and immediately after the Korean War there was some serious consideration of a mandatory year of national service, but nothing ever came of it.

According to this article in The Atlantic (“The Secret History of Guns”),

That’s the closest I’ve ever heard of universal mandatory public service in the US and it wasn’t universal: white women, aboriginals, and blacks were excluded, and, if I read it correctly, white males who refused to swear allegiance to the Republic were as well.

When I first read the article I tried to find more information on this law but did not.

The Second Militia act of 1792. Published text of the act, hope your eyes are better than mine.