The link was interesting but it didn’t address the issue of what the words mean–it’s all about the tune, and where it came from.
Spoke, I think you may just have to chalk it up to being a serious “art song”, meant to be performed with great sentimentality in a parlour after dinner, to a rapt audience. “Art songs” don’t always have a plot where you can say, “Okay, boy meets girl, boy loses girl, boy gets girl back”.
I would suppose that the reference to “pipes” means Irish bagpipes, which are a folk instrument viewed with great affection by the sort of people who sing this song to each other after dinner, in the parlour.
But there’s nothing in the song that specifically addresses itself to war either way, and that’s what makes it so universally popular. It’s a generic song, it can mean anything. The singer could be a mother saying goodbye to her son, a sweetheart saying goodbye to her fellow, it could be anything.
AFAIK, the song doesn’t specifically have anything to do with a war, although I suppose that it may have certain connotations for certain people who sing it to each other in a certain time and place. AFAIK, it’s not like some “secret code” song.
AFAIK, the Irish bagpipes were never used in wartime, not the way the Scottish pipes were. They have a different, softer sound, more suitable for dancing, not quite as martial (or as noisy).
Does this help?
P.S. One of my all-time favorite P.G. Wodehouse stories involves a take-off on “Danny Boy”, called “Jeeves and the Song of Songs”. Everybody within the sound of my voice should find it and read it.