Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1048123

Summary: `systemctl start' returns 0 despite not starting anything
Product: Red Hat Enterprise Linux 7 Reporter: Miroslav Franc <mfranc>
Component: glibcAssignee: Siddhesh Poyarekar <spoyarek>
Status: CLOSED CURRENTRELEASE QA Contact: Arjun Shankar <ashankar>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.0CC: ashankar, codonell, fweimer, lnykryn, mcermak, mnewsome, ohudlick, pfrankli, spoyarek, systemd-maint-list, tim
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: glibc-2.17-50.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1070416 (view as bug list) Environment:
Last Closed: 2014-06-13 12:54:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Miroslav Franc 2014-01-03 09:07:15 UTC
Description of problem:

I would expect non-zero return status in case `systemctl start' is unable to start my service.


Version: systemd-207-9.el7


# systemctl status nscd
nscd.service - Name Service Cache Daemon
   Loaded: loaded (/usr/lib/systemd/system/nscd.service; disabled)
   Active: failed (Result: start-limit) since Fri 2014-01-03 03:55:07 EST; 17s ago
  Process: 17138 ExecStop=/usr/sbin/nscd --shutdown (code=exited, status=1/FAILURE)
  Process: 17136 ExecStart=/usr/sbin/nscd --foreground $NSCD_OPTIONS (code=exited, status=1/FAILURE)
 Main PID: 17136 (code=exited, status=1/FAILURE)

# systemctl start nscd
# echo $?
0
# systemctl status nscd
nscd.service - Name Service Cache Daemon
   Loaded: loaded (/usr/lib/systemd/system/nscd.service; disabled)
   Active: failed (Result: start-limit) since Fri 2014-01-03 03:55:29 EST; 9s ago
  Process: 17168 ExecStop=/usr/sbin/nscd --shutdown (code=exited, status=1/FAILURE)
  Process: 17166 ExecStart=/usr/sbin/nscd --foreground $NSCD_OPTIONS (code=exited, status=1/FAILURE)
 Main PID: 17166 (code=exited, status=1/FAILURE)

Comment 2 Lukáš Nykrýn 2014-01-07 13:50:55 UTC
Nscd.service is Type=simple. This option is for well-behaved daemon which can handle error situation by itself and does not quit. For this type systemctl considers that start action was successful in the case that the binary was started.

Solution here is to change ncsd daemon to handle error situations or change type to forking and remove the --foreground parameter.

Comment 5 Timothée Ravier 2014-02-27 18:31:48 UTC
Another solution (as forking is not really necessary here): nscd would have to tell systemd at some point that it cannot start. This can be done by patching nscd to use sd_notify http://www.freedesktop.org/software/systemd/man/sd_notify.html and changing the unit type to notify.

Comment 6 Carlos O'Donell 2014-02-27 19:05:18 UTC
(In reply to Timothée Ravier from comment #5)
> Another solution (as forking is not really necessary here): nscd would have
> to tell systemd at some point that it cannot start. This can be done by
> patching nscd to use sd_notify
> http://www.freedesktop.org/software/systemd/man/sd_notify.html and changing
> the unit type to notify.

We do not wish to patch nscd to depend on systemd, instead we are going to switch to forking with the parent waiting for the child to startup and the child providing an error code to the parent when startup is complete.

See the upstream discussion around here:
https://sourceware.org/ml/libc-alpha/2014-02/msg00747.html

We are going to have a solution in place that will make this work reliably.

Comment 17 Ludek Smid 2014-06-13 12:54:09 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.