Texturing/UV wrap help
First, some general UV unwrapping tips

If you want to make it easy on yourself, first fix the topology of your object to be all quads that flow together. 



What this means is that you want the faces of your mesh to be squares instead of triangles where possible, because the subdivision will occur smoothly and predictably, and most importantly in this case - your UV unwraps will be much more clean and manageable.

More on quad topology here.

Addressing some problems specific to your model

There is an area with bad topology - faces are overlapping. Move these edge loops:



And here are the problems with your seams:



Here is what I suggest doing instead to fix it:



How I approached this

Now that you know a better way to place your seams, I should explain that for an unwrap as simple as this, you don't even need to use seams. You can simply select the faces you want and unwrap by section. Only selected faces will be unwrapped.

Select everything except the two end caps. Then do a UV unwrap using the 'Follow Active Quads' method. This method gives very clean results on topology consisting of long spans of quads.



'Length Average' is the way to go to minimize texture distortion in this case, since it curves around corners.



In the UV/Image Editor, scale your unwrap result down to fit within the square area.

Next, select only the two end cap faces, go into top view so you're looking at them straight-on, and UV unwrap again. This time choose 'Project From View'.



Place your two unwrapped cap faces on your UV Map.



Here is the result:



If your texture looks strange on the tips you can Extrude the end caps so that the texture will be pulled in to a tiny point.



You would want to do this if you were creating a candy cane, for example: