summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2018-10-28 20:10:25 +0100
committerDaniil Baturin <daniil@baturin.org>2018-10-28 20:10:25 +0100
commit0ea64f7c139685066663117aa30c52fb9aeb5680 (patch)
treec43f97eb78b317a4aae31c6764099aa524b664f8
parentadf0dac4bc7a42303d49e2ed03ac9d0d888a157e (diff)
parent92c15a6c1268eb28738899d85568d051124f8f51 (diff)
downloadvyatta-op-0ea64f7c139685066663117aa30c52fb9aeb5680.tar.gz
vyatta-op-0ea64f7c139685066663117aa30c52fb9aeb5680.zip
Merge branch 'current' into crux
Conflicts: debian/changelog
-rw-r--r--debian/changelog8
-rwxr-xr-xscripts/vyatta-reboot.pl50
2 files changed, 46 insertions, 12 deletions
diff --git a/debian/changelog b/debian/changelog
index 9c62b0c..1e1d6ca 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,10 @@
-vyatta-op (1.2.0-1) stable; urgency=medium
+vyatta-op (0.14.0+vyos2+current7) unstable; urgency=medium
- * New branch.
+ * T870: Commit-confirm restarts the server even after commit
+
+ - show reboot now also show if scheduled via commit-confirm or systemd.
- -- Daniil Baturin <daniil@baturin.org> Fri, 28 Sep 2018 22:03:28 +0200
+ -- hagbard <vyosdev@derith.de> Tue, 09 Oct 2018 16:07:22 -0700
vyatta-op (0.14.0+vyos2+current6) unstable; urgency=medium
diff --git a/scripts/vyatta-reboot.pl b/scripts/vyatta-reboot.pl
index 860e3da..93cda4f 100755
--- a/scripts/vyatta-reboot.pl
+++ b/scripts/vyatta-reboot.pl
@@ -33,7 +33,7 @@ use strict;
use warnings;
my $reboot_job_file = '/var/run/reboot.job';
-
+my $confirm_job_file = '/var/run/confirm.job';
sub parse_at_output {
my @lines = @_;
@@ -49,18 +49,50 @@ sub parse_at_output {
}
sub is_reboot_pending {
-
- if ( ! -f $reboot_job_file) {
- return (0, '');
- }
+ ### that won't exist anymore but may be called somewhere else
+ if ( -f $reboot_job_file )
+ {
my $job = `cat $reboot_job_file`;
chomp $job;
my $line = `atq $job`;
- if ($line =~ /\d+\s+(.*)\sa root$/) {
- return (1, $1);
- } else {
- return (0, '');
+ if ($line =~ /\d+\s+(.*)\sa root$/)
+ {
+ return (1, $1);
+ }
+ else
+ {
+ return (0, '');
+ }
+ }
+
+ #### comit-confirm creates an at job as well
+ if ( -f $confirm_job_file)
+ {
+ my $job = `cat $confirm_job_file`;
+ chomp $job;
+ my $line = `atq $job`;
+ if ($line =~ /\d+\s+(.*)\sa root$/)
+ {
+ return (1, $1);
+ }
+ else
+ {
+ return (0, '');
+ }
+ }
+ #### an now the systemd job from powrctrl.py
+ my $line = `systemctl status systemd-shutdownd.service`;
+ if ($line =~ /Active: active/)
+ {
+ if($line =~ m/Status:(.*)/)
+ {
+ return (1, $1);
}
+ }
+ else
+ {
+ return (0, '');
+ }
}
sub do_reboot {