Bug 812554 - Shutting down target does not shutdown it's units.
Summary: Shutting down target does not shutdown it's units.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-14 19:33 UTC by Jóhann B. Guðmundsson
Modified: 2012-04-16 19:14 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-04-16 10:42:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jóhann B. Guðmundsson 2012-04-14 19:33:44 UTC
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 10:42:54 UTC
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 19:14:08 UTC
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.