Service command not found

It should work since LEDE 17.01.
Are you using unsupported OpenWrt release?

1 Like

18.06.2 official.

1 Like

That's strange...
https://openwrt.org/docs/guide-user/base-system/managing_services

# type service
service is a shell function

# grep "service()" /etc/profile
service() {

So it should work by default.

1 Like

It's not there.

root@xeli:~# cat /etc/profile 
#!/bin/sh
[ -f /etc/banner ] && cat /etc/banner
[ -e /tmp/.failsafe ] && cat /etc/banner.failsafe

export PATH=/usr/sbin:/usr/bin:/sbin:/bin
export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
export HOME=${HOME:-/root}
export PS1='\u@\h:\w\$ '

[ -x /bin/more ] || alias more=less
[ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi

[ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc

[ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; }
[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }

I am pretty sure I never messed with profile. My only guess, if the file should differ, is that it got carried from previous versions by keeping the settings, although I don't think it is in the preserved files list.
(I'll flag our post to be moved to a new topic).

That's it:

# grep -r /etc/profile /lib/upgrade/keep.d/
/lib/upgrade/keep.d/base-files:/etc/profile.d
/lib/upgrade/keep.d/base-files-essential:/etc/profile

So preserving the settings is not always good.
Perhaps this statement could be relevant for the main topic as well.

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.