Public bug reported:

I was patching the init script for Arpwatch so that it would be LSB
compliant (adding status) and came across this issue.  I believe it
differs from the similarly named bug with code 3/4 problems.

Arpwatch not running.  Using the status_of_proc function.  Return code
is 0.  According to the LSB standard it should be a return code 3.  In
the pidofproc() section the match is on line 97 which in turn returns
code 3 on line 98.  However when testing this pidofproc() function it
first returns the 3 from line 98 and then it returns 0 from line 100.
No idea why it returns 0 after returning 3? And then if it returned 0
why is it matching on the final else in status_of_proc (anything but 0
or 4?) lines 183/184?

    if [ -x /bin/pidof -a ! "$specified" ]; then
        status="0"
        /bin/pidof -o %PPID -x $1 || status="$?"
        if [ "$status" = 1 ]; then
            return 3 # program is not running
        fi
        return 0
    fi

The bug for the related Arpwatch package is LP: 806145.

1) Description: Ubuntu 10.04.2 LTS
    Release: 10.04

2)lsb-base:
  Installed: 4.0-0ubuntu8
  Candidate: 4.0-0ubuntu8
  Version table:
 *** 4.0-0ubuntu8 0
        500 http://us.archive.ubuntu.com/ubuntu/ lucid/main Packages
        100 /var/lib/dpkg/status

** Affects: lsb (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/806677

Title:
  status_of_proc returns incorrect number

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lsb/+bug/806677/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to