Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#3019 - /etc/shinit is not sourced when login shell is bash #7827

Closed
openwrt-bot opened this issue Apr 19, 2020 · 3 comments
Closed

FS#3019 - /etc/shinit is not sourced when login shell is bash #7827

openwrt-bot opened this issue Apr 19, 2020 · 3 comments
Labels

Comments

@openwrt-bot
Copy link

Arduous:

Hello,

I have OpenWrt SNAPSHOT, r12985-508462a399 running in VirtualBox from openwrt-x86-64-generic-ext4-combined.img.gz . I think the problem is not specific to this platform.

Some useful functions like service are not available when the default shell defined /etc/passwd is replaced from /bin/sh to /bin/bash. I think this is due to the way the sourcing mechanism was altered in commit [[https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=12020f8a95d21547bd7d7fd1fef9cdecf2892803|#2892803 when /etc/shinit]] was added.

Reproduction steps

samuel@bioman2:~$ ssh root@192.168.1.1

BusyBox v1.31.1 () built-in shell (ash)


| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -| || | | || || |
|
_____|| |
||||___||| |____|
|
| W I R E L E S S F R E E D O M

OpenWrt SNAPSHOT, r12985-508462a399

root@biorouter:# opkg update >/dev/null 2>&1
root@biorouter:
# opkg install bash >/dev/null 2>&1
root@biorouter:# service
service "" not found, the following services are available:
adblock dnsmasq gpio_switch lighttpd odhcpd sysctl system umount
boot done igmpproxy log rpcd sysfixtime ucitrack urandom_seed
cron firewall led network sshd sysntpd uhttpd urngd
root@biorouter:
# head -n 1 /etc/passwd
root:x:0:0:root:/root:/bin/sh
root@biorouter:# sed -i "s/ot:/bin/sh/ot:/bin/bash/" /etc/passwd
root@biorouter:
# head -n 1 /etc/passwd
root:x:0:0:root:/root:/bin/bash
root@biorouter:# exit
logout
Connection to 192.168.1.1 closed.
samuel@bioman2:
$ ssh root@192.168.1.1


| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -| || | | || || |
|
_____|| |
||||___||| |____|
|
| W I R E L E S S F R E E D O M

OpenWrt SNAPSHOT, r12985-508462a399

root@biorouter:# service
-bash: service: command not found
root@biorouter:
#

My workaround is to source /etc/shinit in /etc/profile, but I guess it defeats the purpose of the above mentioned commit.

Thank you

@openwrt-bot
Copy link
Author

ynezz:

Just notified the patch author http://lists.infradead.org/pipermail/openwrt-devel/2020-April/023059.html

@openwrt-bot
Copy link
Author

jefferyto:

This should be fixed by openwrt/packages#11993.

@openwrt-bot
Copy link
Author

Arduous:

Validated on openwrt-13136-x86_64
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant