Remove All Ads from XDA
Honor 9 Lite

SManager - script executing fine manually, but not at boot

24 posts
Thanks Meter: 0
By AaylaSecura, Junior Member on 23rd June 2014, 12:34 PM
Post Reply Email Thread
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:


# 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 &
25th June 2014, 12:39 AM |#2  
OP Junior Member
Thanks Meter: 0
26th June 2014, 02:42 PM |#3  
OP Junior Member
Thanks Meter: 0
bump, anyone? Sorry if this is not in the right section of the forums
31st July 2017, 04:00 AM |#4  
Thanks Meter: 3
Post Reply Subscribe to Thread

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

Advanced Search
Display Modes