ash instead of bash -- getting it to work by hand after installation
Greetings,
I just finished a Slackware 14.1 install but instead of installing bash I installed ash. When my I booted my finished system I was unable to login because the OS had been incorrectly configured to look for bash. I know that one can change their shell using the chsh command once they have logged into their system but this does not help me. I'm totally comfortable with booting the installation DVD, mounting the hard drive and editing the necessary files by hand but I don't know which ones I should. Does someone happen to know? |
Welcome to LQ and to the Slackware sub forum.
ash is included in Slackware as is bash, furthermore ash, not bash, is used during installation. But in Slackware, /bin/sh is a symlink to /bin/bash. So, if you want to use ash in your own scripts, just use the good shebang: #!/bin/ash or call you script like ash <my_script> You can also change the aforementioned symlink to point to /bin/ash, but then you'll have to take care yourself of the bashisms that could be used in the existing scripts you want to run. PS Oh, and in any case you should install bash. This doesn't prevent you to use another shell, of course. Moreover, it is highly recommended that newcomers in Slackland make a full installation of Slackware. Of course you can set the default shell of every user as you see fit. The "adduser" script comes handy for these settings. This notwithstanding you can specify another shell for logins setting the FAKE_SHELL parameter in /etc/login.defs, see "man login.defs". |
Bash is more formally used for system low-level administration due to its functionality abilities than other shells. Some shells lack abilities Bash does, which is why scripting is often termed as Bash Shell Scripting. You can use ash, dash, zsh, csh, or any other Posix or compatible shell for basic stuff and daily usage, but Bash is just different.
|
Didier,
Thanks for the reply but before I read it, I modified the /etc/passwd file and changed my users shell from bash to ash. After doing that I was able to log into my system but I got the following error: version 2.88 booting cannot execute “/etc/rc.d/rc.S” Entering runlevel: 3 cannot execute “/etc/rc.d/rc.M” Proc related stuff was not functional too. I did some reading online and I learned that many of the RC scripts break without bash being at least installed (as you mentioned). I definitely consider this a bug because one should not have to install two shells just to use another. In any case, I will make sure bash is installed and change my shell to ash using the chsh command. BTW, I'm not a GNU/Linux beginner. I've been using a UNIX-like operating system since 1999 and MSDOS before that. I go through phases when I want to get my hands dirty and leave the comfort of those other GNU/Linux distributions. :cool: |
Quote:
Code:
Bash must be present for the system to boot properly. Quote:
Nevertheless, using Slackware you are much more in control of what's included in your own system than with other distributions, IMO. For instance, each packages series includes a "tagfile" indicating which packages are considered by Slackware's maintainer as mandatory (tag ADD, as is the case for bash), recommended (tag REC) or fully optional (tag OPT) and you can customize yourself these tagfiles so that you can for instance easily clone a customized installation. PS IIRC there have been efforts to "de-bashify" Slackware init scripts, if you're interested you could try to find a thread about that in this forum. It could be many years old. |
i got it booting with ash once
don't remember rc.S/M problems, but inet script i'm sure didn't work so try without it |
You would have to edit all the rc.d scripts to make them run with ash and update the scripts with new slackware versions. Overall, it isn't worth the effort, so just install bash and use ash for your personal scripts.
|
Quote:
Quote:
|
Quote:
|
Quote:
|
Quote:
i think what i did was something like: go to http://pubs.opengroup.org/onlinepubs...cu_chap02.html go through rc.S line by line and check what is not POSIX (ash is only posix) boot to single user first, rc.M can wait (lies; i commented out parts till it worked then backtraced, but this is a more proper way) bdw i learned shell scripts from slackware ones (y) |
Quote:
Quote:
|
[QUOTE=scmaccal;5156056]
Quote:
Quote:
Quote:
|
Some useful links, but note that these are old attempts:
http://www.linuxquestions.org/questi...13-0-a-778084/ https://github.com/tuxdev/slackware-scripts http://sourceforge.net/projects/checkbaskisms/ |
Here's a link to a pretty-complete set of POSIX-compatible scripts available which would work for you:
sysvinit-scripts_1.7-i586-1.tpkg Change the suffix of the file from .tpkg to .tar.xz and then unpack it to see the scripts. Those are a result of hy-briding some of the code linked to earlier from tuxdev and grapefruitgirl which I combined, replaced or added to for my own system. The "accessory" rc scripts which come separately with their own package are found in the same source/package tree as above. I am using a bit later version of the package here, but that should give you enough to start with. Note that some of the 'advanced' accessory scripts may still require bash and my set there is by no means complete. I use the scripts with the dash shell, which I would recommend over the ash shell. In the scripts, the shell shebang actually is /bin/initsh, with /bin/initsh being a link to dash. The link could also point to /bin/bash -and they surely would work at least partially, with the link pointing to /bin/ash. My scripts are not direct translations of the Slackware rc scripts. They are mostly re-written from scratch, but generally follow a similar boot scheme as the normal slack boot process. They do contain lots of usable snippets for anyone wanting to use a POSIX shell for init. My method of having /bin/initsh allows me to still have /bin/sh linked to /bin/bash so 'normal' shell scripts run as expected. And I don't use dash as my login shell. |
gnashley,
Thank you for the thorough explanation and sharing your code. I'm going to give it a shot and report back! :) |
Quote:
|
All times are GMT -5. The time now is 07:16 PM. |