It is a sign of good fiction-writing technique that the author will introduce a character by showing him doing something that is "in character" or "characteristic." Salinger chose to introduce Holden standing all alone in the freezing cold at some little distance from his school and trying to get some feeling about the school to take with him when he leaves. This setting--and Holden's choice of being in this setting--are "in character" and "characterize" him as an outsider, a misfit, an introvert, and a loner. His description of the setting and of what he can see from the hilltop reveal his superior intelligence. Holden is getting kicked out of school for failing most of his classes. He thinks of himself as dumb, but he is an ugly duckling. He is a genius. Proof of his intelligence is shown by the fact that he has written an entire book at the age of only sixteen. (The novel, of course, was written by Salinger, but is supposedly written by Holden himself and is so well crafted that the reader is beguiled into believing that he is reading the work of a sixteen-year-old boy.) Holden's self-imposed isolation and "ostracism" is highlighted by the fact that everybody else at Pencey is attending the big football game with Saxon Hall. He can hear all the kids yelling even at a considerable distance away. They are involved in the game and care nothing about Holden Caulfield, his whereabouts, his feelings, or his fate. Throughout the novel Holden will be a loner, an outsider, a misfit, and an introvert, partly by choice and partly because he doesn't know how to fit in. He is not exactly a rebel, but he might be described as "a rebel without a cause." The cannon in the setting might be symbolic of repressed anger and rebellion. After all, it is a cannon from the Revolutionary War and could see seen as symbolizing revolution, just as "The Catcher in the Rye" might be taken as a sort of Declaration of Independence.
He is trying to feel some sort of good-bye, because when he leaves a place, he likes to know that he is leaving it. By this, his personality is a person that never gives up, and tries to hang on to things for as long as he can.
I hope that this helps. =)