What's the best way to restart Android via command line (remotely)? I'm looking for the best / friendliest way to reboot my rooted android 4.1.1 device. I found these solutions so far:


su -c "reboot" - Causes problems with wifi after restart on my device... I read that this can cause a currupt file system in some cases... Doesn't work via ssh for me.
toolbox reboot - Same concerns here, but works via ssh.
reboot -d 8 -f - causes problems after restart e.g. some apps wont start
busybox killall system_server - "Hot Reboot" (not really a system restart)
start|stop - Starts/stops Android Runtime (not really a system restart)


What is the device doing exactly when I'm pushing the (hardware) power button? I guess that's the most friendly way.
What is the device doing exactly when I'm pushing the (hardware) power button? I guess that's the most friendly way.

You get to see a dialog with an option to power off the device (stock Android doesn't offer reboot). It appears that ShutdownActivity is called upon when you long press Power button.
Anyhow, this is what you can try, remotely or locally, but only with root access:
su -c 'am start -a android.intent.action.REBOOT'

It will do a graceful shutdown followed by the reboot. I was looking for an intent when I noticed it here.
Method is tested on Android 4.2.1, 5.0.2 and 6.0.1 and should work for Android 4.1.1 as well
Update
Tested on stock Android 5.0 and 6.0.1:
su -c 'svc power reboot'

Per the source code here, KitKat builds should also support the command.