Originally, in Logan's Run, the killer robot "Box" was programed to freeze and store sea food. How long had the abandoned "Box" been been running amok when encountered by Logan 5 and Jessica 6 in the Logan's Run franchise?
I'm not sure we have any way to arrive at a clear answer from the evidence of the movie. I'm not sure it's even clear whether Box predates the City or not -- it's been a while since I've seen it and I've already read two different interpretations while trying to write this answer (Wikipedia's entry seems to suggest that Box was processing food for the city, while The World of Logan's Run seems to believe Box predated the City and was more or less left to his own fate when the City was created).
I'm also not sure that "running amok" is quite right. It implies an active rampage, whereas in the movie, people come to him, believing they're fleeing to safety!
Box' original purpose was to freeze and preserve food for storage. "[The food] stopped, and they (the runners) started", it explains. This suggests that the delivery system for the food ended, followed by people escaping the City of Domes. It's possible that the process he was built for was to (pre)supply the City of Domes, which could explain why there seemed to be a direct route between them, one that seemingly every runner found.
We don't know how long he sat inactive - presumably it was a long time; long enough to make the decision that humans were an acceptable replacement for food in his process.
Box was NOT running amok. The cyborg had been programmed to store seafood.
But after an unseen and unspoken calamity which forced humans into domed cities, the seafood stopped arriving.
Box must have still been continuing his mission, but instead captured and stored escaping "Runners."
The most amazing thing that few get is that Logan and Jessica are actually the first humans to escape from the City.
The old man (Peter Ustinov) apparently survived the calamity and was always around, but outside the city.