Tiny Core Linux
Tiny Core Extensions => TCE Q&A Forum => Topic started by: rhermsen on April 03, 2018, 05:32:49 PM
-
Hi all,
Just to get my findings confirmed.
And maybe other scripts have the same mistake I made.
With TCL8.2.1 I was able to start a bash script which has an header #!/bin/bash (sha-bang). Even if I I'm using GNU Bash, the script is executed.
$ sudo /usr/local/etc/init.d/frr
Usage: /usr/local/etc/init.d/frr {start|stop|status|restart|force-reload|<priority>} [daemon] [instance]
E.g. '/usr/local/etc/init.d/frr 5' would start all daemons with a prio 1-5.
$ head -n 2 /usr/local/etc/init.d/frr
#!/bin/bash
#
$ which bash
/usr/local/bin/bash
$ ls -la /bin/bash
lrwxrwxrwx 1 root root 19 Apr 3 20:48 /bin/bash -> /usr/local/bin/bash
$ version
8.2.1
With TCL9.0 I used the same bash script (same header #!/bin/bash).
$ sudo /usr/local/etc/init.d/frr
sudo: unable to execute /usr/local/etc/init.d/frr: No such file or directory
$ head -n 2 /usr/local/etc/init.d/frr
#!/bin/bash
#
$ which bash
/usr/local/bin/bash
$ ls -la /bin/bash
ls: /bin/bash: No such file or directory
$ version
9.0
So the header of bash scripts need to change to:
#!/usr/local/bin/bash
-
Hi rhermsen
... So the header of bash scripts need to change to:
#!/usr/local/bin/bash
No, it sounds like there might be a problem with the startup script for bash. What do you get for the following command:
cat /usr/local/tce.installed/bash
-
Hi Rich,
Thanks for your reply. So there should be a symlink installed /bin/bash pointing to /usr/local/bin/bash
$ cat /usr/local/tce.installed/bash
$
$ ls -la /usr/local/tce.installed/bash
-rwxrwxr-x 1 root staff 0 Apr 4 19:14 /usr/local/tce.installed/bash
$
$ which bash
/usr/local/bin/bash
$
$ bash --version
GNU bash, version 4.4.12(1)-release (i486-pc-linux-gnu)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$
$ version
9.0
$
-
Hi rhermsen
... So there should be a symlink installed /bin/bash pointing to /usr/local/bin/bash
Yes, that is correct. According to this the startup script is missing:
http://tinycorelinux.net/9.x/x86/tcz/bash.tcz.list
Based on this list from TC8:
http://tinycorelinux.net/8.x/x86/tcz/bash.tcz.list
The following files appear to be missing:
/usr/local/share/bash/.bashrc
/usr/local/share/bash/bashrc
/usr/local/tce.installed/bash
I will bring it to Juanitos attention.
This affects x86 and x86_64.
-
Thanks for looking into this.
-
bash extensions reposted in the x86 and x86_64 repos - thanks for reporting this
-
Confirmed, bash script starts normally now. Tested on TCL x86.
Thanks.