AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[dbus](ubuntu)

Martin Hope
Oehm
Asked: 2021-05-24 11:37:43 +0800 CST

21.04:无法从命令行启动 Audacious:“D-Bus 错误:在没有 X11 $DISPLAY 的情况下无法自动启动 D-Bus”

  • 0

从命令行启动Audacious 音频播放器会产生以下错误:

$ audacious 
ERROR dbus-server.cc:928 [dbus_server_init]: D-Bus error: Cannot autolaunch D-Bus without X11 $DISPLAY
ERROR pulse_audio.cc:439 [create_context]: pa_context_connect() failed: Connection refused
WARNING plugin-init.cc:110 [start_plugin]: PulseAudio Output failed to start.
ERROR plugin.cc:310 [init]: Cannot autolaunch D-Bus without X11 $DISPLAY
WARNING plugin-init.cc:110 [start_plugin]: MPRIS 2 Server failed to start.

(audacious:42484): Gtk-WARNING **: 21:18:52.181: cannot open display: 
WARNING main.cc:328 [main_cleanup]: exit() called unexpectedly; skipping normal cleanup.

从仪表板启动 Audacious 没有任何问题,也可以用它打开文件或从 Nautilus 的上下文菜单中启动它。

dbus
  • 1 个回答
  • 401 Views
Martin Hope
Atai Ambus
Asked: 2020-11-15 10:20:24 +0800 CST

升级到 20.10 后,Jetbrains Space 桌面应用程序在启动时由于 snap Dbus 错误而崩溃

  • 0

昨天,我注册了 Jetbrains Space 测试版并开始使用桌面应用程序设置项目,该应用程序运行正常。

今天,我升级到了 Ubuntu 20.10。现在,每当我尝试启动应用程序时,它都会立即崩溃,并且从终端启动它会导致以下错误:

Error org.freedesktop.DBus.Error.Failed: cannot set "default-url-scheme-handler" setting to invalid value "jbspace"
Segmentation fault (core dumped)

我尝试删除并重新安装该软件包,但仍然出现相同的错误。谷歌搜索表明这可能源于 snap,但我没能找到它到底是什么。

我想这是因为删除了一些依赖项(我还必须重新安装 WiFi 驱动程序),但我不知道是哪个。

这个错误是什么意思?有什么办法可以解决这个问题,或者我可能需要安装/升级/降级的软件包?

upgrade dbus snap 20.10
  • 1 个回答
  • 124 Views
Martin Hope
Brandon
Asked: 2020-10-21 13:51:52 +0800 CST

带有外接显示器的 Gnome 3 标准亮度控制

  • 3

Gnome 的内置亮度控制适用于我的笔记本电脑显示器,但我希望它也能改变外接显示器的亮度。我已经想出了如何使用xrandr来控制外接显示器的亮度¹,并且我还找到了一种dbus基于 - 的方法来控制我的笔记本电脑显示器的亮度²,这似乎与 Gnome 的操作方式相对应。

我知道我可以设置自定义键盘快捷键来运行我自己的脚本,但是当我更改设置时,我失去了 Gnome 显示的漂亮的弹出式亮度显示。真的,我只想用我的亮度键来控制两台显示器,我可以想出很多不同的方法:

  1. 我可以使用 Gnome 的本机亮度控制注册我的外接显示器,以便它同时控制两者吗?
  2. 否则,我可以在 Gnome 完成后使用默认亮度控制来运行我自己的脚本吗?
  3. 或者,作为最后的手段,是否有一个类似于 Gnome 的简单工具来触发我自己的亮度弹出窗口?

我不需要帮助编写脚本或将它们附加到按键上。我试图弄清楚我不知道如何调整或挂钩标准 Gnome 功能。或者如果我不能,如果有一种简单、标准的方式来显示类似于 Gnome 的临时弹出显示。

¹我可以通过以下方式控制我的两台显示器,尤其是我的外接显示器xrandr:

xrandr --current --verbose # list all display devices
xrandr --output DP-3 --brightness N # N varies from 0.0 to 1.0, where 0 is literally black

² 我只能通过gdbus以下命令控制我的笔记本电脑显示器:

gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.StepUp
gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.gnome.SettingsDaemon.Power.Screen.StepDown
xrandr brightness gnome-shell dbus
  • 1 个回答
  • 1135 Views
Martin Hope
superstator
Asked: 2020-09-09 08:33:42 +0800 CST

通过 dbus 调节音量

  • 2

我正在使用一个应用程序(VMWare Workstation)劫持我键盘上的媒体键,所以我想使用另一个输入设备(Elgato Stream Deck)来发送通用媒体命令,如“提高音量”或“暂停”。我可以使用流平台来发送 shell 命令xdotool key XF86AudioLowerVolume,只要我在 gnome shell 中,它就可以工作,但是如果我在 VM 中,VMWare 仍然会劫持这些消息。另一方面,使用wmctrlor之类的工具的低级命令可以正常工作。dbus-send那么,什么dbus-send相当于xdotool key XF86Audio*命令?

我可以dbus-monitor在按下媒体键时查看事件并查看,例如:

signal time=1599582032.226007 sender=:1.66 -> destination=:1.96 serial=18241 path=/org/gnome/Shell; interface=org.gnome.Shell; member=AcceleratorActivated
   uint32 140
   array [
      dict entry(
         string "device-id"
         variant             uint32 12
      )
      dict entry(
         string "timestamp"
         variant             uint32 504924437
      )
      dict entry(
         string "action-mode"
         variant             uint32 1
      )
      dict entry(
         string "device-node"
         variant             string "/dev/input/event7"
      )
   ]

用于提高音量。我怎样才能把它翻译成一条dbus-send消息?

我很久以前就发现了这个问题,但它似乎已经过时了。至少,它不适用于我的系统(Ubuntu 20.04):https ://stackoverflow.com/questions/2830858/controlling-gnome-volume-using-dbus

gnome dbus
  • 1 个回答
  • 981 Views
Martin Hope
Ubuntovative is here
Asked: 2020-08-29 02:02:32 +0800 CST

无法更新 Ubuntu 18.04 [重复]

  • 0
这个问题在这里已经有了答案:
如果存储库/PPA 没有发布文件,我该怎么办? (5 个回答)
2年前关闭。

我有Ubuntu 18.04和python 3.7。

uname -a
Linux username-laptop 4.15.0-109-generic #110-Ubuntu SMP Tue Jun 23 02:39:32 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

当我运行时,sudo apt-get update我收到此错误:

E: The repository 'http://dl.bintray.com/aluxian/deb stable Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'https://dl.bintray.com/aluxian/deb dev Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

我尝试了这个解决方案,但我也无法打开Software and updates。

updates dbus
  • 2 个回答
  • 122 Views
Martin Hope
int_ua
Asked: 2020-06-17 19:57:06 +0800 CST

如何找到提供 dbus 服务的可执行文件?

  • 5

我在 Lubuntu 上遇到 kdeconnect 问题,当我执行守护程序时看到的唯一错误--replace是无法启动 kuiserver:

Couldn't start kuiserver from org.kde.kuiserver.service: QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "The name org.kde.kuiserver was not provided by any .service files")

我在我的主安装列表中有它(它是一台单独的机器),但找不到它来自哪个包,哪个文件提供此服务。没有像这样命名的文件,我什至在选择的系统目录中找不到任何东西。qdbusviewergrep kuiserver -ri

请注意,理想情况下,答案应该是通用的,因为我不仅对解决这个特定问题感兴趣,而且对学习如何解决一般来说这样的问题感兴趣。

有问题的系统是 20.04,但问题本身与 20.04 无关,因此没有标签。plasma-workspace软件包不提供此服务,我尝试在 Lubuntu 上安装,甚至在此之后重新启动。

dbus
  • 2 个回答
  • 695 Views
Martin Hope
N0rbert
Asked: 2020-05-28 13:23:07 +0800 CST

如何使用 Qt 和 D-Bus 在 Docker 容器中正确运行图形应用程序?

  • 1

我试图让 Audex在 20.04 LTS 主机上的 16.04 LTS Docker 容器中运行。

以下方法适用于基于 Gtk 的应用程序,我已经测试过了。

在当前情况下,我做了以下事情:

sudo apt-get update
sudo apt-get install docker.io
sudo usermod -a -G docker $USER
# reboot

mkdir ~/docker-audex
cat > ~/docker-audex/Dockerfile << EOF
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get install -y audex
CMD audex
EOF

docker build -t ubuntu:audex ~/docker-audex

然后尝试从终​​端启动它并得到输出:

$ docker run -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --user="$(id --user):$(id --group)" ubuntu:audex 
QDBusConnection: session D-Bus connection created before QCoreApplication. Application
may misbehave. audex(7): KUniqueApplication: Cannot find the D-Bus
session server:  "/usr/bin/dbus-launch terminated abnormally with the
following error: Autolaunch error: X11 initialization failed. " 

audex(6): KUniqueApplication: Pipe closed unexpectedly.  

或者

$ docker run -e DISPLAY -e DBUS_SESSION_BUS_ADDRESS -v /tmp/.X11-unix:/tmp/.X11-unix --user="$(id --user):$(id --group)" ubuntu:audex

QDBusConnection: session D-Bus connection created before
QCoreApplication. Application may misbehave. audex(7):
KUniqueApplication: Cannot find the D-Bus session server:  "Failed to
connect to socket /run/user/1000/bus: No such file or directory" 

audex(6): KUniqueApplication: Pipe closed unexpectedly.```

或者

$ docker run -e DISPLAY -e DBUS_SESSION_BUS_ADDRESS -v /tmp/.X11-unix:/tmp/.X11-unix -v /run:/run --user="$(id --user):$(id --group)" ubuntu:audex
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave. audex(7):
KUniqueApplication: Cannot find the D-Bus session server:  "An
AppArmor policy prevents this sender from sending this message to this
recipient; type="method_call", sender="(null)" (inactive)
interface="org.freedesktop.DBus" member="Hello" error name="(unset)"
requested_reply="0" destination="org.freedesktop.DBus" (bus)" 

audex(6): KUniqueApplication: Pipe closed unexpectedly.  

并且未显示应用程序窗口。

我想我在这里的 D-Bus 有问题。我们该如何解决?


更新,遵循下面的@SimonSudler回答:

$ docker run -e DISPLAY -e DBUS_SESSION_BUS_ADDRESS     -v /tmp/.X11-unix:/tmp/.X11-unix -v /run:/run     --user="$(id --user):$(id --group)"     --security-opt apparmor=unconfined     ubuntu:audex

QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
Error: Can not find password entry for uid 1000.
trying to create local folder //.kde: Permission denied
audex(7)/KSharedDataCache KSharedDataCache::Private::mapSharedMemory: Failed to establish shared memory mapping, will fallback to private memory -- memory usage will increase 
Usage: mv [OPTION]... [-T] SOURCE DEST
  or:  mv [OPTION]... SOURCE... DIRECTORY
  or:  mv [OPTION]... -t DIRECTORY SOURCE...
Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.

Mandatory arguments to long options are mandatory for short options too.
      --backup[=CONTROL]       make a backup of each existing destination file
  -b                           like --backup but does not accept an argument
  -f, --force                  do not prompt before overwriting
  -i, --interactive            prompt before overwrite
  -n, --no-clobber             do not overwrite an existing file
If you specify more than one of -i, -f, -n, only the final one takes effect.
      --strip-trailing-slashes  remove any trailing slashes from each SOURCE
                                 argument
  -S, --suffix=SUFFIX          override the usual backup suffix
  -t, --target-directory=DIRECTORY  move all SOURCE arguments into DIRECTORY
  -T, --no-target-directory    treat DEST as a normal file
  -u, --update                 move only when the SOURCE file is newer
                                 than the destination file or when the
                                 destination file is missing
  -v, --verbose                explain what is being done
  -Z, --context                set SELinux security context of destination
                                 file to default type
      --help     display this help and exit
      --version  output version information and exit

The backup suffix is '~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.
The version control method may be selected via the --backup option or through
the VERSION_CONTROL environment variable.  Here are the values:

  none, off       never make backups (even if --backup is given)
  numbered, t     make numbered backups
  existing, nil   numbered if numbered backups exist, simple otherwise
  simple, never   always make simple backups

GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
Report mv translation bugs to <http://translationproject.org/team/>
Full documentation at: <http://www.gnu.org/software/coreutils/mv>
or available locally via: info '(coreutils) mv invocation'
audex(7)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
Error: Can not find password entry for uid 1000.
X Error: BadAccess (attempt to access private resource denied) 10
  Extension:    130 (MIT-SHM)
  Minor opcode: 1 (X_ShmAttach)
  Resource id:  0x12d
X Error: BadShmSeg (invalid shared segment parameter) 128
  Extension:    130 (MIT-SHM)
  Minor opcode: 5 (X_ShmCreatePixmap)
  Resource id:  0x3a00017
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
  Major opcode: 62 (X_CopyArea)
  Resource id:  0x3a00018
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
  Major opcode: 62 (X_CopyArea)
  Resource id:  0x3a00018
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
  Major opcode: 62 (X_CopyArea)
  Resource id:  0x3a00018
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
  Major opcode: 62 (X_CopyArea)
  Resource id:  0x3a00018

添加--ipc=host也无济于事:

$ docker run --ipc=host -e DISPLAY -e DBUS_SESSION_BUS_ADDRESS     -v /tmp/.X11-unix:/tmp/.X11-unix -v /run:/run     --user="$(id --user):$(id --group)"     --security-opt apparmor=unconfined     ubuntu:audex
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
Error: Can not find password entry for uid 1000.
trying to create local folder //.kde: Permission denied
audex(7)/KSharedDataCache KSharedDataCache::Private::mapSharedMemory: Failed to establish shared memory mapping, will fallback to private memory -- memory usage will increase 
Usage: mv [OPTION]... [-T] SOURCE DEST
  or:  mv [OPTION]... SOURCE... DIRECTORY
  or:  mv [OPTION]... -t DIRECTORY SOURCE...
Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.

Mandatory arguments to long options are mandatory for short options too.
      --backup[=CONTROL]       make a backup of each existing destination file
  -b                           like --backup but does not accept an argument
  -f, --force                  do not prompt before overwriting
  -i, --interactive            prompt before overwrite
  -n, --no-clobber             do not overwrite an existing file
If you specify more than one of -i, -f, -n, only the final one takes effect.
      --strip-trailing-slashes  remove any trailing slashes from each SOURCE
                                 argument
  -S, --suffix=SUFFIX          override the usual backup suffix
  -t, --target-directory=DIRECTORY  move all SOURCE arguments into DIRECTORY
  -T, --no-target-directory    treat DEST as a normal file
  -u, --update                 move only when the SOURCE file is newer
                                 than the destination file or when the
                                 destination file is missing
  -v, --verbose                explain what is being done
  -Z, --context                set SELinux security context of destination
                                 file to default type
      --help     display this help and exit
      --version  output version information and exit

The backup suffix is '~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.
The version control method may be selected via the --backup option or through
the VERSION_CONTROL environment variable.  Here are the values:

  none, off       never make backups (even if --backup is given)
  numbered, t     make numbered backups
  existing, nil   numbered if numbered backups exist, simple otherwise
  simple, never   always make simple backups

GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
Report mv translation bugs to <http://translationproject.org/team/>
Full documentation at: <http://www.gnu.org/software/coreutils/mv>
or available locally via: info '(coreutils) mv invocation'
audex(7)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
Error: Can not find password entry for uid 1000.
qt dbus 16.04 docker 20.04
  • 1 个回答
  • 2163 Views
Martin Hope
codepearlex
Asked: 2020-02-21 07:22:13 +0800 CST

NetworkManager via D-Bus:添加网桥

  • 2

我正在尝试使用NetworkManager的D-Bus 接口来添加和启用网桥连接。基本上我试图模仿这个命令:

nmcli connection add type bridge ifname br0 stp no

这个单线创建并激活了一个新的连接,但它也创建了一个新的虚拟设备br0。

列出以下方法的D-Bus API参考:/org/freedesktop/NetworkManager

  • 添加并激活连接
  • 添加并激活连接2

两者都具有相似的签名并需要一个设备作为输入,因此可以通过 D-Bus GetDevices方法检索现有设备。但是,网桥需要虚拟设备(或者为网桥创建虚拟设备?)。自然地,我首先考虑创建一个新设备,然后将其传递给上面列出的方法之一,但该参考资料没有提供任何创建新设备的方法。

我认为nmcli 实现在底层使用了 D-Bus 接口,所以它必须以某种方式成为可能吗?

network-manager dbus nmcli
  • 1 个回答
  • 1238 Views
Martin Hope
alexg
Asked: 2019-11-21 02:12:44 +0800 CST

如何在使用 NVidia 驱动程序登录后调试黑屏,该驱动程序在随机时间奇怪地自行修复?

  • 2

我想在这里描述一下我过去几天在 Nvidia 上遇到的问题,希望有人可以帮助我诊断 Nvidia 驱动程序的问题。

背景

TL;博士

我开始在 Ubuntu 17 上遇到这个问题,在改组了一些 apt 包(依赖项损坏的问题)之后,我尝试了一段时间的 nouveau 驱动程序来解决这个问题,最后升级到 18.04 仿生。不幸的是,我不确定究竟是什么原因造成的。

长版:

  1. 多年来,我一直在使用该nvidia-340软件包,而我的 GeForce 210 卡没有任何问题。
  2. 在某些时候,不知道为什么,登录到我的桌面管理器后,我会看到一个黑屏,只显示鼠标光标。我使用的桌面管理器或窗口管理器似乎没有什么不同。我仍然可以切换到虚拟控制台并重新启动管理器服务,有时(不可预测)我可以再次登录,一切看起来都很好,直到下一次重新启动。
  3. 然后我尝试重新安装驱动程序,从 debian 包、从 Nvidia 网站下载的运行二进制文件和ppa:graphics-drivers/ppa存储库。结果总是一样的。
  4. 然后我很快尝试了允许我登录所有窗口管理器的 nouveau 驱动程序,但是这些驱动程序很慢并且在播放视频时不时会意外挂起,所以这对我来说是不可接受的。针对此类问题,网络上有多个错误报告。
  5. 我已经升级到 18.04 仿生并重新安装了nvidia-340带有 apt 的常规包。(我首先通过在 modprobe 配置中将 nouveau 驱动程序列入黑名单来卸载它们。)

现在我只剩下一个系统来执行此操作:

我首先在 Ubuntu 启动屏幕之后看到 Nvidia 徽标,然后gdm3启动,当我登录到 unity 或 gnome 时,我看到黑屏。鼠标指针根本不显示。如果我使用 Alt-F3 进入文本控制台,我可以登录并重新启动gdm3服务或gdm服务。如果我这样做的次数足够多,系统会突然开始正常工作,我可以登录到 unity 或 gnome。有时,如果我长时间将计算机单独留在登录屏幕上,它也会得到修复,直到下次重新启动。这告诉我,我多年来一直使用没有问题的驱动程序仍然与我的系统兼容。我在任何时候都没有更改任何 BIOS 设置。我已将工作/etc/X11/xorg.conf文件复制到/usr/share/X11/xorg.conf.d/20-nvidia.conf但这并没有改变任何东西。我尝试使用nvidia-xconfig重新创建文件并且它可以工作,但重启后问题仍然存在。我没有带集成显卡的 CPU,所以这不是问题。

以下是有关我的系统的一些信息,以防相关:

$ uname -a
Linux turbox 4.15.0-70-generic #79-Ubuntu SMP Tue Nov 12 10:36:11 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
LSB Version:    core-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:    18.04
Codename:   bionic

$ ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:02.0/0000:01:00.0 ==
modalias : pci:v000010DEd00000A65sv00000000sd00000000bc03sc00i00
vendor   : NVIDIA Corporation
model    : GT218 [GeForce 210]
manual_install: True
driver   : nvidia-340 - distro non-free recommended

$ prime-select query
nvidia

$ sudo lshw -c video
  *-display                 
       description: VGA compatible controller
       product: GT218 [GeForce 210]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a2
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:26 memory:fb000000-fbffffff memory:c0000000-cfffffff memory:de000000-dfffffff ioport:ef00(size=128) memory:c0000-dffff

$ nvidia-smi 
Wed Nov 20 12:01:15 2019       
+------------------------------------------------------+                       
| NVIDIA-SMI 340.107    Driver Version: 340.107        |                       
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce 210         Off  | 0000:01:00.0     N/A |                  N/A |
| N/A   50C    P0    N/A /  N/A |    630MiB /  1023MiB |     N/A      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Compute processes:                                               GPU Memory |
|  GPU       PID  Process name                                     Usage      |
|=============================================================================|
|    0            Not Supported                                               |
+-----------------------------------------------------------------------------+

$ lsmod  | grep nvidia
nvidia              10559488  198
drm                   401408  10 nvidia

$ echo $XDG_SESSION_TYPE 
x11

$ gnome-shell --version
GNOME Shell 3.28.4

我的问题:

由于我有控制台访问权限(通常还有图形访问权限),我能做些什么来确定是什么原因造成的?我不想重新安装我的系统及其所有软件,因为图形环境有时可以正常工作,只是在启动后无法预测。

我已经查看journalctl -k并搜索了任何对我来说似乎可疑的错误,但我还没有找到解决方案或任何有用的提示。

欢迎任何想法。谢谢!

编辑:这里有一些更多信息:每次重新启动后,当我登录到虚拟控制台尝试修复这个问题时,在某个看似随机的时间,大约在启动后 5 分钟,屏幕闪烁并带我离开文本控制台并进入登录屏幕(桌面管理器)。看起来好像某些东西已经崩溃并重新启动,但我不知道那可能是什么。这似乎与我所做的任何事情都无关。发生这种情况后,我可以毫无问题地登录。在这一点上,这对我来说比真正的问题更令人讨厌,但仍然有些令人沮丧。我觉得应该有一些方法来调试这些东西。

EDIT2:我在 Xorg 日志中收到以下条目:

[   926.271] (II) systemd-logind: got pause for 13:68
[   926.272] (II) systemd-logind: got pause for 226:0
[   926.272] (II) systemd-logind: got pause for 13:65
[   926.272] (II) systemd-logind: got pause for 13:69
[   926.272] (II) systemd-logind: got pause for 13:67
[   926.272] (II) systemd-logind: got pause for 13:64
[   926.272] (II) systemd-logind: got pause for 13:66

在网上查找这些错误,我发现很多人在登录屏幕上遇到了不确定的问题,这让我相信这不是驱动程序的问题。似乎它systemd-logind与也许有关dbus,但不幸的是我不知道是什么。希望对Linux有更好了解的人可以提供帮助吗?

xorg graphics dbus systemd-logind 18.04
  • 3 个回答
  • 1340 Views
Martin Hope
Nav
Asked: 2019-09-11 07:42:21 +0800 CST

为什么从 ~/.profile 调用 gdbus 输出不起作用?

  • 0

如果我打开一个终端并运行以下脚本,它工作正常。调用中的值gdbus被写入lockScreenTest.txt文件。屏幕锁定时值为 true,屏幕解锁时值为 false。

#!/bin/bash
while true; do 
    echo "$(gdbus call -e -d com.canonical.Unity -o /com/canonical/Unity/Session -m com.canonical.Unity.Session.IsLocked)" >> lockScreenTest.txt
    sleep 2
    echo "called" >> lockScreenTest.txt
done

但是,如果我将此行添加./lockScreenCheck.sh&到~/.profile并重新启动计算机,则输出gdbus不会写入lockScreenTest.txt. 相反,仅写入以下输出:

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called

called  

gdbus为什么从 运行脚本时输出不可用~/.profile?
我正在对此进行调查,因为我编写了一个 Java 程序,该程序需要检查屏幕是否被锁定,并且我正在使用大致以下命令进行操作:

String command = "gdbus call -e -d com.canonical.Unity -o /com/canonical/Unity/Session -m com.canonical.Unity.Session.IsLocked";
p = Runtime.getRuntime().exec(command);
p.waitFor(); 

与 bash 脚本一样,如果我从带有 的终端运行 Java 程序,它也可以正常工作java -jar program.jar,但如果我从 调用它~/.profile,Java 程序会运行,但 gdbus 命令的输出是难以捉摸的。

bash java dbus .profile
  • 1 个回答
  • 209 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve