Bug 729932 - systemd returns [OK] when program is not configured
systemd returns [OK] when program is not configured
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
15
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Lennart Poettering
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-11 06:24 EDT by Honza Horak
Modified: 2011-10-03 10:30 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-10-03 10:30:34 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Honza Horak 2011-08-11 06:24:18 EDT
Description of problem:
When we start a service (which uses SysV init script) using the old style (service test start), systemd prints [OK] or [FAILED] according the returned code. 

If the init script returns 6 (program is not configured), systemd prints [OK] instead of [FAILED]. This can confuse a user, because he sees [OK], but no service is actually started. Asking systemd for a service's status after then works fine. 

Version-Release number of selected component (if applicable):
systemd-26-8.fc15.x86_64

How reproducible:
every-time

Steps to Reproduce:
1. create a very simple SysV init file in /etc/init.d/test:
#!/bin/bash
# Source function library.
. /etc/init.d/functions
exit 6
2. run "systemctl daemon-reload"
3. run "service test start"
4. see output
  
Actual results:
Starting test (via systemctl):                             [  OK  ]

Expected results:
Starting test (via systemctl):  Job failed. See system logs and 'systemctl status' for details.
                                                           [FAILED]

Additional info:
Info about init script return codes: http://fedoraproject.org/wiki/Packaging:SysVInitScript#Exit_Codes_for_non-Status_Actions

When we change exit code in init script to 1, 2, 3 or 4, it works as expected. 

I think one of the following changes will fix this issue:
1) to print [FAILED] even if code 5 or 6 is returned
2) not print any message at all, like it is done when we use "systemctl start test.service"
Comment 1 Michal Schmidt 2011-09-30 12:02:28 EDT
LSB exit codes 5 and 6 have been intentionally treated as success since the fix for bug 619931.
Comment 2 Honza Horak 2011-10-03 10:30:34 EDT
(In reply to comment #1)
> LSB exit codes 5 and 6 have been intentionally treated as success since the fix
> for bug 619931.

Personally, I don't like this solution, but I definitely can live with that. Since nobody else has a problem with that, I'm closing this.

Note You need to log in before you can comment on or make changes to this bug.