Solved Message starting FreeBSD

grep -r procstat /etc /usr/local/etc /var/cron
/etc/mtree/BSD.tests.dist: procstat
Ok, it's fine in that file. The error you keep seeing is the result of something trying to execute procstat(1) with some bad parameters. We just need to figure out where this happens. It doesn't seem to be in any of the usual suspects; the rc(8) files.
 
Good Morning. For some time now, during the FreeBSD 13.1 system load, I have seen the following message:
Code:
Waiting 3s for the default route interface: usage: procstat [--libxo] [-h] [-M core] [-N system] [-w interval] command
                [pid ... | core ...]
       procstat [--libxo] -a [-h] [-M core] [-N system]  [-w interval] command
       procstat [--libxo] [-h] [-M core] [-N system] [-w interval]
                [-S | -b | -c | -e | -f [-C] | -i [-n] | -j [-n] | -k [-k] |
                 -l | -r [-H] | -s | -t | -v | -x] [pid ... | core ...]
       procstat [--libxo] -a [-h] [-M core] [-N system] [-w interval]
                [-S | -b | -c | -e | -f [-C] | -i [-n] | -j [-n] | -k [-k] |
                 -l | -r [-H] | -s | -t | -v | -x]
       procstat [--libxo] -L [-h] [-M core] [-N system] core ...
Available commands:
       argument(s)
       auxv
       basic
       binary
       [cpuset | cs]
       credential(s)
       environment
       [fd(s) | file(s)] [-C]
       kstack [-v]
       pargs
                 -l | -r [-H] | -s | -t | -v | -x]
       procstat [--libxo] -L [-h] [-M core] [-N system] core ...
Available commands:
       argument(s)
       auxv
       basic
       binary
       [cpuset | cs]
       credential(s)
       environment
       [fd(s) | file(s)] [-C]
       kstack [-v]
       pargs
       penv
       ptlwpinfo
       pwdx
       rlimit
       rusage [-Ht]
       sigfastblock
       signal(s) [-n]
       thread(s)
       tsignal(s) [-n]
       vm

I don't know where to look to make it go away Any ideas? Thank you very much.
I also got the same message. It disappeared after removing the automount package.
 
I honestly did not know that this was the development of the esteemed @vermaden.
Yep, it is. https://github.com/vermaden/automount
And yes, I meant automount(8)
Wrong man page ;)


After a bit of digging, procstat(1) is used exactly once in /usr/local/sbin/automount.
Code:
      for I in ${GROUP_USERS}
      do
        [ "${I}" = "root" ] && continue
        DISPLAY_ID=$( procstat pargs $( pgrep Xorg ) | grep "^argv\[1\]:" | awk '{print $NF}' )
        if [ -z "${DISPLAY_ID}" ]
        then
          continue
        fi
        __log "${DEV}: starting '${FM}' file manager"
        su -l "${I}" -c "env DISPLAY=${DISPLAY_ID} ${FM} ${MNT} &" 1> /dev/null 2>&1
      done
If pgrep Xorg doesn't return anything procstat pargs is executed with a missing argument. Which results in this error:
Code:
root@molly:~ # procstat pargs
usage: procstat [--libxo] [-h] [-M core] [-N system] [-w interval] command
                [pid ... | core ...]
       procstat [--libxo] -a [-h] [-M core] [-N system]  [-w interval] command
       procstat [--libxo] [-h] [-M core] [-N system] [-w interval]
                [-S | -b | -c | -e | -f [-C] | -i [-n] | -j [-n] | -k [-k] |
                 -l | -r [-H] | -s | -t | -v | -x] [pid ... | core ...]
       procstat [--libxo] -a [-h] [-M core] [-N system] [-w interval]
                [-S | -b | -c | -e | -f [-C] | -i [-n] | -j [-n] | -k [-k] |
                 -l | -r [-H] | -s | -t | -v | -x]
       procstat [--libxo] -L [-h] [-M core] [-N system] core ...
Available commands:
       advlock(s)
       argument(s)
       auxv
       basic
       binary
       [cpuset | cs]
       credential(s)
       environment
       [fd(s) | file(s)] [-C]
       kstack [-v]
       pargs
       penv
       ptlwpinfo
       pwdx
       rlimit
       rusage [-Ht]
       sigfastblock
       signal(s) [-n]
       thread(s)
       tsignal(s) [-n]
       vm
Which is exactly the error we've been looking for. I guess you get to see it when the system boots and Xorg hasn't started yet. That happens later, or not at all, depending on how you're starting Xorg. /usr/local/sbin/automount is triggered when devd(8) detects certain devices.
 
As for me, I start X with startx. And as for the situation with automount, I discovered it by accident. I have a Broadcom LSI SAS 9300-8i on my system and the HDDs on it show up as 'da0...da1...' in FreeBSD. When the system boots, automount tries to mount them in /media/daX... So I removed it. After that, this message disappeared.

Perhaps I did something wrong, and incorrectly configured to work with LSI SAS's HDDs.
 
I discovered it by accident.
That's how a lot of bugs are discovered ;)

Perhaps I did something wrong, and incorrectly configured to work with LSI SAS's HDDs.
No, that seems "by design", not because of an incorrect configuration. Automount looks for da(4) devices, as that's usually a USB stick or external drive. Most desktop machines typically use ada(4) drives internally, so there's no "confusion" between internal and external drives.
 
  • Thanks
Reactions: _al
Yes.

cat /etc/rc.local
#!/bin/sh
usbconfig -d ugen2.3 power_save

Webcam, fair enough.

apm -e enable
apm -d enable
apm -h enable

These are only not a problem because they don't do anything at all, because of some clever tidying up maybe 12? years ago when there were still a few APM BIOS laptops made. I had one between ~2003 and 2019.

ACPI precludes APM, and amd64 mode requires ACPI.

APM functions are now just emulated with corresponding ACPI functions, eg apm -z will suspend exactly as acpiconf -s3 will, apm derives battery info and state from where acpiconf -i0 does.

If not convinced, see
% less `which zzz` which shows that presence of sysctl machdep.apm_suspend_delay indicates real APM support, despite what
'apm -e enable' suggests.

Were these trying to solve some problem?
 
I also got the same message. It disappeared after removing the automount package.
Oh! Finally the culprit of the error appeared. I guess it will be a matter of updating the version of automount of Vermaden. This program is essential for me and I cannot uninstall it
 
Webcam, fair enough.



These are only not a problem because they don't do anything at all, because of some clever tidying up maybe 12? years ago when there were still a few APM BIOS laptops made. I had one between ~2003 and 2019.

ACPI precludes APM, and amd64 mode requires ACPI.

APM functions are now just emulated with corresponding ACPI functions, eg apm -z will suspend exactly as acpiconf -s3 will, apm derives battery info and state from where acpiconf -i0 does.

If not convinced, see
% less `which zzz` which shows that presence of sysctl machdep.apm_suspend_delay indicates real APM support, despite what
'apm -e enable' suggests.

Were these trying to solve some problem?
Some time ago I searched for information to improve the power consumption of the laptop and I just saw usbconfig -d ugen2.3 power_save for the webcam, and apm, but if that doesn't help, I have no problem removing it.
 
Yep, it is. https://github.com/vermaden/automount

Wrong man page ;)


After a bit of digging, procstat(1) is used exactly once in /usr/local/sbin/automount.
Code:
      for I in ${GROUP_USERS}
      do
        [ "${I}" = "root" ] && continue
        DISPLAY_ID=$( procstat pargs $( pgrep Xorg ) | grep "^argv\[1\]:" | awk '{print $NF}' )
        if [ -z "${DISPLAY_ID}" ]
        then
          continue
        fi
        __log "${DEV}: starting '${FM}' file manager"
        su -l "${I}" -c "env DISPLAY=${DISPLAY_ID} ${FM} ${MNT} &" 1> /dev/null 2>&1
      done
If pgrep Xorg doesn't return anything procstat pargs is executed with a missing argument. Which results in this error:
Code:
root@molly:~ # procstat pargs
usage: procstat [--libxo] [-h] [-M core] [-N system] [-w interval] command
                [pid ... | core ...]
       procstat [--libxo] -a [-h] [-M core] [-N system]  [-w interval] command
       procstat [--libxo] [-h] [-M core] [-N system] [-w interval]
                [-S | -b | -c | -e | -f [-C] | -i [-n] | -j [-n] | -k [-k] |
                 -l | -r [-H] | -s | -t | -v | -x] [pid ... | core ...]
       procstat [--libxo] -a [-h] [-M core] [-N system] [-w interval]
                [-S | -b | -c | -e | -f [-C] | -i [-n] | -j [-n] | -k [-k] |
                 -l | -r [-H] | -s | -t | -v | -x]
       procstat [--libxo] -L [-h] [-M core] [-N system] core ...
Available commands:
       advlock(s)
       argument(s)
       auxv
       basic
       binary
       [cpuset | cs]
       credential(s)
       environment
       [fd(s) | file(s)] [-C]
       kstack [-v]
       pargs
       penv
       ptlwpinfo
       pwdx
       rlimit
       rusage [-Ht]
       sigfastblock
       signal(s) [-n]
       thread(s)
       tsignal(s) [-n]
       vm
Which is exactly the error we've been looking for. I guess you get to see it when the system boots and Xorg hasn't started yet. That happens later, or not at all, depending on how you're starting Xorg. /usr/local/sbin/automount is triggered when devd(8) detects certain devices.
If I'm not mistaken, on my computer Xorg starts automatically, through the Lightweight Display Manager, using the Mate desktop. I don't know if I can somehow make Xorg start differently so I don't see the procstat message, but hey, knowing that it's caused by automount, if necessary, I ignore it.
 
Some time ago I searched for information to improve the power consumption of the laptop and I just saw usbconfig -d ugen2.3 power_save for the webcam,

That's likely worth up to 200mA. I use power_off and will turn it back on as needed.

I also set power_off on the fingerprint reader (100mA) and the big win of ~500 mA mW turning bluetooth off.

NB if you suspend, you need to also add your usbconfig power_{save,off} commands to the end of /etc/rc.resume or power is turned back on.

and apm, but if that doesn't help, I have no problem removing it.

It won't help. Tuning your powerd{,xx} settings might.
 
Yep, it is. https://github.com/vermaden/automount

Wrong man page ;)


After a bit of digging, procstat(1) is used exactly once in /usr/local/sbin/automount.
Code:
      for I in ${GROUP_USERS}
      do
        [ "${I}" = "root" ] && continue
        DISPLAY_ID=$( procstat pargs $( pgrep Xorg ) | grep "^argv\[1\]:" | awk '{print $NF}' )
        if [ -z "${DISPLAY_ID}" ]
        then
          continue
        fi
        __log "${DEV}: starting '${FM}' file manager"
        su -l "${I}" -c "env DISPLAY=${DISPLAY_ID} ${FM} ${MNT} &" 1> /dev/null 2>&1
      done
If pgrep Xorg doesn't return anything procstat pargs is executed with a missing argument. Which results in this error:
Code:
root@molly:~ # procstat pargs
usage: procstat [--libxo] [-h] [-M core] [-N system] [-w interval] command
                [pid ... | core ...]
       procstat [--libxo] -a [-h] [-M core] [-N system]  [-w interval] command
       procstat [--libxo] [-h] [-M core] [-N system] [-w interval]
                [-S | -b | -c | -e | -f [-C] | -i [-n] | -j [-n] | -k [-k] |
                 -l | -r [-H] | -s | -t | -v | -x] [pid ... | core ...]
       procstat [--libxo] -a [-h] [-M core] [-N system] [-w interval]
                [-S | -b | -c | -e | -f [-C] | -i [-n] | -j [-n] | -k [-k] |
                 -l | -r [-H] | -s | -t | -v | -x]
       procstat [--libxo] -L [-h] [-M core] [-N system] core ...
Available commands:
       advlock(s)
       argument(s)
       auxv
       basic
       binary
       [cpuset | cs]
       credential(s)
       environment
       [fd(s) | file(s)] [-C]
       kstack [-v]
       pargs
       penv
       ptlwpinfo
       pwdx
       rlimit
       rusage [-Ht]
       sigfastblock
       signal(s) [-n]
       thread(s)
       tsignal(s) [-n]
       vm
Which is exactly the error we've been looking for. I guess you get to see it when the system boots and Xorg hasn't started yet. That happens later, or not at all, depending on how you're starting Xorg. /usr/local/sbin/automount is triggered when devd(8) detects certain devices.

This seems to be in the old version in automount(8) daemon.

This is the newer code that does continue (in for loop) when there is no Xorg process.

Code:
      GROUP_USERS=$( pw group show ${MNT_GROUP} | sed -e 's|.*:||' -e 's|,| |g' )
      for I in ${GROUP_USERS}
      do
        [ "${I}" = "root" ] && continue
        XORG_PID=$( pgrep Xorg )
        [ "${XORG_PID}" = "" ] && continue
        DISPLAY_ID=$( procstat pargs ${XORG_PID} | grep "^argv\[1\]:" | awk '{print $NF}' )
        [ -z "${DISPLAY_ID}" ] && continue
        __log "${DEV}: starting '${FM}' file manager"
        su -l "${I}" -c "env DISPLAY=${DISPLAY_ID} ${FM} ${MNT} &" 1> /dev/null 2>&1
      done

Hope that helps.
 
Back
Top