Public bug reported:

I am using invoke-rc.d on Vivid and have observed what appears to be
incorrect behavior. I have a systemd service installed that is masked
and I am attempting to use invoke-rc.d to obtain its status.

However, the exit code is 0, which falsely suggests that the service is
running. If I run "systemctl status myservice" directly for the masked
service, the exit code is 3, as expected.

This makes it impossible to determine if the service is in fact running
without resorting to systemd commands. I'm developing a package that
runs on releases that use init and releases that use systemd. The
packaging includes an init script and a systemd unit file. I need an
"init-agnostic" command for restarting the service in the .logrotate
file.

I dug a bit into the source code and found that line 407 contains "exit
0". I don't understand why anyone would want the return code for a
running service and a masked service to be identical. I assume this is a
bug.

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: sysv-rc 2.88dsf-53.2ubuntu12
ProcVersionSignature: Ubuntu 3.19.0-30.34-generic 3.19.8-ckt6
Uname: Linux 3.19.0-30-generic x86_64
ApportVersion: 2.17.2-0ubuntu1.5
Architecture: amd64
CurrentDesktop: Unity
Date: Thu Oct 29 23:37:05 2015
InstallationDate: Installed on 2015-06-01 (150 days ago)
InstallationMedia: Ubuntu 15.04 "Vivid Vervet" - Release amd64 (20150422)
PackageArchitecture: all
SourcePackage: sysvinit
UpgradeStatus: Upgraded to vivid on 2015-10-22 (7 days ago)

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


** Tags: amd64 apport-bug vivid

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

Title:
  invoke-rc.d uses incorrect exit code

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

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

Reply via email to