You are not logged in.
Since I need a very small terminal based distro, I am running the base flavor of the latest Slitaz cooking. However, I am running into two problems:
1) autologin in kernel boot options does not auto login in the terminal. I still need to specify tux or root/root when terminal comes up.
2) I need to autostart a script AFTER the system is booted to the terminal so that the user can see what is going on. If I stick in the commands in /etc/init.d/local.sh, that is executed at boot time and the user won't be able to see anything. To make matters worse, the only way to see if commands are properly being executed by local.sh is looking in /var/boot/boot.log, which I don't want to do. So how do I auto exec a script after terminal is booted up (or in general as I may want to do the same for a full fledged cooking version in the future)?
Offline
Try this:
# sed -i 's|.*shell.*|tty1::respawn:/bin/ash|;/getty/d' /etc/inittab
# cat >> /etc/profile <<EOT
Your commands...
EOT
-pascal
Offline
Bellard, thank you for the help. Replacing getty in inittab for tty1 with /bin/ash worked great, now I am auto logged in. However, putting my test script (./test.sh) at the end of /etc/profile did not do anything as far as I can tell. My test script simply echos "hello" but I do not see it when the system is up. Basically, base cooking ISO boots up, displays default display message "Welcome to your box" "Slitaz boot time: 3s" then goes to the ash prompt, no execution of script. If you could, I'd prefer a solution that works on both base and justx cooking flavors of Slitaz as I am using both and must auto exec a script AFTER boot up on both sides. Also, I must run this script as root if it's possible. I'm not sure if what you provided me would allow me to run it as root. Thanks.
Offline
Any ideas guys? Sorry to bump this but I'm stumped on this.
Offline
I can confirm your experience totally, nim108 and I'm also searching desperately for a solution for that problem.
If anyone knows, please response
Djego
Hi,
You can try the autologin approach described in:
http://forum.slitaz.org/topic/auto-login-sem-x#post-2271
Then, you can modify the file /usr/bin/autologin to add your script:
[c]#!/bin/sh
exec /bin/login -f tux
exec /path/to/your/script[/c]
I haven't tried it myself, but you can try and return here to tell if it works for you.
Offline
Claudinei, the exec /bin/login -f tux command works fine to login automatically as user tux, however, it will not exec my test script. If I exec it manually after boot up, it works just fine, so I know it's not the script (which is just supposed to echo "hello"). Any other ideas on how to get it to exec automatically? Thanks, I do appreciate all the help / responses.
Offline
Tanks for your advice Claudinei.
nim108, try this:
add [c]exec /path/to/your/script[/c] to the second to last line (before [c]fi # logged[/c]) in the /etc/init.d/rcS file.
I tried and it worked, but I'm not shure and of course want to know if that's the "nice" way to realize a autoexecution?
djego, thanks for the suggestion. I figured editing rcS would work, but that file should never be touched in my opinion, especially when there are config files directly concerning rcS. It's a hack at best, but it might be the only way to do it in terminal based versions of Slitaz. Editing inittab with autolaunching an autologin script is fine for autologging in; I have no issues with that, but I don't think we should have to edit rcS to autolaunch a custom script after boot. Any other way to do this?
Offline
djego, I finally tried this your way (hacking rcS with the script path on the bottom of the script) but I ran into an issue. It seems my test script executes twice on startup after boot as I get "hello" printed two times. Is this happening to you as well?
Offline
If you add the exec-line at the absolutely end of the file, then "hello" gets printed twice. I noticed this as well, though cannot explain it. But if you paste the line BEFORE [c]fi # logged[/c] as described above, it should run just once.
djego
Oh sorry, I didn't see that you said BEFORE fi # logged. Thank you sir. I guess I'll go this route for now until a better solution arrives. I was contemplating using Tiny Core because of these minor issues but it seems to be a lot harder to customize (especially since Slitaz has all these flavors you can start out with plus all the taz tools). I'm hoping version 4 addresses these issues and makes things like this doable without hacking away at main files like rcS.
Offline
[ Generated in 0.019 seconds, 7 queries executed - Memory usage: 1.55 MiB (Peak: 1.77 MiB) ]