Bug 729932 - systemd returns [OK] when program is not configured
Summary: systemd returns [OK] when program is not configured
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 15
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lennart Poettering
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-11 10:24 UTC by Honza Horak
Modified: 2011-10-03 14:30 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-10-03 14:30:34 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Honza Horak 2011-08-11 10:24:18 UTC
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 16:02:28 UTC
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 14:30:34 UTC
(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.