I'm trying to analyze the reason for random reboots of my phone (see here).
Therefore I wanted to record the logcat and kernel messages till the restart to see the logs even after the usb disconnects, which is probably earlier than the restart?!

So I constantly copied proc/kmsg and the logcat to files. Now this needs to NOT stop when ADB disconnects. I already tried nohup, disown, setsid, putting it in braces. Tried everything from this question. But all these commands were not found in the shell.

So do you have another command or method for me to achieve what I want? Can I install some package / module like screen for this to work or does another (custom) kernel could help in some way?


If you install the busybox binary, it includes the nohup command (this will require root access). Busybox may be present, but the command not symlinked, in which case you would need to use busybox nohup command. If busybox is not present, then the easiest way to install is with busybox installer. After that is installed (again, with root privileges), you simply can use nohup command from adb or terminal emulator.

  • It works with setsid now, it continues after disconnecting adb and after pressing ctrl + c also. Has it some disadvantage to nohup? setsid is also listed in the installed packages in the busybox installer whereas nohup is missing and therefore is not installed, busybox nohup somecommand also doesn't work so it's not only not linked. – fightcookie Nov 24 '14 at 16:49
  • On my phone, nohup is part of my busybox - using busybox v1.22.1-Stericson. What kind of device is this? – Drake Clarris Nov 24 '14 at 21:37
  • I used this installer to install it without needing to set up and download from play store. It installed the version 1.20.1 with smart install (only install missing applets) in /system/bin. Can you give me a link to an installer that installs the new version or the new version itself? Maybe one of those? But in theory setsid should do the same, or what's the difference? – fightcookie Nov 26 '14 at 10:24
  • The link is in my post to the play store app. But if setsid is working, I wouldn't necessarily worry about it. Just wanted to know why I had nohup and you did not. – Drake Clarris Nov 26 '14 at 13:47
  • Okay, I saw the link. I just wanted to have an option to do it without WiFi and SIM (because sometimes it crashed so quickly I could't download anything and then bootlooped till factory reset). Can I take the first one in my link to XDA or is it a version that (partly) isn't adapted to Android? – fightcookie Nov 26 '14 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.