Bug 812554 - Shutting down target does not shutdown it's units.
Shutting down target does not shutdown it's units.
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
16
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: systemd-maint
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-14 15:33 EDT by Jóhann B. Guðmundsson
Modified: 2012-04-16 15:14 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-04-16 06:42:54 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jóhann B. Guðmundsson 2012-04-14 15:33:44 EDT
Description of problem:

The summary says it all

Version-Release number of selected component (if applicable):

systemd-37-17.fc16.x86_64

How reproducible:

Always

Steps to Reproduce:
1. Create test target 
2. Create a test service and link it to the test.target.wants directory
3. Start the test target
4. Check the status of the test target and the test service
5. Stop the test target
6. Check the status of the test target and the test service

Actual results:

Starting the test target, starts the test target and it's test service however stopping the test target does not stop the test service

Expected results:

The test service to be stopped when test target is stopped.

Additional info:
Comment 1 Michal Schmidt 2012-04-16 06:42:54 EDT
The expectation is baseless. When the service has no requirement dependency on the target, there's no reason to stop the service.

You can however get the behaviour you want by using StopWhenUnneeded=yes in the service unit. Or you may want to add some kind of a requirement dependency of the service on the target. It depends on the specific scenario.
Comment 2 Jóhann B. Guðmundsson 2012-04-16 15:14:08 EDT
In this case I was testing template units as in creating a test.target then generate 50 dummy services which got linked into the test.target.wants directory then start the target to ensure those 50 template based unit got started and stopping it again to ensure those 50 units got stopped when the test.target was stopped.

So what's the best way you think to solve that to get those 50 template based units stopped when the test.target gets stopped since I think the best way to solve the lack of [Install] section in template based unit is this approach and I'm pretty sure that it would not before long that an request would fly in to be able to shutdown all the units in given target?

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