Edit: DTR actually wasn't being set low like it's supposed to be when the connection is closed. I fixed it by setting the baud rate to 0 (this also causes DTR to go low) on the connection before closing it.

I'm working on a robot for a competition, we have an Arduino Mega 1280 connected to a small computer running Ubuntu Server 12.04. we are able to reset the Arduino by opening the serial monitor in the Arduino IDE but not via our main program. We've looked at the IDE source and haven't been able to find what it does differently from ours, any help would be greatly appreciated.

Here is the code we are using to open a serial connection to the arduino.

Well I can't help you with the Linux stuff, but the arduino board's auto-reset function is activated by having the serial port assert the 'DTR' control signal. Does your opening of a serial port perform that step?