在他们的网站上,您被要求通过脚本安装他们的程序,而不是像大多数常规应用程序那样通过软件包存储库下载。
LV_BRANCH='release-1.4/neovim-0.9' bash <(curl -s https://raw.githubusercontent.com/LunarVim/LunarVim/release-1.4/neovim-0.9/utils/installer/install.sh)
安装过程,但我想创建一个脚本来回答这些问题。如何编写一个命令来自动处理这些问题?
在他们的网站上,您被要求通过脚本安装他们的程序,而不是像大多数常规应用程序那样通过软件包存储库下载。
LV_BRANCH='release-1.4/neovim-0.9' bash <(curl -s https://raw.githubusercontent.com/LunarVim/LunarVim/release-1.4/neovim-0.9/utils/installer/install.sh)
安装过程,但我想创建一个脚本来回答这些问题。如何编写一个命令来自动处理这些问题?
正如标题所述,无论出于什么原因,我的虚拟机都无法再连接到主机/互联网。e1000e
连接确实有效。
那么问题似乎出在 virtio 上?
在主机上:
知识产权
...
4: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 52:54:00:8c:9c:74 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
9: vnet4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master virbr0 state UNKNOWN group default qlen 1000
link/ether fe:54:00:8d:cd:66 brd ff:ff:ff:ff:ff:ff
inet6 fe80::fc54:ff:fe8d:cd66/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
sudo virsh net-dumpxml 默认值
<network connections='1'>
<name>default</name>
<uuid>b728bff2-6215-4472-8d38-a5a797d328aa</uuid>
<forward mode='nat'>
<nat>
<port start='1024' end='65535'/>
</nat>
</forward>
<bridge name='virbr0' stp='on' delay='0'/>
<mac address='52:54:00:8c:9c:74'/>
<ip address='192.168.122.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.122.2' end='192.168.122.254'/>
</dhcp>
</ip>
</network>
关于客人:
xml 中的 virt-manager 连接配置
<network connections="1">
<name>default</name>
<uuid>b728bff2-6215-4472-8d38-a5a797d328aa</uuid>
<forward mode="nat">
<nat>
<port start="1024" end="65535"/>
</nat>
</forward>
<bridge name="virbr0" stp="on" delay="0"/>
<mac address="52:54:00:8c:9c:74"/>
<ip address="192.168.122.1" netmask="255.255.255.0">
<dhcp>
<range start="192.168.122.2" end="192.168.122.254"/>
</dhcp>
</ip>
</network>
网络设备
<interface type="network">
<mac address="52:54:00:8d:cd:66"/>
<source network="default" portid="94cebc1a-2b7b-41ba-91a4-22958fe3aef4" bridge="virbr0"/>
<target dev="vnet4"/>
<model type="virtio"/>
<alias name="net0"/>
<address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
</interface>
设置
主持人
OS: Manjaro XFCE x86_64
Apps: packer (plugins: virtualbox-iso),
客人
OS: Arch Linux
Hypervisor: Virtualbox
Architecture: x64
我的打包器构建文件(为了简单起见,删除了 qemu 构建)
packer {
required_plugins {
virtualbox = {
version = ">=1.0.4"
source = "github.com/hashicorp/virtualbox"
}
}
}
variable "ssh_private_key_file" {
type = string
default = "~/.ssh/id_bas"
}
variable "ssh_timeout" {
type = string
default = "20m"
validation {
condition = can(regex("[0-9]+[smh]", var.ssh_timeout))
error_message = "The ssh_timeout value must be a number followed by the letter s(econds), m(inutes), or h(ours)."
}
}
variable "ssh_username" {
description = "Unpriviledged user to create."
type = string
default = "bas"
}
locals {
boot_command_virtualbox = [
"<enter><wait90s>",
"curl -O http://10.0.2.3:{{ .HTTPPort }}/${local.kickstart_script} && ",
"chmod +x ${local.kickstart_script} && ",
"LOCAL_IP=10.0.2.3 ",
"LOCAL_PORT={{ .HTTPPort }} ",
"PACKER_BUILDER_TYPE=iso-virtualbox ",
"./${local.kickstart_script}<enter>",
]
cpus = 1
disk_size = "4G"
disk_size_vb = "4000"
efi_firmware_code = "/usr/share/edk2/x64/OVMF_CODE.fd"
efi_firmware_vars = "/usr/share/edk2/x64/OVMF_VARS.fd"
headless = "false"
iso_checksum = "sha256:329b00c3e8cf094a28688c50a066b5ac6352731ccdff467f9fd7155e52d36cec"
iso_url = "https://mirror.cj2.nl/archlinux/iso/2023.06.03/archlinux-x86_64.iso"
kickstart_script = "initLiveVM.sh"
machine_type = "q35"
memory = 4096
http_directory = "srv"
vm_name = "SE_bastille-installer-box"
write_zeros = "true"
}
source "virtualbox-iso" "archlinux" {
boot_command = local.boot_command_virtualbox
boot_wait = "2s"
communicator = "ssh"
cpus = 1
disk_size = local.disk_size_vb
firmware = "efi"
format = "ovf"
guest_additions_mode = "disable"
guest_os_type = "Arch"
hard_drive_interface = "virtio"
headless = local.headless
http_directory = local.http_directory
iso_checksum = local.iso_checksum
iso_interface = "virtio"
iso_url = local.iso_url
memory = local.memory
nic_type = "virtio"
shutdown_command = "sudo systemctl start poweroff.timer"
ssh_port = 22
ssh_private_key_file = var.ssh_private_key_file
ssh_timeout = var.ssh_timeout
ssh_username = var.ssh_username
vm_name = "${local.vm_name}.ovf"
}
build {
name = "SE_bastille-installer-box"
sources = ["source.virtualbox-iso.archlinux"]
provisioner "file" {
destination = "/tmp/"
source = "./files"
}
provisioner "shell" {
only = ["virtualbox-iso.archlinux"]
execute_command = "{{ .Vars }} sudo -E -S bash '{{ .Path }}'"
expect_disconnect = true
scripts = [
"scripts/liveVM.sh",
"scripts/virtualbox.sh",
"scripts/tables.sh",
"scripts/partitions.sh",
"scripts/base.sh",
"scripts/bootloader.sh",
"scripts/pacman.sh",
"scripts/setup.sh"
]
}
provisioner "shell" {
execute_command = "{{ .Vars }} WRITE_ZEROS=${local.write_zeros} sudo -E -S bash '{{ .Path }}'"
script = "scripts/cleanup.sh"
}
post-processor "vagrant" {
output = "output/${local.vm_name}_${source.type}_${source.name}-${formatdate("YYYY-MM", timestamp())}.box"
vagrantfile_template = "templates/vagrantfile.tpl"
}
}
我究竟做错了什么?
OS: Manjaro XFCE x86_64
Apps: packer (plugins: qemu),
virt-manager, virt-install
virt-viewer
OS: Arch Linux
Hypervisor: QEMU KVM
Architecture: x64
Machine Type: q35
EFI Firmware Code: /usr/share/edk2/x64/OVMF_CODE.4m.fd
EFI Firmware Vars: /usr/share/edk2/x64/OVMF_VARS.4m.fd
我使用并记录我的启动选项在我的主机上创建了一个自定义的 Arch Linux 映像packer build
。
...
"==> bootloader.sh: Show boot options.."
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0007,0000,0001,0002,0003,0004,0005,0006
Boot0000* UiApp FvVol(7cb8bdc9-f8eb-4f34-aaea-3ee4af6516a1)/FvFile(462caa21-7614-4503-836e-8ab6f4662331)
Boot0001* UEFI QEMU DVD-ROM QM00001 PciRoot(0x0)/Pci(0x1f,0x2)/Sata(0,65535,0){auto_created_boot_option}
Boot0002* UEFI QEMU DVD-ROM QM00005 PciRoot(0x0)/Pci(0x1f,0x2)/Sata(2,65535,0){auto_created_boot_option}
Boot0003* UEFI Misc Device PciRoot(0x0)/Pci(0x3,0x0){auto_created_boot_option}
Boot0004* UEFI PXEv4 (MAC:525400123456) PciRoot(0x0)/Pci(0x2,0x0)/MAC(525400123456,1)/IPv4(0.0.0.00.0.0.0,0,0){auto_created_boot_option}
Boot0005* UEFI PXEv6 (MAC:525400123456) PciRoot(0x0)/Pci(0x2,0x0)/MAC(525400123456,1)/IPv6([::]:<->[::]:,0,0){auto_created_boot_option}
Boot0006* EFI Internal Shell FvVol(7cb8bdc9-f8eb-4f34-aaea-3ee4af6516a1)/FvFile(7c04a583-9e3e-4f1c-ad65-e05268d0b4d1)
Boot0007* GRUB HD(1,GPT,2034b5d2-828a-4491-8d23-fe9439932a12,0x800,0x7d000)/File(\EFI\GRUB\grubx64.efi)
...
所以我认为这应该没问题,但是当我运行它时:
sudo virt-install \
--name bastille-installer \
--vcpu 2 \
--machine q35 \
--memory 1024 \
--osinfo archlinux \
--debug \
--disk /var/lib/libvirt/images/bastille-installer_qemu_archlinux-2023-05.qcow2,format=qcow2 \
--import \
--boot loader=/usr/share/edk2/x64/OVMF_CODE.4m.fd,loader_ro=yes,loader_type=pflash,nvram_template=/usr/share/edk2/x64/OVMF_VARS.4m.fd,loader_secure=no
映射表中的 FS0: 完全缺失。退出查看启动管理器后,我发现也缺少几个启动选项。
如果相关,virt-install 的详细输出如下所示:
https://gist.github.com/Folaht/d8d4366b79434069ff6e8a7b51abbd25
我究竟做错了什么?
[编辑]
$ sudo qemu-img info ./bastille-installer_qemu_archlinux-2023-05.qcow2
image: ./bastille-installer_qemu_archlinux-2023-05.qcow2
file format: raw
virtual size: 1.42 GiB (1522309120 bytes)
disk size: 1.42 GiB
Child node '/file':
filename: ./bastille-installer_qemu_archlinux-2023-05.qcow2
protocol type: file
file length: 1.42 GiB (1522309120 bytes)
disk size: 1.42 GiB
看起来我有原始文件问题。
一定有什么东西导致加壳器忽略将盒子构建为 qcow2 文件,尽管它是这样配置的。
bastillebox-installer-box.pkr.hcl
...
source "qemu" "archlinux" {
accelerator = "kvm"
boot_command = local.boot_command_qemu
boot_wait = "1s"
cpus = local.cpus
disk_interface = "virtio"
disk_size = local.disk_size
efi_boot = true
efi_firmware_code = local.efi_firmware_code
efi_firmware_vars = local.efi_firmware_vars
format = "qcow2"
headless = local.headless
http_directory = local.http_directory
iso_url = local.iso_url
iso_checksum = local.iso_checksum
machine_type = local.machine_type
memory = local.memory
net_device = "virtio-net"
shutdown_command = "sudo systemctl start poweroff.timer"
ssh_handshake_attempts = 500
ssh_port = 22
ssh_private_key_file = var.ssh_private_key_file
ssh_timeout = var.ssh_timeout
ssh_username = var.ssh_username
ssh_wait_timeout = var.ssh_timeout
vm_name = "${local.vm_name}.qcow2"
}
...
Manjaro XFCE x86_64
打包程序(插件:qemu)
virt-install
virt-viewer
virt-manager
OS: Arch Linux
Hypervisor: QEMU KVM
Architecture: x64
Machine Type: qc35
EFI Firmware Code: /usr/share/edk2-ovmf/x64/OVMF_CODE.fd
EFI Firmware Vars: /usr/share/edk2-ovmf/x64/OVMF_VARS.fd
因此,我使用packer build
并记录了我的启动选项来创建一个自定义的 Arch Linux 映像。
echo ">>>> ${NAME_SH}: Show boot option.." 的输出
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0007,0000,0001,0002,0003,0004,0005,0006
Boot0000* UiApp FvVol(7cb8bdc9-f8eb-4f34-aaea-3ee4af6516a1)/FvFile(462caa21-7614-4503-836e-8ab6f4662331)
Boot0001* UEFI QEMU DVD-ROM QM00001 PciRoot(0x0)/Pci(0x1f,0x2)/Sata(0,65535,0){auto_created_boot_option}
Boot0002* UEFI QEMU DVD-ROM QM00005 PciRoot(0x0)/Pci(0x1f,0x2)/Sata(2,65535,0){auto_created_boot_option}
Boot0003* UEFI Misc Device PciRoot(0x0)/Pci(0x3,0x0){auto_created_boot_option}
Boot0004* UEFI PXEv4 (MAC:525400123456) PciRoot(0x0)/Pci(0x2,0x0)/MAC(525400123456,1)/IPv4(0.0.0.00.0.0.0,0,0){auto_created_boot_option}
Boot0005* UEFI PXEv6 (MAC:525400123456) PciRoot(0x0)/Pci(0x2,0x0)/MAC(525400123456,1)/IPv6([::]:<->[::]:,0,0){auto_created_boot_option}
Boot0006* EFI Internal Shell FvVol(7cb8bdc9-f8eb-4f34-aaea-3ee4af6516a1)/FvFile(7c04a583-9e3e-4f1c-ad65-e05268d0b4d1)
Boot0007* GRUB HD(1,GPT,2034b5d2-828a-4491-8d23-fe9439932a12,0x800,0x7d000)/File(\EFI\GRUB\grubx64.efi)
所以我认为这应该没问题,但是当我运行它时:
虚拟安装命令
sudo virt-install \
--name bastille-installer \
--vcpu 2 \
--memory 1024 \
--osinfo archlinux \
--disk /var/lib/libvirt/images/bastille-installer_qemu_archlinux-2023-04.qcow2 \
--import \
--boot uefi
我看到这个:
映射表中的 FS0: 完全缺失。退出查看启动管理器后,我发现也缺少几个启动选项。
这些是我的打包程序配置加载的脚本:
bastille-installer.pkr.hcl
...
provisioner "shell" {
only = ["qemu.archlinux"]
execute_command = "{{ .Vars }} sudo -E -S bash '{{ .Path }}'"
expect_disconnect = true
scripts = [
"scripts/configure-qemu.sh",
"scripts/configure-shared.sh",
"scripts/partition-table-gpt.sh",
"scripts/partition-ext4-efi.sh",
"scripts/setup.sh"
]
}
...
这是创建引导加载程序的脚本。
分区-ext4-efi.sh
#!/usr/bin/env bash
. /tmp/files/vars.sh
NAME_SH=partition-ext4-efi.sh
# stop on errors
set -eu
echo ">>>> ${NAME_SH}: Writing Filesystem types.."
mkfs.ext4 -L BOHKS_BAZ ${ROOT_PARTITION}
mkfs.fat -F32 ${BOOT_PARTITION}
echo ">>>> ${NAME_SH}: Mounting partitions.."
/usr/bin/mount ${ROOT_PARTITION} ${ROOT_DIR}
/usr/bin/mkdir -p ${BOOT_DIR}
/usr/bin/mount ${BOOT_PARTITION} ${BOOT_DIR}
echo ">>>> ${NAME_SH}: Bootstrapping the base installation.."
/usr/bin/pacstrap ${ROOT_DIR} base `pacman -Qq linux`
echo ">>>> ${NAME_SH}: Updating pacman mirrors base installation.."
/usr/bin/arch-chroot ${ROOT_DIR} pacman -S --noconfirm reflector
/usr/bin/arch-chroot ${ROOT_DIR} reflector --latest 5 --protocol https --sort rate --save /etc/pacman.d/mirrorlist
tee /etc/xdg/reflector/reflector.conf &>/dev/null <<EOF
--latest 5
--protocol https
--sort rate
--save /etc/pacman.d/mirrorlist
EOF
/usr/bin/arch-chroot ${ROOT_DIR} systemctl enable reflector.timer
echo ">>>> ${NAME_SH}: Installing databases.."
/usr/bin/arch-chroot ${ROOT_DIR} pacman -Sy
echo ">>>> ${NAME_SH}: Installing basic packages.."
/usr/bin/arch-chroot ${ROOT_DIR} pacman -S --noconfirm sudo gptfdisk openssh grub efibootmgr dhcpcd netctl
echo ">>>> ${NAME_SH}: Generating the filesystem table.."
/usr/bin/genfstab -U ${ROOT_DIR} | tee -a "${ROOT_DIR}/etc/fstab" >/dev/null
echo ">>>> ${NAME_SH}: Installing grub.."
/usr/bin/arch-chroot ${ROOT_DIR} grub-install --target=x86_64-efi --efi-directory=${ESP_DIR} --bootloader-id=GRUB >/dev/null
/usr/bin/arch-chroot ${ROOT_DIR} grub-mkconfig -o /boot/grub/grub.cfg
echo ">>>> ${NAME_SH}: Show boot option.."
/usr/bin/arch-chroot ${ROOT_DIR} efibootmgr
echo ">>>> ${NAME_SH}: Generating the system configuration script.."
/usr/bin/install --mode=0755 /dev/null "${ROOT_DIR}${CONFIG_SCRIPT}"
如果相关,这就是我创建分区表的方式。
分区表-gpt.sh
#!/usr/bin/env bash
. /tmp/files/vars.sh
# stop on errors
set -eu
NAME_SH=partition-table-gpt.sh
echo ">>>> ${NAME_SH}: Formatting disk.."
sed -e 's/\s*\([\+0-9a-zA-Z]*\).*/\1/' << EOF | gdisk ${DISK}
o
y
n
1
+250M
ef02
n
2
8304
p
w
y
q
EOF
相关变量文件:
变量.sh
...
HOME_DIR=/home/${USER}
SSH_DIR=/home/${USER}/.ssh
ROOT_DIR='/mnt'
BOOT_DIR='/mnt/boot/efi'
FILES_DIR='/tmp/files'
ESP_DIR='/boot/efi'
...
BOOT_PARTITION="${DISK}1"
ROOT_PARTITION="${DISK}2"
...
我不知道为什么我没有得到我的 UEFI 引导选项
以及为什么映射表中缺少文件系统。
一个名为“vagrant packer”的应用程序每次运行时总是从远程位置下载 iso 和校验和文件,所以我正在创建一个脚本将 iso 下载到本地位置,但前提是 published_at 日期高于我的本地的。如果是,我下载 iso 和校验和,然后将发布日期存储在本地 .conf 文件中。
所以我尝试从项目的 github api url获取校验和的下载 url ,但是 download_url 需要首先不匹配然后匹配模式。
它不需要包含“unstable”并以“.iso.sha512”结尾。
运行.sh
...
echo downloading checksum..
checksum_download_url=$(curl -s $github_latest_api_url | jq -r '.assets[].browser_download_url|select(match(".(?!unstable).iso.sha512"))')
...
如您所见,我试图先获取正确的下载 url,然后再在下一行中执行 curl 下载命令。
我已经尝试过了,但我就是想不通匹配函数的正则表达式是什么。
我仍然没有得到任何结果、语法错误或包含不稳定的行。
#!/bin/bash
source ./uploads/mai-base.conf
prerelease=$(curl -s $github_latest_api_url | jq -r '.prerelease')
if [ !prerelease ]; then
r_publish_date=$(date -d $(curl -s $github_latest_api_url | jq -r '.published_at') +%s)
l_publish_date=$(date -d $publish_date +%s)
if [ $r_publish_date -gt $l_publish_date ]; then
echo downloading checksum..
checksum_download_url=$(curl -s $github_latest_api_url | jq -r '.assets[].browser_download_url|select(match(".(?!unstable).iso.sha512"))')
echo $checksum_download_url
#curl -L $download_url
echo downloading iso..
# downloading iso code goes here..
# date saving to mai-base.conf goes here..
fi
fi
# Start packer application..
# PACKER_LOG=1 packer build -var $ISO_VERSION manjaro-arm-installer.pkr.hcl
到目前为止,我只能通过反复试验来弄清楚。
Right Alt + a = à
Right Alt + o = ô
Right Alt + e = é
Right Alt + u = û
Right Alt + i = î
Right Alt + 4 = €
Right Alt + , = ä
Right Alt + . = ê
Right Alt + p = ë
Right Alt + y = ü
Right Alt + ; = â
Right Alt + q = ö
Right Alt + j = è
Right Alt + k = ù
Right Alt + x = ï
Right Alt + c = ç
Right Alt + ` = dead `
Right Alt + 9 = dead `
Right Alt + ' = dead ´
Right Alt + " = dead ¨
Right Alt + < = dead ˇ
Right Alt + > = ·
Right Alt + p = dead ¸
Right Alt + 6 = dead ^
Right Alt + ^ = dead ^
Right Alt + s = ß
Right Alt + ] = dead ~
Right Alt + ~ = dead ~
Right Alt + Q = dead ˛
Right Alt + : = dead ˝
Right Alt + J = dead ˝
Right Alt + C = dead ˙
Right Alt + Q - Right Alt + X = Ǭ
还有更多,但我还没有弄清楚。
[更新]
感谢斯蒂芬基特,我解决了它:
[me@MyComputer ~]$ sudo pacman -S libgnomekdb
...
[me@MyComputer ~]$ gkbd-keyboard-display -g 1
设置
我的 MySQL 数据库没有加载
admin@Xroklaus:~ $ sudo systemctl status mysql
● mysql.service - LSB: Start and stop the mysql database server daemon
Loaded: loaded (/etc/init.d/mysql)
Active: failed (Result: exit-code) since Thu 2018-01-11 01:09:32 UTC; 6h ago
Process: 914 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)
Jan 11 01:08:48 Xroklaus systemd[1]: Starting LSB: Start and stop the mysql database server daemon...
Jan 11 01:09:32 Xroklaus mysql[914]: Starting MariaDB database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!
Jan 11 01:09:32 Xroklaus systemd[1]: mysql.service: control process exited, code=exited status=1
Jan 11 01:09:32 Xroklaus systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
Jan 11 01:09:32 Xroklaus systemd[1]: Unit mysql.service entered failed state.
错误日志
admin@Xroklaus:~ $ sudo cat /var/lib/mysql/Xroklaus.err
180111 1:04:39 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
180111 1:04:39 [Note] Server socket created on IP: '::'.
180111 1:04:39 [ERROR] Fatal error: Can't open and lock privilege tables: Incorrect file format 'host'
180111 01:04:39 mysqld_safe mysqld from pid file /var/lib/mysql/Xroklaus.pid ended
180111 01:08:53 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
180111 1:08:53 [Note] /usr/sbin/mysqld (mysqld 10.0.32-MariaDB-0+deb8u1) starting as process 1347 ...
180111 1:08:54 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.
180111 1:08:54 [Note] InnoDB: Using mutexes to ref count buffer pool pages
180111 1:08:54 [Note] InnoDB: The InnoDB memory heap is disabled
180111 1:08:54 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
180111 1:08:54 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
180111 1:08:54 [Note] InnoDB: Compressed tables use zlib 1.2.8
180111 1:08:54 [Note] InnoDB: Using Linux native AIO
180111 1:08:54 [Note] InnoDB: Not using CPU crc32 instructions
180111 1:08:54 [Note] InnoDB: Initializing buffer pool, size = 128.0M
180111 1:08:54 [Note] InnoDB: Completed initialization of buffer pool
180111 1:08:54 [Note] InnoDB: Highest supported file format is Barracuda.
180111 1:08:54 [Note] InnoDB: The log sequence numbers 1616887 and 1616887 in ibdata files do not match the log sequence number 1616913 in the ib_logfiles!
180111 1:08:54 [Note] InnoDB: Restoring possible half-written data pages from the doublewrite buffer...
180111 1:08:55 [Note] InnoDB: 128 rollback segment(s) are active.
180111 1:08:55 [Note] InnoDB: Waiting for purge to start
180111 1:08:55 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.36-82.1 started; log sequence number 1616913
180111 1:08:55 [Note] Plugin 'FEEDBACK' is disabled.
180111 1:08:55 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
180111 1:08:55 [Note] Server socket created on IP: '::'.
180111 1:08:55 [ERROR] Fatal error: Can't open and lock privilege tables: Incorrect file format 'host'
180111 01:08:55 mysqld_safe mysqld from pid file /var/lib/mysql/Xroklaus.pid ended
好像少了一个文件。
admin@Xroklaus:~ $ sudo mysql_upgrade
Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
FATAL ERROR: Upgrade failed
[更新]
我可以使用 运行守护进程mysqld_safe --skip-grant-tables
,但升级失败:
admin@Xroklaus:~ $ sudo mysql_upgrade
Phase 1/6: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
mysql.columns_priv
Error : Incorrect file format 'columns_priv'
error : Corrupt
mysql.db
Error : Incorrect file format 'db'
error : Corrupt
mysql.event
Error : Incorrect file format 'event'
error : Corrupt
mysql.func
Error : Incorrect file format 'func'
error : Corrupt
mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.plugin
Error : Incorrect file format 'plugin'
error : Corrupt
mysql.proc OK
mysql.procs_priv
Error : Incorrect file format 'procs_priv'
error : Corrupt
mysql.proxies_priv OK
mysql.roles_mapping OK
mysql.servers OK
mysql.table_stats OK
mysql.tables_priv
Error : Incorrect file format 'tables_priv'
error : Corrupt
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user
Error : Incorrect file format 'user'
error : Corrupt
Repairing tables
mysql.columns_priv
Error : Incorrect file format 'columns_priv'
error : Corrupt
mysql.db
Error : Incorrect file format 'db'
error : Corrupt
mysql.event
Error : Incorrect file format 'event'
error : Corrupt
mysql.func
Error : Incorrect file format 'func'
error : Corrupt
mysql.plugin
Error : Incorrect file format 'plugin'
error : Corrupt
mysql.procs_priv
Error : Incorrect file format 'procs_priv'
error : Corrupt
mysql.tables_priv
Error : Incorrect file format 'tables_priv'
error : Corrupt
mysql.user
Error : Incorrect file format 'user'
error : Corrupt
Phase 2/6: Fixing views
Phase 3/6: Running 'mysql_fix_privilege_tables'
ERROR 130 (HY000) at line 141: Incorrect file format 'user'
ERROR 130 (HY000) at line 143: Incorrect file format 'user'
ERROR 130 (HY000) at line 144: Incorrect file format 'user'
ERROR 130 (HY000) at line 146: Incorrect file format 'db'
ERROR 130 (HY000) at line 147: Incorrect file format 'user'
ERROR 130 (HY000) at line 148: Incorrect file format 'db'
ERROR 130 (HY000) at line 150: Incorrect file format 'user'
ERROR 130 (HY000) at line 155: Incorrect file format 'user'
ERROR 130 (HY000) at line 156: Incorrect file format 'tables_priv'
ERROR 130 (HY000) at line 158: Incorrect file format 'tables_priv'
ERROR 130 (HY000) at line 166: Incorrect file format 'tables_priv'
ERROR 130 (HY000) at line 174: Incorrect file format 'columns_priv'
ERROR 130 (HY000) at line 177: Incorrect file format 'columns_priv'
ERROR 130 (HY000) at line 186: Incorrect file format 'columns_priv'
ERROR 130 (HY000) at line 189: Incorrect file format 'func'
ERROR 130 (HY000) at line 191: Incorrect file format 'user'
ERROR 130 (HY000) at line 192: Incorrect file format 'user'
ERROR 130 (HY000) at line 200: Incorrect file format 'user'
ERROR 130 (HY000) at line 201: Incorrect file format 'user'
ERROR 130 (HY000) at line 205: Incorrect file format 'db'
ERROR 130 (HY000) at line 211: Incorrect file format 'user'
ERROR 130 (HY000) at line 212: Incorrect file format 'db'
ERROR 130 (HY000) at line 214: Incorrect file format 'user'
ERROR 130 (HY000) at line 215: Incorrect file format 'func'
ERROR 130 (HY000) at line 216: Incorrect file format 'user'
ERROR 130 (HY000) at line 220: Incorrect file format 'user'
ERROR 130 (HY000) at line 244: Incorrect file format 'db'
ERROR 130 (HY000) at line 249: Incorrect file format 'db'
ERROR 130 (HY000) at line 279: Incorrect file format 'func'
ERROR 130 (HY000) at line 281: Incorrect file format 'func'
ERROR 130 (HY000) at line 312: Incorrect file format 'plugin'
ERROR 130 (HY000) at line 317: Incorrect file format 'user'
ERROR 130 (HY000) at line 318: Incorrect file format 'db'
ERROR 130 (HY000) at line 319: Incorrect file format 'db'
ERROR 130 (HY000) at line 322: Incorrect file format 'user'
ERROR 130 (HY000) at line 323: Incorrect file format 'user'
ERROR 130 (HY000) at line 324: Incorrect file format 'db'
ERROR 130 (HY000) at line 325: Incorrect file format 'db'
ERROR 130 (HY000) at line 328: Incorrect file format 'user'
ERROR 130 (HY000) at line 329: Incorrect file format 'user'
ERROR 130 (HY000) at line 330: Incorrect file format 'user'
ERROR 130 (HY000) at line 332: Incorrect file format 'user'
ERROR 130 (HY000) at line 333: Incorrect file format 'db'
ERROR 130 (HY000) at line 334: Incorrect file format 'db'
ERROR 130 (HY000) at line 337: Incorrect file format 'user'
ERROR 130 (HY000) at line 338: Incorrect file format 'user'
ERROR 130 (HY000) at line 339: Incorrect file format 'db'
ERROR 130 (HY000) at line 340: Incorrect file format 'db'
ERROR 130 (HY000) at line 343: Incorrect file format 'user'
ERROR 130 (HY000) at line 344: Incorrect file format 'user'
ERROR 130 (HY000) at line 345: Incorrect file format 'db'
ERROR 130 (HY000) at line 346: Incorrect file format 'db'
ERROR 130 (HY000) at line 349: Incorrect file format 'user'
ERROR 130 (HY000) at line 350: Incorrect file format 'db'
ERROR 130 (HY000) at line 352: Incorrect file format 'user'
ERROR 130 (HY000) at line 353: Incorrect file format 'user'
ERROR 130 (HY000) at line 355: Incorrect file format 'user'
ERROR 130 (HY000) at line 356: Incorrect file format 'user'
ERROR 130 (HY000) at line 357: Incorrect file format 'user'
ERROR 130 (HY000) at line 358: Incorrect file format 'user'
ERROR 130 (HY000) at line 361: Incorrect file format 'procs_priv'
ERROR 130 (HY000) at line 364: Incorrect file format 'procs_priv'
ERROR 130 (HY000) at line 367: Incorrect file format 'procs_priv'
ERROR 130 (HY000) at line 370: Incorrect file format 'procs_priv'
ERROR 130 (HY000) at line 373: Incorrect file format 'procs_priv'
ERROR 130 (HY000) at line 472: Incorrect file format 'user'
ERROR 130 (HY000) at line 473: Incorrect file format 'user'
ERROR 130 (HY000) at line 474: Incorrect file format 'user'
ERROR 130 (HY000) at line 475: Incorrect file format 'user'
ERROR 130 (HY000) at line 476: Incorrect file format 'db'
ERROR 130 (HY000) at line 477: Incorrect file format 'db'
ERROR 130 (HY000) at line 478: Incorrect file format 'event'
ERROR 130 (HY000) at line 479: Incorrect file format 'event'
ERROR 130 (HY000) at line 480: Incorrect file format 'event'
ERROR 130 (HY000) at line 481: Incorrect file format 'event'
ERROR 130 (HY000) at line 515: Incorrect file format 'event'
ERROR 130 (HY000) at line 516: Incorrect file format 'event'
ERROR 130 (HY000) at line 517: Incorrect file format 'event'
ERROR 130 (HY000) at line 518: Incorrect file format 'event'
ERROR 130 (HY000) at line 519: Incorrect file format 'event'
ERROR 130 (HY000) at line 521: Incorrect file format 'event'
ERROR 130 (HY000) at line 524: Incorrect file format 'event'
ERROR 130 (HY000) at line 526: Incorrect file format 'event'
ERROR 130 (HY000) at line 529: Incorrect file format 'event'
ERROR 130 (HY000) at line 531: Incorrect file format 'event'
ERROR 130 (HY000) at line 534: Incorrect file format 'event'
ERROR 130 (HY000) at line 536: Incorrect file format 'event'
ERROR 130 (HY000) at line 538: Incorrect file format 'event'
ERROR 130 (HY000) at line 539: Incorrect file format 'db'
ERROR 130 (HY000) at line 541: Incorrect file format 'user'
ERROR 130 (HY000) at line 542: Incorrect file format 'user'
ERROR 130 (HY000) at line 543: Incorrect file format 'user'
ERROR 130 (HY000) at line 546: Incorrect file format 'db'
ERROR 130 (HY000) at line 547: Incorrect file format 'db'
ERROR 130 (HY000) at line 548: Incorrect file format 'user'
ERROR 130 (HY000) at line 550: Incorrect file format 'user'
ERROR 130 (HY000) at line 551: Incorrect file format 'user'
ERROR 130 (HY000) at line 552: Incorrect file format 'user'
ERROR 130 (HY000) at line 553: Incorrect file format 'user'
ERROR 130 (HY000) at line 554: Incorrect file format 'user'
ERROR 130 (HY000) at line 555: Incorrect file format 'user'
ERROR 130 (HY000) at line 556: Incorrect file format 'user'
ERROR 130 (HY000) at line 557: Incorrect file format 'user'
ERROR 130 (HY000) at line 558: Incorrect file format 'user'
ERROR 130 (HY000) at line 559: Incorrect file format 'user'
ERROR 1436 (HY000) at line 574: Thread stack overrun: 4864 bytes used of a 131072 byte stack, and 0 bytes needed. Use 'mysqld --thread_stack=#' to specify a bigger stack.
ERROR 130 (HY000) at line 577: Incorrect file format 'user'
ERROR 130 (HY000) at line 597: Incorrect file format 'user'
ERROR 130 (HY000) at line 598: Incorrect file format 'db'
ERROR 130 (HY000) at line 599: Incorrect file format 'tables_priv'
ERROR 130 (HY000) at line 600: Incorrect file format 'columns_priv'
ERROR 130 (HY000) at line 601: Incorrect file format 'procs_priv'
ERROR 130 (HY000) at line 603: Incorrect file format 'event'
ERROR 130 (HY000) at line 608: Incorrect file format 'procs_priv'
ERROR 130 (HY000) at line 609: Incorrect file format 'tables_priv'
ERROR 130 (HY000) at line 625: Incorrect file format 'event'
ERROR 1050 (42S01) at line 644: Table 'cond_instances' already exists
ERROR 1050 (42S01) at line 669: Table 'events_waits_current' already exists
ERROR 1050 (42S01) at line 694: Table 'events_waits_history' already exists
ERROR 1050 (42S01) at line 719: Table 'events_waits_history_long' already exists
ERROR 1050 (42S01) at line 732: Table 'events_waits_summary_by_instance' already exists
ERROR 1050 (42S01) at line 745: Table 'events_waits_summary_by_host_by_event_name' already exists
ERROR 1050 (42S01) at line 758: Table 'events_waits_summary_by_user_by_event_name' already exists
ERROR 1050 (42S01) at line 772: Table 'events_waits_summary_by_account_by_event_name' already exists
ERROR 1050 (42S01) at line 785: Table 'events_waits_summary_by_thread_by_event_name' already exists
ERROR 1050 (42S01) at line 797: Table 'events_waits_summary_global_by_event_name' already exists
ERROR 1050 (42S01) at line 806: Table 'file_instances' already exists
ERROR 1050 (42S01) at line 835: Table 'file_summary_by_event_name' already exists
ERROR 1050 (42S01) at line 866: Table 'file_summary_by_instance' already exists
ERROR 1050 (42S01) at line 879: Table 'socket_instances' already exists
ERROR 1050 (42S01) at line 909: Table 'socket_summary_by_instance' already exists
ERROR 1050 (42S01) at line 938: Table 'socket_summary_by_event_name' already exists
ERROR 1050 (42S01) at line 973: Table 'host_cache' already exists
ERROR 1050 (42S01) at line 982: Table 'mutex_instances' already exists
ERROR 1050 (42S01) at line 996: Table 'objects_summary_global_by_type' already exists
ERROR 1050 (42S01) at line 1006: Table 'performance_timers' already exists
ERROR 1050 (42S01) at line 1016: Table 'rwlock_instances' already exists
ERROR 1050 (42S01) at line 1025: Table 'setup_actors' already exists
ERROR 1050 (42S01) at line 1033: Table 'setup_consumers' already exists
ERROR 1050 (42S01) at line 1042: Table 'setup_instruments' already exists
ERROR 1050 (42S01) at line 1053: Table 'setup_objects' already exists
ERROR 1050 (42S01) at line 1061: Table 'setup_timers' already exists
ERROR 1050 (42S01) at line 1106: Table 'table_io_waits_summary_by_index_usage' already exists
ERROR 1050 (42S01) at line 1150: Table 'table_io_waits_summary_by_table' already exists
ERROR 1050 (42S01) at line 1229: Table 'table_lock_waits_summary_by_table' already exists
ERROR 1050 (42S01) at line 1249: Table 'threads' already exists
ERROR 1050 (42S01) at line 1265: Table 'events_stages_current' already exists
ERROR 1050 (42S01) at line 1281: Table 'events_stages_history' already exists
ERROR 1050 (42S01) at line 1297: Table 'events_stages_history_long' already exists
ERROR 1050 (42S01) at line 1310: Table 'events_stages_summary_by_thread_by_event_name' already exists
ERROR 1050 (42S01) at line 1323: Table 'events_stages_summary_by_host_by_event_name' already exists
ERROR 1050 (42S01) at line 1336: Table 'events_stages_summary_by_user_by_event_name' already exists
ERROR 1050 (42S01) at line 1350: Table 'events_stages_summary_by_account_by_event_name' already exists
ERROR 1050 (42S01) at line 1362: Table 'events_stages_summary_global_by_event_name' already exists
ERROR 1050 (42S01) at line 1408: Table 'events_statements_current' already exists
ERROR 1050 (42S01) at line 1454: Table 'events_statements_history' already exists
ERROR 1050 (42S01) at line 1500: Table 'events_statements_history_long' already exists
ERROR 1050 (42S01) at line 1532: Table 'events_statements_summary_by_thread_by_event_name' already exists
ERROR 1050 (42S01) at line 1564: Table 'events_statements_summary_by_host_by_event_name' already exists
ERROR 1050 (42S01) at line 1596: Table 'events_statements_summary_by_user_by_event_name' already exists
ERROR 1050 (42S01) at line 1629: Table 'events_statements_summary_by_account_by_event_name' already exists
ERROR 1050 (42S01) at line 1660: Table 'events_statements_summary_global_by_event_name' already exists
ERROR 1050 (42S01) at line 1669: Table 'hosts' already exists
ERROR 1050 (42S01) at line 1678: Table 'users' already exists
ERROR 1050 (42S01) at line 1688: Table 'accounts' already exists
ERROR 1050 (42S01) at line 1723: Table 'events_statements_summary_by_digest' already exists
ERROR 1050 (42S01) at line 1733: Table 'session_connect_attrs' already exists
ERROR 1050 (42S01) at line 1739: Table 'session_account_connect_attrs' already exists
FATAL ERROR: Upgrade failed
[更新]
通过删除所有表来修复。
我创建了一个服务。
admin@Xroklaus:~ $ cat /etc/systemd/user/duniter.service
[Unit]
Description=Duniter node
After=network.target
ConditionPathExists=/home/folatt/.config/duniter/duniter_default/duniter.db
[Service]
Group=folatt
User=folatt
Type=forking
ExecStart=/usr/bin/duniter webstart
ExecReload=/usr/bin/duniter webrestart
ExecStop=/usr/bin/duniter stop
Restart=on-failure
[Install]
WantedBy=multi-user.target
重新启动后,它不会加载。
folatt@Xroklaus:~ $ systemctl --user status duniter.service
● duniter.service - Duniter node
Loaded: loaded (/etc/systemd/user/duniter.service; enabled)
Active: failed (Result: start-limit) since Sun 2018-01-07 20:31:43 UTC; 1min 3s ago
Process: 2212 ExecStart=/usr/bin/duniter webstart (code=exited, status=216/GROUP)
Journalctl 提供了有关错误的更多信息。
admin@Xroklaus:~ $ sudo journalctl -p 3 --no-pager
-- Logs begin at Sun 2018-01-07 20:30:33 UTC, end at Sun 2018-01-07 20:31:49 UTC. --
Jan 07 20:30:39 Xroklaus bluetoothd[876]: Sap driver initialization failed.
Jan 07 20:30:39 Xroklaus bluetoothd[876]: sap-server: Operation not permitted (1)
Jan 07 20:31:26 Xroklaus systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
Jan 07 20:31:42 Xroklaus systemd[2203]: Failed at step GROUP spawning /usr/bin/duniter: Operation not permitted
Jan 07 20:31:42 Xroklaus systemd[2177]: Failed to start Duniter node.
Jan 07 20:31:42 Xroklaus systemd[2206]: Failed at step GROUP spawning /usr/bin/duniter: Operation not permitted
Jan 07 20:31:42 Xroklaus systemd[2177]: Failed to start Duniter node.
Jan 07 20:31:43 Xroklaus systemd[2208]: Failed at step GROUP spawning /usr/bin/duniter: Operation not permitted
Jan 07 20:31:43 Xroklaus systemd[2177]: Failed to start Duniter node.
Jan 07 20:31:43 Xroklaus systemd[2210]: Failed at step GROUP spawning /usr/bin/duniter: Operation not permitted
Jan 07 20:31:43 Xroklaus systemd[2177]: Failed to start Duniter node.
Jan 07 20:31:43 Xroklaus systemd[2212]: Failed at step GROUP spawning /usr/bin/duniter: Operation not permitted
Jan 07 20:31:43 Xroklaus systemd[2177]: Failed to start Duniter node.
Jan 07 20:31:43 Xroklaus systemd[2177]: Failed to start Duniter node.
但这就是我所得到的。我不知道解决方案是什么。