Bug 1255031 - remain-after-exit doesn't work in transient units
remain-after-exit doesn't work in transient units
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd (Show other bugs)
7.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: systemd-maint
qe-baseos-daemons
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-19 09:10 EDT by Jakub Prokes
Modified: 2015-08-24 10:05 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-19 18:48:24 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 Jakub Prokes 2015-08-19 09:10:00 EDT
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 18:48:24 EDT
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 10:05:50 EDT
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.