Once I get the login screen it works fine until the next power down.
Has Ashwin aka
Raz0rEdge says above, we need more information.
I'm assuming your iMac is likely this model, Apple iMac "Core 2 Duo" 2.0 20" (Mid-2009) Specs
Technical specifications for the iMac "Core 2 Duo" 2.0 20" (Mid-2009). Dates sold, processor type, memory info, hard drive details, price and more.
everymac.com
When was the last time you ran or did any software maintenance or diagnostics on that iMac, such as running Disk Utility first aid or any verify or repair options available.
How full is the hard drive, and there is a good chance it may be failing???
There is also a chance that its PRAM battery is getting very weak and may need replacing, but more likely your hard drive is starting to fail.
EDIT NOTE:
If your iMac requires you to press the power button several times before it switches on, this is a clear signal that your PRAM batteries are weak and failing. Additionally, something is amiss when you notice the screen displaying the wrong time and date. Another reason warranting replacement is when the screen appears unusually dark for a moment before resuming its previous state after a successful power-up. There is also a need to worry if some functions like printing settings fail.
Conventionally, Apple products feature lithium-ion batteries to run the system and perform other tasks. A new user would assume that the same case applies to…
purplepedia.com
PS: do you have an authorized Apple Mac Service Technician close by that you could hire or take it to at least to do a diagnostic test on it???
- Patrick
=======