The phrase to live on the smell of an oil rag, and its variants, mean to live in conditions of extreme want.
This phrase does not seem to have originated in one particular country, since the earliest occurrences that I have found are from Australia, Ireland, Britain and the USA.
However, in early use, the phrase frequently occurs in relation to Ireland and to the armed forces.
These are, in chronological order, the earliest occurrences of the phrase to live on the smell of an oil rag and variants that I have found:
1-: From one of the humorous paragraphs making up Police Incidents, published in The Sydney Herald (Sydney, New South Wales, Australia) of Thursday 13th December 1832:
Clara Smith was charged with whipping a mop, well saturated with soap suds, into her master’s face. Clara has a taste for the stage, and being called upon to explain matters, threw herself into attitude, and shouted, “That I did mop his chops, it is most true, the head and front of my offending hath this extent, no more.” The Bench thinking this quite enough, ordered her to be carted with the next batch to the villa.
Ann Rawton, for treating the orders of her lord and master with supreme contempt, and telling him that as to a month, why she could do that on the smell of an oil rag, was ordered to try a month to gratify her ambition.
Nelly Cox, for telling her master that he had no more notion about him for doing the thing vats correct, than a cow had of a clean shirt, was ordered Gordon’s magazine de modes for 14 days.
2-: From the account of a court case, published in The Drogheda Journal. Or, Meath and Louth Advertiser (Drogheda, Louth, Ireland) of Tuesday 24th June 1834:
Witness—[…] Captain Mockler does not know me tho’ I served in the Meath militia with him. Mr. Ford—Then you were not one of those who ran away from Cork? Witness—Perhaps I was of those who ran after them though. Mr. Ford—l suppose you were in as great a hurry to catch them as you were to take the Carrs? Witness—If you were on the Redshire mountains living on the smell of an oil rag for four or five days you would know.
3-: From A Visit to Donna Maria’s Army before Santarem, by the Scottish traveller, author and British-Army officer James Edward Alexander (1803-1885), published in The United Service Journal and Naval and Military Magazine (London: Published for Henry Colburn by R. Bentley) of July 1834:
I heard a British adjutant of lancers say to his men, “Come, no grumbling, boys, about provisions: you ought to live for a week on the smell of an oil-rag, for remember you are now before the enemy.”
4-: From Repeal Eloquence in Newry, published in The Newry Commercial Telegraph (Newry, Down, Ireland) of Thursday 26th October 1843:
Seldom has one of the cloth had anything more mystical in hand than the oracular declaration of Mr. John M‘Gowan. It is dark as the “midnight” of which The Examiner speaks, in its edifying and erudite leading article about “jackals who feast on cream,” “soldiers who live on the smell of their oil-rag,” and “Popish puppies who whined at the kennel-door, and played other fantastic tricks, which, though they might make angels weep, oftener made devils laugh”!
5-: From The Banner of Ulster (Belfast, Antrim, Ireland) of Tuesday 1st April 1845:
A soldier absent from tattoo, and who remains out of barrack till next morning, has two days of his pay stopped. This is certainly a saving to the public, but then the poor fellow must exist for the time being either on the generosity of his comrades or “on the smell of his oil rag.”
6-: From the Public Ledger (Philadelphia, Pennsylvania, USA) of Friday 27th November 1846:
Short Allowance.—Gen. Taylor says he can keep his men fifteen days on the smell of an oil rag! At Monterey they were kept three days on green corn.
7-: From the account of a court case, published in the Cornwall Chronicle (Launceston, Tasmania, Australia) of Saturday 9th October 1847:
William Colburn, a passholder, in the service of Mr. John Palmer, of Leylands, said that he would rather “live a month on the smell of an oil rag,” than eat such bread as his master supplied him with—that he had been in places where there were eight or nine dishes on the table, and he could have had his choice of them—but the simple diet of roast and boiled, with such bread, was not agreeable to his stomach, and under these circumstances, he refused to work.
8-: From the account of a court case, published in the New Orleans Weekly Delta (New Orleans, Louisiana, USA) of Monday 10th July 1848—Dennis Delaney, an Irishman, is talking about George McDonald, a Scotsman:
“You are both charged,” said the Recorder, “under the Vagrant Act, with having been found by the watchman, sleeping, last night, in Lafayette Square. Dennis what have you got to say?”
Dennis.—Why, yer honor, do you see, all myself has to say in the wide world is, that I have been mighty infortunate altogether, to fall into such company, fur shure, yer honor, a dacent Kilkinny horse wouldn’t stable with this Scotchman—shure he looks for all the world as av he lived on the smell ov an oil rag all his lifetime.
9-: From The Pictorial National Library: A Monthly Miscellany of the Useful and Entertaining in Science, Art and Literature (Boston: William Simonds and Company) of June 1849:
We are no shriveled dyspeptic, hating in others what we could gladly enjoy ourself, but we have not a particle of respect for a gourmand. The good things of this life are to be enjoyed, but a man had better “live on the smell of an oil rag” all his life, and dwindle to lath-like proportions, than give himself over to the dominion of appetite.
10-: From The Hard-up Club; Or, Greetings and Gatherings of All Nations, by a Member, published in 1851 in Ainsworth’s Magazine: A Miscellany of Romance, General Literature, and Art (London: Chapman and Hall):
It would be fortunate if poor authors were endued with the propensities of the dormouse, or the boa constrictor, or Him of the East, who can submit to be buried alive for a specific period, and then arise and resume his usual functions; but, happy is the man who possesses so much of the spirituelle, that during the otherwise heavy hours which elapse before he receives the profits of a proof-sheet, can, cameleon-like, feed upon the pure etherial air. To those not conversant with matters connected with bookmaking and pamphleteering, it must appear strange that sundry editors and publishers expect needy purveyors of “the grave, the gay, the lively, and the severe,” for the periodicals to subsist on the sight of a proof-sheet in like manner as a celebrated general of by-gone days expected a Hungarian hussar to live on the smell of an oil-rag.
11-: From the account of a court case, published in the Cheltenham Journal, and Gloucestershire Fashionable Weekly Gazette (Cheltenham, Gloucestershire, England) of Monday 18th October 1852—Mr. Pilkington is a magistrate:
An Old Offender.—Catherine Mahone, a notorious character, who must have appeared before the magistrates nearly as many times as she is years of age, and we should say she must have seen at least seventy summers, was again placed in the dock on a charge of being drunk in the street.
Mr. Pilkington: […] You are found drunk, and that is a very awkward charge against a female.
Prisoner: I am a lover of “the grand army,” gentlemen, and can’t do without them. Even the smell of an oil-rag supports me. (Laughter.) Steady—steady; my heart’s so full I can’t keep it standing. (Renewed laughter.)