FORUMS
Remove All Ads from XDA

[MOD] LoSD - LoS Repair Daemon v1.3.1 [Updated 2012-08-08]

152 posts
Thanks Meter: 117
 
By trifthen, Senior Member on 3rd December 2011, 05:38 PM
Post Reply Email Thread
NOTE:

If you came here looking to fix recent problems with LoS in recent builds of Jelly Bean, be aware that this utility has not been tested with JB or ICS at this time. I figured LoS was a solved problem, so retired the project. I'm looking into it again, and may have something out later depending on how much has changed in the OS updates.

Introduction

Has your phone ever had a circle with a line through it instead of signal bars? Has your phone ever shown signal bars, but all calls and texts fail until you reboot? Well, those situations are called Loss of Service, or LoS, and while we can't actually stop them from happening yet, those situations can be detected and repaired. The Loss of Service Daemon (LoSD) does that, so you don't have to!

It does this by:
  1. Restarting problematic radio daemons when detected.
  2. Rebooting when all attempts to fix have failed.

In addition, it can create a log dump of various system logs for debugging purposes.

Requirements
  • Phone must be rooted.
  • An init.d compatible kernel.
  • Busybox must be installed.

Many ROMs and custom kernels do this automatically, but check the feature of your basic tool-chain before installing.

Installation

All files are located in my github projuct, if you'd like to get a closer look at how all LoSD works. But what you really want to to know:

Download LoSD

This will be a file you can flash using ClockWorkMod. Simply copy it to your internal or external SD card, reboot into recovery, and flash. The next reboot will be running LoSD.

NOTE : Installing LoSD will automatically remove -viperboy-'s LoSChecker, as they should not both run at the same time.

Download LoSD Uninstall

The above package will fully remove all traces of LoSD from your phone. Flash if you're having problems or no longer need/want LoSD.

WARNING! Do not wipe anything before or after install of this utility! It is not a ROM. You will be left with an unbootable system.

Usage

If you installed the flashable zip, your phone will automatically launch the LoS daemon at every boot.

Or you can call it manually to obtain debugging logs!

Code:
    LoSD dump
When called with the 'dump' command, LoSD will dump all debugging logs and exit, creating a timestamped directory in LOGPATH (/data/local/LoSD by default), as well as a tar archive named logs.tar.gz. This lets you capture situations where LoSD did not detect a LoS, and send the logs for analysis.

Frequently Asked Questions

These are taken from the README file that gets installed with LoSD. There's more dev-related info in that file, so give it a look!

Q: Will this restart the radio or the phone if I lose 4G?

No. 4G is actually a separate radio from the CDMA radio used for texts and phone calls. This script ignores the 4G radio entirely and can not trigger no matter what happens to the 4G radio.

Q: Will this restart the radio or the phone if I'm using WiFi?

No. Turning on WiFi *will* disable your 3G data, but will leave the CDMA radio in an available state so you can still receive phone calls and texts. The LoS daemon knows the difference, so feel free to use your WiFi as you please. LoSD may restart your radio while you're on WiFi, but only because your CDMA radio stopped responding and you wouldn't have received any texts or phone calls if it didn't try and fix the radio.

Q: Where do I find the logs?

Logs produced when the radio is restarted, or the phone is rebooted, are stored by default in /data/local/LoSD in a directory time and date stamped for when the fix was attempted, or a reboot was triggered.

Q: Help! My log directory is getting huge!

By default, LoSD will not dump system logs when it repairs a LoS. But you may have enabled it on your own if you modified the configuration file. If you're in a spotty coverage area, the log directory may start to fill with several timestamped log dumps, each of which are around 5MB. If you'd like to stop this, please ensure your LoSD.ini configuration file does not contain the following line:

Code:
    DUMPLOGS=1
Such a line will enable log dumping, which again, is disabled by default!

Q: I think I have LoS the daemon didn't detect. How do I get logs?

Very easily! LoSD has a built-in logging command! Just type this into a terminal, or an 'adb shell':

Code:
    su
    LoSD dump
This will create a timestamped directory just like LoSD had detected it. In addition, a file named logs.tar.gz will be dropped in your LOGPATH directory (that's /data/local/LoSD by default) you can send to us. We recommend putting it in dropbox, or some other binary-file hosting site.

Credits
  • Many thanks to -viperboy- for the original concept of checking for LoS with a script.
  • HaiKaiDo gave us the idea of restarting the radio daemon before rebooting.

If I'm forgetting anyone, please PM me!
The Following 31 Users Say Thank You to trifthen For This Useful Post: [ View ] Gift trifthen Ad-Free
 
 
3rd December 2011, 05:39 PM |#2  
trifthen's Avatar
OP Senior Member
Flag Chicago
Thanks Meter: 117
 
More
Configuration

There are several settings you can apply to the LoS daemon while it's working. These settings should be placed in a file named LoSD.ini in the /data/local/LoSD directory of your phone. If you change any settings, you must either restart the daemon, or reboot your phone.

Currently recognized settings:
  • DEBUG

    Many log entries are only informative in nature and can be very noisy. If you are having trouble and want to see LoSD activity reported in the system logs and LoSD.log, set this to 1. Default is 0.
  • DUMPLOGS

    Whether or not logs should be dumped during a LoS repair or system reboot. Should be 0 for false, or 1 for true. Default is curently 0.
  • LOGPATH

    Full path to where logs should be dumped. This is also where LoSD keeps its own LoSD.log file. Default is /data/local/LoSD because the daemon knows that directory exists. Feel free to place it somewhere on your SD card. If this directory does not exist, LoSD will attempt to create it for you. Please make sure the path is writable!
  • RESTARTS

    How may times should the daemon attempt to restart the radio before giving up and initiating a system reboot. Default is 2. This setting was primarily defined because ghost LoS can sometimes degrade into full LoS, and subsequent radio restarts may be necessary to regain service.
  • RESTART_LIMIT

    How many successful radio restarts before LoSD considers the phone state tainted? Too many RILD restarts may damage other services, or cause other unknown side effects. After this limit is reached, further LoS events will not result in an RILD restart, but a full reboot. Default is 3.
  • SLEEP

    How long to wait between radio checks, in seconds. Default is two minutes.

Example:

Code:
    LOGPATH=/sdcard/los
    RESTART_LIMIT=1
Again, if these settings are changed, you must either restart the LoS daemon, or restart the phone. To restart the daemon, execute the following in an ADB shell or terminal:

Code:
    su
    killall LoSD
    nohup LoSD &
The 'nohup' is there to prevent the command from attaching to your TTY, so you can disconnect without your session hanging. Feel free to omit this if you were just going to close your TTY.
The Following 2 Users Say Thank You to trifthen For This Useful Post: [ View ] Gift trifthen Ad-Free
3rd December 2011, 05:39 PM |#3  
trifthen's Avatar
OP Senior Member
Flag Chicago
Thanks Meter: 117
 
More
Change Log

Version 1.3.1
  • Added third Airplane mode check for ICS firmwares.
  • Third firmware check also works on phones with disabled logcat.

Version 1.3.0
  • Improved CDMA connection FAILED detection.
  • Added second Airplane mode check for EL13, EL26, EL29 firmwares.

Version 1.2.0
  • Added debug log level.
  • Moved several informative messages to debugging only.
  • Debugging is now disabled by default.
  • Tweaked RILJ error detection for RIL_REQUEST_CDMA_GET_SYSTEMPROPERTIES.
  • Can now ignore false positive ghost LoS caused by phone calls.
  • Phone call and Airplane mode now checked before anything else.
  • CONNECTING status no longer skips LoS check.
  • Added ghost LoS check for CDMA 'Unknown data error' messages.

Version 1.0.0
  • Log dumping is now disabled by default.
  • Now uses 'setprop ctl.stop/ctl.start' to try restarting RILD nicely.
  • Does a quick check to prevent multiple running copies.
  • Added a radio restart limit to avoid glitchy post-fix systems.
  • Clear radio log in case of false positive ghost LoS.

Version 0.9.0
  • Added non-LoS check for transient CONNECTING status.
  • Now check for ghost LoS *after* standard LoS.
  • Calling LoSD with 'dump' now dumps and tarballs all debugging logs.

Version 0.8.1
  • Fixed bug in grabbing bugreport dump.
  • Now removes -viperboy-'s LoSChecker on install.
  • Removed LoSD logcat dump in favor of persistent LoSD.log.

Version 0.8.0
  • Now maintains a separate log for tracking all LoS events.
  • Added DEBUG configuration setting.

Version 0.7.1
  • Fixed typo in AirplaneMode check. Should no longer reboot in airplane mode.

Version 0.7.0
  • Fixed bug in radio log dump.
  • Now tries multiple times to restart RILD before reboot.
  • Added DUMPLOG as boolean to disable / enable log dumps
  • Added RESTARTS as number of RILD restart attempts before reboot.
  • SLEEP, LOGPATH, DUMPLOG, and RESTARTS are now user configurable.
  • Now searches for /data/local/LoSD/LoSD.ini for config settings.

Version 0.6.0
  • Initial public release
The Following User Says Thank You to trifthen For This Useful Post: [ View ] Gift trifthen Ad-Free
3rd December 2011, 05:43 PM |#4  
Just_s's Avatar
Senior Member
Flag Denver/Albuquerque
Thanks Meter: 631
 
More
Good deal, the more people working on this the better and I know viperboy had a lot of work going. I'll give your version a go today.

Sent from my SPH-D710 using xda premium
The Following User Says Thank You to Just_s For This Useful Post: [ View ] Gift Just_s Ad-Free
3rd December 2011, 05:54 PM |#5  
trifthen's Avatar
OP Senior Member
Flag Chicago
Thanks Meter: 117
 
More
Quote:
Originally Posted by Just_s

Good deal, the more people working on this the better and I know viperboy had a lot of work going. I'll give your version a go today.

Haha. Thanks. The way I see it, Viper has his hands full with way more important projects right now. With his ROM, the EK02 pull, the ICS work... why should he have to worry about this too? He was going to rewrite his script anyway, so I just took the opportunity to do it while he was distracted being useful.

While I was at it, I just... added a few things. That's all.
The Following 2 Users Say Thank You to trifthen For This Useful Post: [ View ] Gift trifthen Ad-Free
3rd December 2011, 06:19 PM |#6  
Success100's Avatar
Senior Member
Flag Cleveland
Thanks Meter: 236
 
Donate to Me
More
installing now.. thanks for this, and thanks viper
The Following User Says Thank You to Success100 For This Useful Post: [ View ] Gift Success100 Ad-Free
3rd December 2011, 06:25 PM |#7  
gedster314's Avatar
Senior Member
Oxnard, Ca
Thanks Meter: 118
 
More
How about an option that appends to a file a date and time that the los happened instead of the full log? How about a notification after it fixed a los? The viper script made the phone appear like I never have los. Good but I still would like to know how often it happens.
The Following User Says Thank You to gedster314 For This Useful Post: [ View ] Gift gedster314 Ad-Free
3rd December 2011, 06:34 PM |#8  
trifthen's Avatar
OP Senior Member
Flag Chicago
Thanks Meter: 117
 
More
Quote:
Originally Posted by gedster314

How about an option that appends to a file a date and time that the los happened instead of the full log? How about a notification after it fixed a los? The viper script made the phone appear like I never have los. Good but I still would like to know how often it happens.

I can do the feature to keep a running tally of LoS, but so far as I can tell, there's no way to send notices from the command line. If there is, I can't find it. Sorry.

Sent from my SPH-D710 using xda premium
The Following User Says Thank You to trifthen For This Useful Post: [ View ] Gift trifthen Ad-Free
3rd December 2011, 09:53 PM |#9  
Senior Member
Thanks Meter: 8
 
More
Question... Do I need to be uninstalling this script everytime I update, or just flash over the old? -Grand

Sent from my SPH-D710 using XDA App
3rd December 2011, 09:59 PM |#10  
trifthen's Avatar
OP Senior Member
Flag Chicago
Thanks Meter: 117
 
More
Quote:
Originally Posted by grandmastem

Question... Do I need to be uninstalling this script everytime I update, or just flash over the old? -Grand

Just flash it over the old one. I've made the install smart enough to install over previous versions of LoSD. If you're running -viperboy-'s LoSChecker, you should run his uninstall first, though.

Also:

Edited OP to reflect new 0.8.0 version. Added a setting to suppress the Info-level log messages. Now it also keeps a LoSD.log in the LOGPATH directory so you can keep a log of its activity between reboots without having the log dumping enabled.

I also updated the Configuration and Change Log sections.
The Following 3 Users Say Thank You to trifthen For This Useful Post: [ View ] Gift trifthen Ad-Free
3rd December 2011, 11:28 PM |#11  
pats4life100's Avatar
Senior Member
Thanks Meter: 10
 
More
After u install it wat u do to run it or do it run on its own

Sent from my SPH-D710 using xda premium
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes