Bug 259062 - multimedia/webcamd doesn't keep quiet and always tries to start
Summary: multimedia/webcamd doesn't keep quiet and always tries to start
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Hans Petter Selasky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-11 07:45 UTC by Michael
Modified: 2021-10-12 18:28 UTC (History)
1 user (show)

See Also:


Attachments
Patch to try for the webcamd port (2.03 KB, patch)
2021-10-12 08:28 UTC, Hans Petter Selasky
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael 2021-10-11 07:45:22 UTC
whether you have webcamd_enable=NO or nothing in your rc.conf, even if you haven't one it keeps spitting: cannot start into the log 

solution is uninstalling it or somebody correcting the rc file of it
Comment 1 Hans Petter Selasky freebsd_committer freebsd_triage 2021-10-11 20:32:19 UTC
Hi,

1) Can you manually run this command and show its output when webcamd_enable= is commented out?

/usr/local/etc/rc.d/webcamd start ugen99.99
Cannot 'start' webcamd. Set webcamd_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'.

2) Can you check that you didn't overlook a "webcamd_enable=YES":

grep -r webcamd /etc/rc.d /usr/local/etc/rc.d

--HPS
Comment 2 Michael 2021-10-12 07:07:58 UTC
(In reply to Hans Petter Selasky from comment #1)

Hi, thanks for the fast answer

the cases you mentioned are ok, I can not check cases YES because I do not have a webcam, so now:

whether I have webcamd_enable=NO in rc.conf or not (nothing), on boot I get the following message 4 times repeated:

cannot start webcamd, Set webcamd_enable to YES in rc.conf or use onestart instead of start


I think in both cases, not set or set to NO, webcamd should be quiet
Comment 3 Hans Petter Selasky freebsd_committer freebsd_triage 2021-10-12 08:28:12 UTC
Created attachment 228619 [details]
Patch to try for the webcamd port

Can you try this patch?
Comment 4 commit-hook freebsd_committer freebsd_triage 2021-10-12 08:48:04 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b12212190261b8694be357bf2f052effacc06cc0

commit b12212190261b8694be357bf2f052effacc06cc0
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2021-10-12 08:38:15 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2021-10-12 08:46:46 +0000

    multimedia/webcamd: Silence prints from rc script when webcamd is disabled.

    PR:             259062
    Approved by:    pi (implicit)

 multimedia/webcamd/Makefile              |  2 +-
 multimedia/webcamd/files/webcamd.conf.in | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)
Comment 5 Hans Petter Selasky freebsd_committer freebsd_triage 2021-10-12 08:49:51 UTC
I believe my patch will fix your issue. Let me know if not.
Comment 6 Michael 2021-10-12 08:53:10 UTC
(In reply to Hans Petter Selasky from comment #5)

I can do it later today and come back then, thank you
Comment 7 Michael 2021-10-12 15:21:24 UTC
(In reply to Hans Petter Selasky from comment #5)

hey, I just looked it over, correct me if I'm wrong

webcamd shouldn't even try to start when following conditions are met:

- no hardware installed
- webcamd_enable does not exist in rc.conf
- webcamd_enable=NO

your patch silence the failing start message in all 4 cases, right?

I helped myself out so far with this at the beginning of rc.d/webcamd script

#################################################
if [ $webcamd_enable ]; then
                if [ $webcamd_enable="NO" ]; then
                        # webcam disabled 
                        exit;
                fi;
        else
                # webcam not installed  
                exit;
fi;
#################################################

# If invoked automatically by devd, we receive additional arguments
devd_device=${2}
devd_interface=${3-0}
Comment 8 Hans Petter Selasky freebsd_committer freebsd_triage 2021-10-12 16:33:27 UTC
Hi,

webcamd has two parts, one devd part and one /etc/rc.conf part so to speak.

The devd part is always executed, but does not do anything when webcamd_enable="NO". That is the expected behaviour.

The error message you are seeing is generic, and blocks all rc.d scripts which are disabled from starting with "service start".

> webcamd shouldn't even try to start when following conditions are met:
> 
> - no hardware installed
> - webcamd_enable does not exist in rc.conf
> - webcamd_enable=NO

webcamd doesn't start. The error message you see comes from the rc.d script itself.

--HPS
Comment 9 Michael 2021-10-12 18:28:47 UTC
(In reply to Hans Petter Selasky from comment #8)

thanks for explanation and fast response :)