Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
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.
There's one problem. You need to specify an explicit pathname on that script using ./rc-local.bash, as most user's won't have . on their $PATH variable.
The weird thing is I tried that and it STILL doesn't work. The Bitrock script log says ./rc-local.bash doesn't exist, but it does, I don't get it. I'm stuck on this little thing and it's frustrating!
line in before the chmod command; make sure that the rc-local.bash script is in the same directory as the parent script is being called from. (By the way, cd . doesn't do anything as it just changes to the current directory).
Also, make sure that the rc-local.bash is really called rc-local.bash and doesn't have any non-ascii characters in its name (e.g. rc–local.bash wouldn't match because it uses the wrong dash character). You might want to put in the line
There are 3 files in this installation, Bitrock.sh, rc-local.bash, and shell.pl. These are all installed into the same directory. Bitrock.sh, the script, is ran as a Post Install Script. So the files are installed and then Bitrock.sh is ran. Here's what the script looked like this time:
Error executing post installation script
/home/user/BitRock/output/sample-1.0/Bitrock.sh
\/home/user
chmod: cannot access `./rc-local.bash': No such file or directory
/home/user/BitRock/output/sample-1.0/Bitrock.sh: line 4: ./rc-local.bash: No such file or directory
rm: cannot remove `./rc-local.bash': No such file or directory
mv: cannot stat `./shell.pl': No such file or directory
chmod: cannot access `/etc/shell.pl': No such file or directory
Can't open perl script "/etc/shell.pl": No such file or directory.
Use -S to search $PATH for it.
rm: cannot remove `./Bitrock.sh': No such file or directory
As a directory name, . means "the current working directory" as printed by pwd; in this case, /home/user. The file ./rc-local.bash is really /home/user/rc-local.bash, which doesn't exist. You need to make the script point to the file as extracted, which I guess would probably mean something like BitRock/output/sample-1.0/rc-local.bash
Thanks I understand. But when the installation package is ran, the user can place the files in any directory which will most likely not be 'BitRock/output/sample-1.0'. I want the script to work no matter what possible directory the files are installed to.
Last edited by scriptn00b; 09-04-2005 at 06:51 AM.
You need to find out where the files are installed and use that within the script. If you're using an automated installer then this will most likely be in an environment variable somewhere.
Code:
cd $INST_PATH
would change the working directory to the right place if the installation path was held in INST_PATH, by way of example.
See the installer's documentation for more details.
You could also look at the value of $0, which contains the path of the script, followed by a slash, followed by the name of the script. If you can strip off the /Bitrock.sh at the end, then this will give you the installation directory.
Yes that variable in bitrock is ${installdir}. That was the first thing I tried(several ways) and that didn't work. I'll go ahead and look into $0. Thanks for helpin out rjlee.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.