Compare commits

...

3 Commits

Author SHA1 Message Date
Pragmatic Software cc1445be90
Update applets/cdecl.pl command and add cdecl to Dockerfile 2024-04-10 13:32:16 -07:00
Pragmatic Software 9ef521309a
pbot-vm: update documentation about how to start PBot VM after reboot 2024-04-10 13:09:58 -07:00
Pragmatic Software e25bde159f
pbot-vm: ignore -health and -revert used simultaneously to prevent double-revert 2024-04-10 12:53:37 -07:00
7 changed files with 26 additions and 2 deletions

View File

@ -41,6 +41,9 @@ RUN pip install git+https://github.com/garabik/unicode --break-system-packages
# paren/prec # paren/prec
RUN pip install 'pycparser==2.10' --break-system-packages RUN pip install 'pycparser==2.10' --break-system-packages
# cdecl
RUN apt-get -y install cdecl
WORKDIR /opt WORKDIR /opt
# Get PBot from GitHub # Get PBot from GitHub

2
applets/cdecl.pl vendored
View File

@ -16,7 +16,7 @@ if (@args < 2) {
$command = quotemeta($command); $command = quotemeta($command);
$command =~ s/\\ / /g; $command =~ s/\\ / /g;
my $result = `/usr/bin/cdecl -c $command`; my $result = `cdecl $command`;
chomp $result; chomp $result;
$result =~ s/\n/, /g; $result =~ s/\n/, /g;

View File

@ -263,6 +263,11 @@ sub main() {
configure_context($context, $config); configure_context($context, $config);
if ($context->{revert} && $context->{health}) {
print STDERR "-health and -revert cannot be used together; aborting.\n";
exit 0;
}
# instructed to revert machine # instructed to revert machine
if ($context->{revert}) { if ($context->{revert}) {
if (exists $config->{aliases}->{$context->{'vm-domain'}}) { if (exists $config->{aliases}->{$context->{'vm-domain'}}) {

View File

@ -83,6 +83,14 @@ In your instance of PBot, the `sh` and `cc`, etc, commands should now produce ou
<pragma-> sh echo Hello world! <pragma-> sh echo Hello world!
<PBot> Hello world! <PBot> Hello world!
### Starting PBot VM again
To start the PBot VM again, e.g. after a reboot:
cd applets/pbot-vm/host/bin
virsh -c qemu:///system net-start vagrant-libvirt
virsh -c qemu:///system snapshot-revert $PBOTVM_DOMAIN 1 # for each $PBOTVM_DOMAIN you need to start
./vm-server
### Shutdown Vagrant Box ### Shutdown Vagrant Box
vagrant halt vagrant halt

View File

@ -353,6 +353,7 @@
* [Initial virtual machine set-up complete](VirtualMachine.md#initial-virtual-machine-set-up-complete) * [Initial virtual machine set-up complete](VirtualMachine.md#initial-virtual-machine-set-up-complete)
* [Start PBot VM Host](VirtualMachine.md#start-pbot-vm-host) * [Start PBot VM Host](VirtualMachine.md#start-pbot-vm-host)
* [Test PBot](VirtualMachine.md#test-pbot) * [Test PBot](VirtualMachine.md#test-pbot)
* [Starting PBot VM again](VirtualMachine.md#starting-pbot-vm-again)
* [Adding additional VMs](VirtualMachine.md#adding-additional-vms) * [Adding additional VMs](VirtualMachine.md#adding-additional-vms)
* [QEMU command from libvirt](VirtualMachine.md#qemu-command-from-libvirt) * [QEMU command from libvirt](VirtualMachine.md#qemu-command-from-libvirt)
<!-- md-toc-end --> <!-- md-toc-end -->

View File

@ -510,6 +510,13 @@ In your instance of PBot, the `sh echo hello` command should output `hello`.
<pragma-> sh echo hello <pragma-> sh echo hello
<PBot> hello <PBot> hello
## Starting PBot VM again
To start the PBot VM again, e.g. after a reboot:
cd applets/pbot-vm/host/bin
virsh snapshot-revert $PBOTVM_DOMAIN 1 # for each $PBOTVM_DOMAIN you need to start
./vm-server
## Adding additional VMs ## Adding additional VMs
You may add as many virtual machines as you like. The virtual machines can exist on different physical machines. You may add as many virtual machines as you like. The virtual machines can exist on different physical machines.
Edit the [`vm-exec.json`](../applets/pbot-vm/host/config/vm-exec.json) configuration file with the details (IP addresses Edit the [`vm-exec.json`](../applets/pbot-vm/host/config/vm-exec.json) configuration file with the details (IP addresses

View File

@ -25,7 +25,7 @@ use PBot::Imports;
# These are set by the /misc/update_version script # These are set by the /misc/update_version script
use constant { use constant {
BUILD_NAME => "PBot", BUILD_NAME => "PBot",
BUILD_REVISION => 4741, BUILD_REVISION => 4747,
BUILD_DATE => "2024-04-10", BUILD_DATE => "2024-04-10",
}; };