Post Reply

SManager - script executing fine manually, but not at boot

23rd June 2014, 11:34 AM   |  #1  
OP Junior Member
Thanks Meter: 0
 
8 posts
Join Date:Joined: Aug 2010
Greetings! I know there have been many topics 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 &
24th June 2014, 11:39 PM   |  #2  
OP Junior Member
Thanks Meter: 0
 
8 posts
Join Date:Joined: Aug 2010
anyone?
26th June 2014, 01:42 PM   |  #3  
OP Junior Member
Thanks Meter: 0
 
8 posts
Join Date:Joined: Aug 2010
bump, anyone? Sorry if this is not in the right section of the forums
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools
Display Modes


Top Threads in Questions and Answers by ThreadRank