I've CM12.1 on my Galaxy S3. I'm trying to set up SSHD. At the moment everything is working fine, except the last step: start the sshd demon at start-up.
The problem is that the script
/data/local/userinit.sh
will be executed, but the call in it not anymore.
Here is the script:
#!/system/bin/sh
if [ -e /data/local/userinit.d/99sshd ]
then
log -p i -t userinit "Launching /data/local/userinit.d/99sshd--before"
/system/bin/sh /data/local/userinit.d/99sshd
log -p i -t userinit "Launching /data/local/userinit.d/99sshd--after"
fi
The script 99sshd is very simple, just for debugging:
#!/system/bin/sh
log -p i -t userinit "Executing /data/local/userinit.d/99sshd"
And here is the result from logcat:
userinit - Launching /data/local/userinit.d/99sshd--before
userinit - Launching /data/local/userinit.d/99sshd--after
Missing is the message:
userinit - Executing /data/local/userinit.d/99sshd
How could it happen?!
-
Can you run it manually as a test?Chris Stratton– Chris Stratton2015年05月07日 13:30:39 +00:00Commented May 7, 2015 at 13:30
-
Yes, from the terminal no problem.bangkokguy– bangkokguy2015年05月07日 14:50:04 +00:00Commented May 7, 2015 at 14:50
-
ok folks, I found, that the file system isn't ready somehow: the scipt isn't there at the moment of execution. Any help from sy who knows very well the android boot process is very appreciated.bangkokguy– bangkokguy2015年05月27日 21:12:51 +00:00Commented May 27, 2015 at 21:12
-
this may be related.andrew-e– andrew-e2015年12月22日 03:55:50 +00:00Commented Dec 22, 2015 at 3:55
-
Just a guess here, as I've no G3 to test with. This line: "/system/bin/sh /data/local/userinit.d/99sshd", wouldn't that execute 99sshd in a subshell? Perhaps that accounts for what's missing., i.e. the same way the '$x' is lost here: echo -e "x=yes\necho \$x\n" > foo ; bash foo ; echo :$x:.agc– agc2016年04月03日 16:08:46 +00:00Commented Apr 3, 2016 at 16:08