我正在为 Java 应用程序编写 systemd 单元文件,我想控制用于启动它的 Java 版本。我的(简化的)服务文件是
[Service]
Type=simple
EnvironmentFile=%h/Documents/apps/app/app-%i/app.cfg
ExecStart=${JAVA_HOME}/bin/java ${JAVA_OPTS} -jar %h/Documents/apps/app/app-%i/myapp.jar
SuccessExitStatus=143
Run Code Online (Sandbox Code Playgroud)
尝试启动时,我收到错误消息
Apr 28 12:43:37 rombert systemd[1613]: [/home/robert/.config/systemd/user/app@.service:7] Executable path is not absolute, ignoring: ${JAVA_HOME}/bin/java ${JAVA_OPT
Apr 28 12:43:37 rombert systemd[1613]: app@1.0.0.service lacks both ExecStart= and ExecStop= setting. Refusing.
Run Code Online (Sandbox Code Playgroud)
我知道JAVA_HOME设置正确;如果我改变ExecStart行开始,/usr/bin/java然后添加一些-DsomeOption=${JAVA_HOME}我可以看到的东西就好了。
显而易见的解决方法是创建一个包装脚本,但我觉得它违背了使用服务文件的意义。
如何使用单元文件为我的 Java 应用程序设置 JAVA_HOME?
我正在运行一个sched_autogroup_enabled设置为 1的 2.6.37 内核。我不确定我是否看到了这个补丁的好处,因为:
如何选择一些应该与其他应用程序位于不同 tty 的应用程序?
我正在尝试对我使用提取的 btrfs 图像文件执行恢复操作
# dd if=/dev/sda1 of=/mnt/sda1.img
Run Code Online (Sandbox Code Playgroud)
该文件似乎已正确提取:
$ file sda1.img
sda1.img: DOS/MBR boot sector
Run Code Online (Sandbox Code Playgroud)
虽然用 parted 阅读它有点不透明
$ sudo parted sda1.img
GNU Parted 3.2
Using /run/media/robert/exthdd2/sda1.img
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: (file)
Disk /run/media/robert/exthdd2/sda1.img: 240GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
Run Code Online (Sandbox Code Playgroud)
尝试安装它会导致错误
$ sudo mount -o loop -t btrfs sda1.img /mnt/
mount: mount /dev/loop0 on /mnt failed: Operation …Run Code Online (Sandbox Code Playgroud) 我正在尝试在 Raspberry Pi 上登录全新安装的 openSUSE Leap 42.2。该设置完全默认,并且 pi 上没有存储公钥。
当我尝试通过登录时ssh root@192.168.1.56出现错误:
Received disconnect from 192.168.1.56 port 22:2: Too many authentication failures
Connection to 192.168.1.56 closed by remote host.
Connection to 192.168.1.56 closed.
Run Code Online (Sandbox Code Playgroud)
使用ssh -v表明正在提供大量公钥:
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/robert/.ssh/id_rsa
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Offering DSA public key: /home/robert/.ssh/id_dsa
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Offering RSA public key: robert@XXX
debug1: …Run Code Online (Sandbox Code Playgroud) 我有一个管理的 RAID 10 阵列,mdadm但它失败了。症状是 X 崩溃了,我无法从终端登录。我已经重新启动了计算机,/dev/md1但没有启动。
我收集了以下信息 - 有些信息不完整,因为我已手动将其复制到另一台计算机:
$ cat /proc/mdstat
....
md1 : inactive sdb3[1](S) sdd1[3](S) sdc2[2](S) sda1[0](S)
1250273760 blocks super 1.0
Run Code Online (Sandbox Code Playgroud)
挂载失败
$ mount /dev/md1
EXT4-fs (md1): unable to read superblock
Run Code Online (Sandbox Code Playgroud)
扫描确实找到了元数据
$ mdadm --examine --scan
...
ARRAY /dev/md/1 metadata=1.0 UUID=2c... name=linux:1
Run Code Online (Sandbox Code Playgroud)
由于缺少操作镜像,运行失败
$ mdadm --run /dev/md1
md/raid0:md1: not enough operational mirrors.
md: pers->run() failed...
mdadm:failed to run array /dev/md1: Input/output error
Run Code Online (Sandbox Code Playgroud)
运行尝试后,只有两个磁盘仍在阵列中
$ cat /proc/mdstat
....
md1 : inactive sdd1[3] sdc2[2]
62513638 …Run Code Online (Sandbox Code Playgroud) 我正在使用 KDE Plasma 5.4.3 运行 openSUSE Tumbleweed 安装。我倾向于使用相当数量的程序(Eclipse、Firefox、Slack、Evolution、Konsole、各种 Java 应用程序),一段时间后我无法再打开新程序,因为
Maximum number of clients reachedxlsclients: unable to open display ":0"
Run Code Online (Sandbox Code Playgroud)
我无法确定是哪个程序导致了错误。当xlsclients工作,所以我怀疑它不显示正确的信息显示20-30程序。
如何调试此问题并找出导致错误的程序?
我想向我的用户的字体目录添加一个新目录。为了实现这一点,我添加了以下文件:
$ cat ~/.config/fontconfig/conf.d/dropbox-fonts.conf
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<dir>~/Dropbox/fonts</dir>
</fontconfig>
Run Code Online (Sandbox Code Playgroud)
使用单独文件的原因是我用 Puppet 来定义它更容易。
但是,字体未被拾取。一旦我创建了从~/Dropbox/fonts到 的符号链接~/.fonts/fonts,它们就会被拾取。
如何在单独的文件中定义附加字体目录?
我正在尝试确定 GPU 直通无法与我的 NVidia GTX 750 Ti 设备一起使用的原因。因此,我尝试使用该显卡启动第二个 X 实例 - 主要实例是 GTX 1070。
我将它们连接到同一台显示器 - 1070 通过 DisplayPort,750Ti 通过 HDMI。
启动 Windows 会导致检测和激活,我通过 DisplayPort 和 HDMI 获得输出。
使用 Linux 启动时,1070 可以正常工作。检测到750Ti:
# nvidia-smi -L
GPU 0: GeForce GTX 1070 (UUID: GPU-a66c5cbb-a541-a3d7-845c-f8c0c021ae71)
GPU 1: GeForce GTX 750 Ti (UUID: GPU-db546e26-f6d5-5345-45e4-434e0bfb4f62)
Run Code Online (Sandbox Code Playgroud)
在 nvidia-settings 程序中,它显示为已连接到显示器。
但是,当启动第二个 Xorg 实例时,HDMI 端口上没有输出。
我使用的命令是
sudo Xorg :2 vt8 -config xorg-second.conf -configdir conf.d
Run Code Online (Sandbox Code Playgroud)
其中 conf.d 为空,以确保没有应用其他设置,并且xorg-second.conf几乎是标准的,除了
Section "Device"
Identifier "Device0"
Driver "nvidia"
BusID "PCI:3:0:0"
VendorName …Run Code Online (Sandbox Code Playgroud) 我已经使用 virt-manager 设置了一个 qemu Linux 客户机。我已经成功挂载了一个主机路径。主机上的 libvirt 配置片段:
<filesystem type='mount' accessmode='mapped'>
<source dir='/home/robert/Documents/sources/oss/linux'/>
<target dir='/linux-src'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</filesystem>
Run Code Online (Sandbox Code Playgroud)
来宾上的 fstab 行:
/linux-src /mnt/linux-src 9p defaults 0 0
Run Code Online (Sandbox Code Playgroud)
访问和阅读工作正常,但我无法写入该目录
$ cd /mnt/linux-src
$ touch asd
$ touch: cannot touch 'asd': Permission denied
Run Code Online (Sandbox Code Playgroud)
我作为root来宾中的用户运行,文件属于我的用户 ( robert) 在主机上。
我该怎么做才能允许来宾对该文件夹的写访问权限?
我正在使用 NetworkManager 的 openconnect 插件连接到 VPN 服务器。我想从 VPN 中排除特定路由,以便它们到达 VPN 之外。
我如何使用 NetworkManager/openconnect 做到这一点?
我正在尝试自动创建和安装 btrfs 子卷。我很容易创建它们并创建 fstab 条目,但更难解析子卷 ID。
我注意到其他子卷具有以“@”为前缀的可预测名称,它们以这种方式安装在 /etc/fstab 中
UUID=280d6f04-6ad0-4647-96b9-580aec12bbdc /var/log btrfs noatime,subvol=@/var/log 0 0
Run Code Online (Sandbox Code Playgroud)
确实,通过这样的标签进行安装是有效的
$ mount -o subvol=@/var/log photoshop-32
Run Code Online (Sandbox Code Playgroud)
安装具有“常规”名称的子卷失败
$ mount -o subvol=var/users/robert/wines/photoshop-32 /var/users/robert/wines/photoshop-32/
mount: mount(2) failed: /var/users/robert/wines/photoshop-32: No such file or directory
Run Code Online (Sandbox Code Playgroud)
因此,我尝试使用这样的名称创建一个子卷,但失败了
# btrfs subvolume create /var/users/robert/wines/blah/@/var/users/robert/wines/blah
ERROR: cannot access '/var/users/robert/wines/blah/@/var/users/robert/wines': No such file or directory
# btrfs subvolume create /@/var/users/robert/wines/blah
ERROR: cannot access '/@/var/users/robert/wines': No such file or directory
# btrfs subvolume create //@/var/users/robert/wines/blah
# ERROR: cannot access '//@/var/users/robert/wines': No such file or directory …Run Code Online (Sandbox Code Playgroud)