That's a frequent problem with both the 6.354 and 4.2XX series Perkins. Could be a weak solenoid, but is most often the momentary push button or the wiring between the switch and solenoid.
The push button applies 12 volts to activate the shutdown solenoid. As LaBomba described below, work backwards from the solenoid. Start by attaching a temporary wire to the battery positive post and touch it too the terminal on the top of the solenoid. The solenoid is already grounded and if it's good, the solenoids will activate all the way. Then you will know it's in the switch or wiring. Then go to the dash and remove the wire from the push button shutdown switch. touch the wire end to a good 12 volt pos. source looking for the same result again. If it doesn't work, then it's the wire, otherwise check out the switch.
Last fall I had the same problem and that time it was the wire between the button and solenoid.