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 1255031 - remain-after-exit doesn't work in transient units
Summary: remain-after-exit doesn't work in transient units
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: systemd-maint
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-19 13:10 UTC by Jakub Prokes
Modified: 2015-08-24 14:05 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-19 22:48:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jakub Prokes 2015-08-19 13:10:00 UTC
Description of problem:
According to documentation systemd-run and systemd.service, unit should stay in "active" status after process end, but thats not happen.

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


How reproducible:


Steps to Reproduce:
1.systemd-run --unit test2 true --remain-after-exit
2.systemctl -l status test2.service
3.

Actual results:
[0 root@qeos-48 test]# systemd-run --unit test2 true --remain-after-exit
Running as unit test2.service.
[0 root@qeos-48 test]# systemctl -l status test2.service
● test2.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

Aug 19 09:08:10 qeos-48.lab.eng.rdu2.redhat.com systemd[1]: Started /usr/bin/true --remain-after-exit.
Aug 19 09:08:10 qeos-48.lab.eng.rdu2.redhat.com systemd[1]: Starting /usr/bin/true --remain-after-exit...

Expected results:


Additional info:

Comment 2 Lukáš Nykrýn 2015-08-19 22:48:24 UTC
I think that the problem is that the remain-after-exit parameter is added to the command true, you should call
systemd-run --unit test2 --remain-after-exit true
then, at least on fedora, it works fine.

Comment 3 Jakub Prokes 2015-08-24 14:05:50 UTC
Thats true, I have been writing comment in parallel to you. Automated test works now. Sorry for disturbing.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: unit --remain-after-exit
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Command 'systemd-run --unit test --remain-after-exit true' (Expected 0, got 0)
:: [   PASS   ] :: Command 'systemctl -l status test.service' (Expected 0, got 0)
:: [   PASS   ] :: Command 'systemctl stop test.service' (Expected 0, got 0)
:: [   PASS   ] :: Command 'systemctl -l status test.service' (Expected 3, got 3)
:: [   PASS   ] :: Command 'systemd-run --unit test true' (Expected 0, got 0)
:: [   PASS   ] :: Command 'systemctl -l status test.service' (Expected 3, got 3)
:: [   PASS   ] :: Command 'systemctl stop test.service' (Expected 5, got 5)
:: [   LOG    ] :: Duration: 11s
:: [   LOG    ] :: Assertions: 7 good, 0 bad
:: [   PASS   ] :: RESULT: unit --remain-after-exit


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