I found the problem. The poweroff file is really just a link to "../bin/busybox", so when you move it to /usr/local, the link is broken. So what you can do is just remove /sbin/poweroff and create a new file with the same name, but instead of calling /usr/local/poweroff at the end, do this:
Code:
#!/bin/sh
#do whatever you want before shutdown
/bin/busybox poweroff