-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4466 from adrianschroeter/sensysrq
[api][backend] allow to send sysrq to running jobs for maintainers
- Loading branch information
Showing
7 changed files
with
71 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2684,6 +2684,13 @@ sub docommand { | |
} | ||
BSUtil::ping("$eventdir/$arch/.ping") if -d "$eventdir/$arch"; | ||
} | ||
} elsif ($cmd eq 'sendsysrq') { | ||
for my $packid (@packids) { | ||
eval { | ||
sendsysrqtobuild($cgi, $projid, $repoid, $arch, $packid); | ||
}; | ||
warn("$@") if $@; | ||
} | ||
} elsif ($cmd eq 'killbuild' || $cmd eq 'abortbuild') { | ||
for my $packid (@packids) { | ||
eval { | ||
|
@@ -3070,6 +3077,23 @@ sub abortbuild { | |
return $BSStdServer::return_ok; | ||
} | ||
|
||
sub sendsysrqtobuild { | ||
my ($cgi, $projid, $repoid, $arch, $packid) = @_; | ||
|
||
my $job = findjob($projid, $repoid, $arch, $packid); | ||
die("not building\n") unless $job; | ||
local *F; | ||
my $js = BSUtil::lockopenxml(\*F, '<', "$jobsdir/$arch/$job:status", $BSXML::jobstatus); | ||
die("not building\n") if $js->{'code'} ne 'building'; | ||
my $req = { | ||
'uri' => "$js->{'uri'}/sysrq", | ||
'timeout' => 30, | ||
}; | ||
die("Unsupported sysrq\n") unless $cgi->{'sysrq'} =~ /^[0123456789cltwz ]$/; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
adrianschroeter
via email
Author
Member
|
||
BSRPC::rpc($req, undef, "jobid=$js->{'jobid'}", "sysrq=$cgi->{'sysrq'}"); | ||
return $BSStdServer::return_ok; | ||
} | ||
|
||
# | ||
# OBSOLETE: qemu shall be installed into the target system | ||
# FIXME3.0: remove this | ||
|
@@ -3934,7 +3958,7 @@ my $dispatches = [ | |
'/configuration' => \&getconfiguration, | ||
|
||
'/_result $prpa+ oldstate:md5? package* code:* lastbuild:bool? withbinarylist:bool? withstats:bool? summary:bool? withversrel:bool?' => \&getresult, | ||
'POST:/_command $cmd: $prpa+ package* code:*' => \&docommand, | ||
'POST:/_command $cmd: $prpa+ package* code:* sysrq:?' => \&docommand, | ||
|
||
'/serverstatus' => \&BSStdServer::serverstatus, | ||
'/ajaxstatus' => \&getajaxstatus, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule build
updated
25 files
+2 −2 | Build/Docker.pm | |
+25 −0 | Build/Rpm.pm | |
+3 −0 | Build/Rpmmd.pm | |
+66 −4 | Build/SimpleXML.pm | |
+3 −0 | Build/Susetags.pm | |
+1 −1 | Makefile | |
+45 −0 | baselibs_configs/baselibs_global-sle11.conf | |
+6 −4 | build-recipe-appimage | |
+1 −1 | build-recipe-kiwi | |
+2 −2 | build-vm | |
+17 −3 | changelog2spec | |
+1 −0 | common_functions | |
+0 −1 | computeblocklists | |
+0 −3 | configs/sl15.0.conf | |
+0 −2 | configs/sle15.0.conf | |
+1 −1 | createrepomddeps | |
+0 −26 | dist/build-mkbaselibs-sle.changes | |
+0 −62 | dist/build-mkbaselibs-sle.spec | |
+20 −0 | dist/build.changes | |
+14 −10 | dist/build.spec | |
+22 −23 | expanddeps | |
+4 −1 | extractbuild | |
+2 −1 | qemu-reg | |
+2 −2 | substitutedeps | |
+33 −0 | t/changelog2spec.t |
Add 'p' please.