Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
04-20-2014, 07:29 AM
|
#1
|
LQ Newbie
Registered: Apr 2014
Distribution: Slackware, Trisquel and Ubuntu
Posts: 8
Rep:
|
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?
Last edited by scmaccal; 04-20-2014 at 07:31 AM.
Reason: Bad text formating
|
|
|
04-20-2014, 07:51 AM
|
#2
|
LQ Addict
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,255
Rep:
|
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".
Last edited by Didier Spaier; 04-20-2014 at 08:30 AM.
Reason: PS added.
|
|
|
04-20-2014, 09:44 AM
|
#3
|
LQ Guru
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,564
|
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.
|
|
|
04-20-2014, 09:55 AM
|
#4
|
LQ Newbie
Registered: Apr 2014
Distribution: Slackware, Trisquel and Ubuntu
Posts: 8
Original Poster
Rep:
|
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.
|
|
|
04-20-2014, 10:43 AM
|
#5
|
LQ Addict
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,255
Rep:
|
Quote:
Originally Posted by scmaccal
... I did some reading online and I learned that many of the RC scripts break without bash being at least installed (as you mentioned).
|
This is clearly stated here
Code:
Bash must be present for the system to boot properly.
Quote:
Originally Posted by scmaccal
I definitely consider this a bug because one should not have to install two shells just to use another.
|
I disagree:
- Of course any distribution should include, just to work, a lot of stuff that maybe you won't use directly.
- Slackware is not designed to fit only your needs, but that of many users.
Also, bear in mind that Slackware doesn't include data and tools for automatic dependencies' resolution, that's why a full installation is recommended at least for people not yet acquainted with it.
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.
Last edited by Didier Spaier; 04-20-2014 at 11:07 AM.
Reason: PS added.
|
|
|
04-20-2014, 11:33 AM
|
#6
|
Member
Registered: Nov 2013
Posts: 746
Rep:
|
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
Last edited by genss; 04-20-2014 at 11:41 AM.
|
|
|
04-20-2014, 11:50 AM
|
#7
|
Senior Member
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982
|
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.
|
|
|
04-20-2014, 12:01 PM
|
#8
|
LQ Newbie
Registered: Apr 2014
Distribution: Slackware, Trisquel and Ubuntu
Posts: 8
Original Poster
Rep:
|
Quote:
Originally Posted by metaschima
You would have to edit all the rc.d scripts to make them run with ash and update the scripts with new slackware versions.
|
Do you happen to know of an URL that desribes how this is done?
Quote:
Originally Posted by metaschima
Overall, it isn't worth the effort, so just install bash and use ash for your personal scripts.
|
Well it's worth the effort to me becase it's a learning experience.
|
|
|
04-20-2014, 12:07 PM
|
#9
|
LQ Newbie
Registered: Apr 2014
Distribution: Slackware, Trisquel and Ubuntu
Posts: 8
Original Poster
Rep:
|
Quote:
Originally Posted by Didier Spaier
This is clearly stated here
Code:
Bash must be present for the system to boot properly.
|
Yes, I was aware of this statement. I don't agree with that design decision however.
Last edited by scmaccal; 04-20-2014 at 05:02 PM.
Reason: Broken quote tag
|
|
|
04-20-2014, 12:08 PM
|
#10
|
LQ Newbie
Registered: Apr 2014
Distribution: Slackware, Trisquel and Ubuntu
Posts: 8
Original Poster
Rep:
|
Quote:
Originally Posted by genss
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
|
Thanks for the suggestion but I'm not running inet.
|
|
|
04-20-2014, 12:15 PM
|
#11
|
Member
Registered: Nov 2013
Posts: 746
Rep:
|
Quote:
Originally Posted by scmaccal
Well it's worth the effort to me becase it's a learning experience.
|
that's the spirit
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)
Last edited by genss; 04-20-2014 at 12:16 PM.
|
|
|
04-20-2014, 12:21 PM
|
#12
|
LQ Newbie
Registered: Apr 2014
Distribution: Slackware, Trisquel and Ubuntu
Posts: 8
Original Poster
Rep:
|
Quote:
Originally Posted by Didier Spaier
Of course any distribution should include, just to work, a lot of stuff that maybe you won't use directly.
|
My goal is to minimize what is installed as much as possible for low memory and hard drive space needs.
Quote:
Originally Posted by Didier Spaier
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'm not familiar with IIRC, can you please provide me with an URL?
Last edited by scmaccal; 04-20-2014 at 12:23 PM.
Reason: Fixed quote tags
|
|
|
04-20-2014, 12:48 PM
|
#13
|
LQ Addict
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,255
Rep:
|
[QUOTE=scmaccal;5156056]
Quote:
Originally Posted by Didier Spaier
This is clearly stated here
Code:
Bash must be present for the system to boot properly.
Yes, I was aware of this statement. I don't agree with that design decision however.
|
Then why not design your own distribution
Quote:
Originally Posted by scmaccal
My goal is to minimize what is installed as much as possible for low memory and hard drive space needs.
|
Well, I'm not sure that ash uses less memory than bash. Did you check? And uncompressed package size of the bash package is 4.1M. Are you sure that you can't afford that? (I've used a computer with 64K RAM and 10M hard disk space, but that was more than 35 years ago :-)
Quote:
I'm not familiar with IIRC, can you please provide me with an URL?
|
IIRC=If I Remember Correctly. Oh, and by the way, I do. If you want to modify the init scripts so that they be ash-compliant, you'll need to well know ash's specification, of course.
Last edited by Didier Spaier; 04-20-2014 at 01:10 PM.
|
|
|
04-20-2014, 01:35 PM
|
#14
|
Senior Member
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982
|
|
|
|
04-20-2014, 02:03 PM
|
#15
|
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928
|
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.
|
|
2 members found this post helpful.
|
All times are GMT -5. The time now is 05:45 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|