Bug 12916

Summary: messagebus: multiple "/etc/rc.d/init.d/functions: line 332: shift: 2: shift count out of range"
Product: IPFire Reporter: Jon <jon.murphy>
Component: ---Assignee: Peter Müller <peter.mueller>
Status: CLOSED FIXED QA Contact:
Severity: - Unknown -    
Priority: Will only affect a few users CC: adolf.belka, peter.mueller
Version: 2   
Hardware: unspecified   
OS: Unspecified   
See Also: https://bugzilla.ipfire.org/show_bug.cgi?id=13017
Attachments: messagebus stopped

Description Jon 2022-08-17 19:03:30 UTC
Running `/etc/rc.d/init.d/messagebus status`
causes thousands of messages:
```
[root@ipfire ~] # /etc/rc.d/init.d/messagebus status
/etc/rc.d/init.d/functions: line 332: shift: 2: shift count out of range
/etc/rc.d/init.d/functions: line 332: shift: 2: shift count out of range
/etc/rc.d/init.d/functions: line 332: shift: 2: shift count out of range
```

Running `/etc/rc.d/init.d/messagebus stop` seems OK
```
[root@ipfire ~] # /etc/rc.d/init.d/messagebus stopStopping the D-Bus Messagebus Daemon...                                                                                                                                  [  OK  ]
```

Running `/etc/rc.d/init.d/messagebus start` causes this message:
```
[root@ipfire ~] # /etc/rc.d/init.d/messagebus start
Starting the D-Bus Messagebus Daemon...
dbus[28213]: Unknown group "netdev" in message bus configuration file                                                                                                    [  OK  ]
```

This happened in CU 169 and in CU 170 test.
Comment 1 Jon 2022-08-17 19:09:45 UTC
FYI - this came about when installing pakfire Netatalk in CU 170 test.
Comment 2 Peter Müller 2022-08-22 20:31:52 UTC
I can reproduce this here:

[root@maverick ~]# bash -x /etc/rc.d/init.d/messagebus status
+ . /etc/sysconfig/rc
++ rc_base=/etc/rc.d
++ rc_functions=/etc/rc.d/init.d/functions
++ network_devices=/etc/sysconfig/network-devices
+ . /etc/rc.d/init.d/functions
++ umask 022
++ export PATH=/bin:/usr/bin:/sbin:/usr/sbin
++ PATH=/bin:/usr/bin:/sbin:/usr/sbin
++ RELOADSIG=HUP
++ KILLDELAY=10
++ '[' -z '' ']'
+++ stty size
++ COLUMNS='55 238'
++ COLUMNS=238
++ '[' 238 = 0 ']'
++ COL=230
++ WCOL=228
++ SET_COL='\033[230G'
++ SET_WCOL='\033[228G'
++ CURS_UP='\033[1A\033[0G'
++ NORMAL='\033[0;39m'
++ SUCCESS='\033[1;32m'
++ WARNING='\033[1;33m'
++ FAILURE='\033[1;31m'
++ INFO='\033[1;36m'
++ BRACKET='\033[1;34m'
++ STRING_LENGTH=0
+ pidfile=/var/run/dbus/pid
+ socket=/var/run/dbus/system_bus_socket
+ case "$1" in
+ statusproc -p /var/run/dbus/pid /usr/bin/dbus-daemon
+ '[' 3 = 0 ']'
+ getpids -p
+ '[' -z '' ']'
+ pidofproc -s -p '' -p
+ local pidfile=
+ local lpids=
+ local silent=
+ pidlist=
+ true

[ad infinitum]
Comment 4 Jon 2022-08-24 02:25:23 UTC
Peter - did you see the error related to `messagebus start`?

"dbus[28213]: Unknown group "netdev" in message bus configuration file"


```
[root@ipfire ~] # /etc/rc.d/init.d/messagebus start
Starting the D-Bus Messagebus Daemon...
dbus[28213]: Unknown group "netdev" in message bus configuration file                                                                                                    [  OK  ]
```
Comment 6 Peter Müller 2022-09-01 20:40:55 UTC
(In reply to Jon from comment #4)
> Peter - did you see the error related to `messagebus start`?
> 
> "dbus[28213]: Unknown group "netdev" in message bus configuration file"
> 
> 
> ```
> [root@ipfire ~] # /etc/rc.d/init.d/messagebus start
> Starting the D-Bus Messagebus Daemon...
> dbus[28213]: Unknown group "netdev" in message bus configuration file       
> [  OK  ]
> ```

Um, no, this does not seem to appear over here:

[root@maverick ~]# cat /etc/os-release 
NAME="IPFire"
VERSION="2.27"
ID=ipfire
VERSION_ID=2
PRETTY_NAME="IPFire 2.27 (x86_64) - core170 Development Build: next/f241a8c8"
ANSI_COLOR="0:31"
[root@maverick ~]# /etc/rc.d/init.d/messagebus status
dbus-daemon is running with Process ID(s) 32549.
[root@maverick ~]# /etc/rc.d/init.d/messagebus stop
Stopping the D-Bus Messagebus Daemon...                                                                                                                                                                                              [  OK  ]
[root@maverick ~]# /etc/rc.d/init.d/messagebus start
Starting the D-Bus Messagebus Daemon...                                                                                                                                                                                              [  OK  ]
[root@maverick ~]# /etc/rc.d/init.d/messagebus status
dbus-daemon is running with Process ID(s) 32691.

Does it have any impact on dbus operations on your machine?
Comment 7 Jon 2022-09-02 01:50:31 UTC
(In reply to Peter Müller from comment #6)
> 
> Does it have any impact on dbus operations on your machine?

messagebus doesn't seem to run once stopped.

see this image:
https://community.ipfire.org/t/cups-broken-in-current-testing-build-170/8492/3?u=jon

I have not tried the new patch in Comment 5.
Comment 8 Jon 2022-09-07 02:55:54 UTC
I applied the patch but I still see this error:

[root@ipfireAPU ~]# /etc/rc.d/init.d/messagebus start
Starting the D-Bus Messagebus Daemon...
dbus[6070]: Unknown group "netdev" in message bus configuration file       [  OK  ]
[root@ipfireAPU ~]#
Comment 9 Jon 2022-09-08 01:21:59 UTC
Created attachment 1086 [details]
messagebus stopped

I just installed IPFire 2.27 (x86_64) - Core-Update 170 Development Build: master/48a19ee5

Looks like messagebus is stopped on boot.
Comment 10 Adolf Belka 2022-09-19 15:12:58 UTC
(In reply to Jon from comment #9)
> Created attachment 1086 [details]
> messagebus stopped
> 
> I just installed IPFire 2.27 (x86_64) - Core-Update 170 Development Build:
> master/48a19ee5
> 
> Looks like messagebus is stopped on boot.

That is a problem with the new SERVICES meta data on the Services addons table. It shows stopped there but if you run messagebus status it shows that it is running but this looks like it is not being picked up in the services.cgi page.
Someone else found this on the forum today (19th Sep) and they are raising a bug for that.
Comment 11 Jon 2022-12-09 21:36:12 UTC
tested on apu4d4
IPFire 2.27 (x86_64) - Core-Update 172 Development Build: master/eb9e29f9

Using the WebGUI, all works A-OK with messagebus!

And the command line `/etc/rc.d/init.d/messagebus status` message no longer reports "line 332: shift: 2: shift count out of range".  Yay!



But there is still an odd message with start.  Running `/etc/rc.d/init.d/messagebus start` still reports this message:
```
[root@ipfireAPU ~] # /etc/rc.d/init.d/messagebus start
Starting the D-Bus Messagebus Daemon...
dbus[22133]: Unknown group "netdev" in message bus configuration file       [  OK  ]
[root@ipfireAPU ~] # 

```
Comment 12 Adolf Belka 2022-12-09 22:46:21 UTC
(In reply to Jon from comment #11)
> 
> But there is still an odd message with start.  Running
> `/etc/rc.d/init.d/messagebus start` still reports this message:
> ```
> [root@ipfireAPU ~] # /etc/rc.d/init.d/messagebus start
> Starting the D-Bus Messagebus Daemon...
> dbus[22133]: Unknown group "netdev" in message bus configuration file      
> [  OK  ]
> [root@ipfireAPU ~] # 
> 
> ```

This is coming from avahi which installs avahi-dbus.conf in /etc/dbus-1/system.d/ and that file has the following entry in it

  <!-- Allow everything, including access to SetHostName to users of the group "netdev" -->
  <policy group="netdev">
    <allow send_destination="org.freedesktop.Avahi"/>
    <allow receive_sender="org.freedesktop.Avahi"/>
  </policy>
  <policy user="root">
    <allow send_destination="org.freedesktop.Avahi"/>
    <allow receive_sender="org.freedesktop.Avahi"/>
  </policy>

This is allowing everything to users of the group netdev but netdev does not exist on IPFire.
This should probably check if netdev actually exists before defining the policy.

This is probably a bug in avahi but is not in their github issues list (closed or open)
Comment 13 Jon 2022-12-10 00:19:32 UTC
it looks like something that has been around for awhile:

https://www.google.com/search?q=dbus+Unknown+group+%22netdev%22+in+message+bus+configuration+file
Comment 14 Jon 2022-12-10 00:23:12 UTC
someone mentions to change the group to another group name.  I have no idea if that is a good idea or something really bad!

https://mail-index.netbsd.org/pkgsrc-users/2009/02/14/msg009307.html
Comment 15 Jon 2022-12-10 00:38:53 UTC
There is a LFS setup that may help:

https://www.linuxfromscratch.org/blfs/downloads/11.2-systemd/BLFS-BOOK-11.2-systemd-nochunks.html

look for: 
Installation of Avahi
Comment 16 Adolf Belka 2022-12-10 16:25:05 UTC
As this is an additional issue and the original one was resolved, I would suggest closing this bug once CU172 has been released and creating a new bug for the issue with missing netdev user. 


In the new bug you can then reference this bug in the "See Also:" section at the top of the bug.

You can then mark this bug as Verified as I have moved it to ON_QA as CU172 is in Testing and you confirmed the original issue is no longer occurring, if I have understood your input correctly.

I will then follow-up with the new bug.
Comment 17 Jon 2022-12-10 17:05:45 UTC
added new bug 13017 for Unknown group "netdev"
Comment 18 Adolf Belka 2023-01-17 09:57:52 UTC
Core Update 172 released

https://blog.ipfire.org/post/ipfire-2-27-core-update-172-released