Welcome to the Android Central Forums Create Your Account or Ask a Question Answers in 5 minutes - no registration required!
Results 1 to 1 of 1
  1. Thread Author  Thread Author    #1  

    Question SManager - script executing fine manually, but not at boot

    Greetings! I have read lots of guides on how to run scripts at boot time, most suggesting the safe way using Script Manager. But I'm encountering an odd issue:
    I installed dropbear via opkg as described here and I wrote a script that would execute as root and start it. The script executes fine when I run it manually (either from SManager or from my terminal emulator using sh) and I am able to connect to my phone via ssh. However, when I set SManager to run the script at boot, the script executes fine, the processes are running (I can see them in the output of ps), the output from the processes (saved to log files) is the same as when I run them manually (and the connection can be established), but there is no TCP port associated with dropbear. I check using netstat - when I run the script manually, I can see the listening port, but not when the script is run automatically. Consequently, I cannot connect to my phone even though dropbear is running and reports it's listening on the port I specified. I tried adding a 2 minute delay in the script before dropbear is started (to allow the device to fully boot up) and I can confirm dropbear is started well after every other process, but the result is the same. I'm not sure if this is a problem with dropbear, SManager or something else.
    I tried putting the script in /etc/init.d and making it executable, but it is not being run at all, I don't think scripts there are being read (there is no such entry in /init.rc that checks scripts in /etc/init.d).
    I'm running SlimBean 4.2.2 on Samsung Galaxy S with 3.0.71-Semaphore_JB_2.9.18s kernel. Here follows the script:

    Code:
    #!/system/bin/sh
    
    # dropbear and ssh are installed in /data/local/bin
    export PATH=$PATH:/data/local/bin
    sleep 1s
    dropbear -p 42549 -v &>/sdcard/droplog
    sleep 1s
    # set up remote port forwarding (reverse ssh) to my PC so I can connect to my phone through its network's firewall
    ssh -TfN -o "GlobalKnownHostsFile /data/.ssh/known_hosts" -p 4713 -R 4714:localhost:42549 tcpfwd@<my-PC's public IP address> &>/sdcard/sshlog &

Similar Threads

  1. Replies: 17
    Last Post: 12-05-2014, 04:34 PM
  2. Replies: 2
    Last Post: 08-21-2014, 10:30 AM
  3. Replies: 1
    Last Post: 06-28-2014, 08:22 PM
  4. any way to boost Verizon LTE signal where I'm at?
    By sdsubball23 in forum Samsung Galaxy S5
    Replies: 1
    Last Post: 06-28-2014, 07:08 AM
  5. my LG F100L not connect with google play
    By Arvind Sinha in forum Android 5.0 Lollipop
    Replies: 1
    Last Post: 06-28-2014, 03:32 AM

Posting Permissions