Bug 1255432 - transient unit remain when is in failed state
transient unit remain when is in failed state
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
Jakub Prokes
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-20 10:47 EDT by Jakub Prokes
Modified: 2015-08-26 06:48 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-26 06:46:35 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-20 10:47:04 EDT
Description of problem:
If transient unit don't terminate itself in timeout and is killed, it remained in units list and cannot be started again.


Version-Release number of selected component (if applicable):
systemd-219-9.el7.x86_64

How reproducible:
systemd-219-9.el7.x86_64

Steps to Reproduce:
1.systemd-run --unit foo ./daemon.sh
2.systemctl stop foo.service
3.systemctl -l status foo.service
3.systemctl stop foo.service
4.systemd-run --unit foo ./daemon.sh

Actual results:
● foo.service - /mnt/testarea/test/./daemon.sh
   Loaded: loaded (/run/systemd/system/foo.service; static; vendor preset: disabled)
  Drop-In: /run/systemd/system/foo.service.d
           └─50-Description.conf, 50-ExecStart.conf
   Active: failed (Result: signal) since Thu 2015-08-20 10:31:59 EDT; 9s ago
  Process: 2567 ExecStart=/mnt/testarea/test/./daemon.sh (code=killed, signal=KILL)
 Main PID: 2567 (code=killed, signal=KILL)

Aug 20 10:29:35 qeos-50.lab.eng.rdu2.redhat.com daemon.sh[2567]: trap -- 'catchSignal TERM' SIGTERM
Aug 20 10:29:35 qeos-50.lab.eng.rdu2.redhat.com daemon.sh[2567]: trap -- 'catchSignal ALRM' SIGVTALRM
Aug 20 10:30:29 qeos-50.lab.eng.rdu2.redhat.com systemd[1]: Stopping /mnt/testarea/test/./daemon.sh...
Aug 20 10:30:29 qeos-50.lab.eng.rdu2.redhat.com daemon.sh[2567]: Terminated
Aug 20 10:30:29 qeos-50.lab.eng.rdu2.redhat.com daemon.sh[2567]: TERM cought
Aug 20 10:31:59 qeos-50.lab.eng.rdu2.redhat.com systemd[1]: foo.service stop-sigterm timed out. Killing.
Aug 20 10:31:59 qeos-50.lab.eng.rdu2.redhat.com systemd[1]: foo.service: main process exited, code=killed, status=9/KILL
Aug 20 10:31:59 qeos-50.lab.eng.rdu2.redhat.com systemd[1]: Stopped /mnt/testarea/test/./daemon.sh.
Aug 20 10:31:59 qeos-50.lab.eng.rdu2.redhat.com systemd[1]: Unit foo.service entered failed state.
Aug 20 10:31:59 qeos-50.lab.eng.rdu2.redhat.com systemd[1]: foo.service failed.


Failed to start transient service unit: Unit foo.service already exists.

Expected results:
some way to vaporize transient unit and have chance to use same name again.

Additional info:
[0 root@qeos-50 test]# cat ./daemon.sh 
#!/bin/bash

function catchSignal() {
	echo "$@ cought" >&2;
}

trap "catchSignal HUP" SIGHUP;
trap "catchSignal TERM" SIGTERM;
trap "catchSignal KILL" SIGKILL;
trap "catchSignal ALRM" SIGVTALRM;

trap -p;

while true; do
	sleep 60;
done;
Comment 2 Lukáš Nykrýn 2015-08-20 11:49:56 EDT
> Expected results:
> some way to vaporize transient unit and have chance to use same name again.

reset-failed?


[root@notas ~]# systemd-run --unit test false
Running as unit test.service.
[root@notas ~]# 
[root@notas ~]# systemd-run --unit test false
Failed to start transient service unit: Unit test.service already exists.
[root@notas ~]# systemctl reset-failed test
[root@notas ~]# systemd-run --unit test false
Running as unit test.service.

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