4

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?

xuiqzy
  • 47
  • 1
  • 6

1 Answers1

2

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.

Drake Clarris
  • 886
  • 4
  • 7
  • 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. – xuiqzy 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](http://www.appsapk.com/busybox-app/) 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](http://forum.xda-developers.com/showthread.php?t=1929852)? But in theory `setsid` should do the same, or what's the difference? – xuiqzy 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? – xuiqzy Nov 26 '14 at 13:58
  • The stericson one in your link is the same as the one installed by that app. – Drake Clarris Nov 26 '14 at 14:06
  • But that's one version behind 1.22.1, perhaps it also includes `nohup` – xuiqzy Nov 26 '14 at 14:11
  • By the way, 1.22.1 also didn't include nohup for me, with the Stericson google play installer. – xuiqzy Dec 12 '14 at 14:40