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
    • 最新
    • 标签
主页 / user-165026

oligofren's questions

Martin Hope
oligofren
Asked: 2021-08-15 22:34:22 +0800 CST

我如何知道 systemd 计划何时自动升级我的包?

  • 0

前几天我发现我的 Docker 容器已被杀死,因为 docker 守护程序已在我正在运行的 AWS 机器上自动升级。

journald在相关时间段显示这些消息:

Aug 06 05:56:01 ip-192-168-3-117 systemd[1]: Starting Daily apt download activities...
Aug 06 05:56:11 ip-192-168-3-117 systemd[1]: Started Daily apt download activities.
Aug 06 06:06:39 ip-192-168-3-117 systemd[1]: Starting Daily apt upgrade and clean activities...
Aug 06 06:06:48 ip-192-168-3-117 systemd[1]: Reloading.
Aug 06 06:06:48 ip-192-168-3-117 systemd[1]: Starting Message of the Day...
Aug 06 06:06:48 ip-192-168-3-117 systemd[1]: Reloading.
Aug 06 06:06:49 ip-192-168-3-117 systemd[1]: Reloading.
Aug 06 06:06:49 ip-192-168-3-117 systemd[1]: Stopping Docker Application Container Engine...

我怎么知道这个计划什么时候运行?我查看了其中的各种 cron 作业/etc,我认为/etc/cron.daily/apt-compat它参与其中,因为它最后包含以下内容:

# delay the job execution by a random amount of time
random_sleep

# ensure we don't do this on battery
check_power || exit 0

# run daily job
exec /usr/lib/apt/apt.systemd.daily

但事实证明它永远不会走那么远,因为它实际上只是使用systemd. 我在开始时忽略了这一点cron.daily/apt-compat:

# Systemd systems use a systemd timer unit which is preferable to
# run. We want to randomize the apt update and unattended-upgrade
# runs as much as possible to avoid hitting the mirrors all at the
# same time. The systemd time is better at this than the fixed
# cron.daily time
if [ -d /run/systemd/system ]; then
    exit 0
fi

因此,systemd 以某种方式安排它运行。

该文件 ,/usr/lib/apt/apt.systemd.daily基本上看起来像是负责的脚本,尽管我找不到上面的任何字符串,例如“正在启动 .* 活动”。

所以 systemd 正在安排这个,但是这个存储在哪里?它在哪里被告知运行/usr/lib/apt/apt.systemd.daily?

18.04
  • 1 个回答
  • 468 Views
Martin Hope
oligofren
Asked: 2019-03-06 02:42:49 +0800 CST

如何在函数中使用别名?

  • 5

在我的点文件中,我有一些依赖别名或函数存在的函数才能工作。出于某种原因,我可以让它们引用我创建的其他函数,但不能引用命令的别名。我该如何解决?

例子:

function open-dotfiles-commit(){ 
    xopen https://github.com/fatso83/dotfiles/blob/$1; 
}

如果我有别名xopen( alias xopen=xdg-open),该open-dotfiles-commit命令将失败并显示xopen: cannot find command. 另一方面,如果我用一个名为xopen( function xopen(){ xdg-open; };) 的函数替换别名定义,它就可以工作!

我什至尝试shopt -s expand_aliases在与我定义别名的位置相同的文件中进行设置 - 不成功。别名和函数文件来自我的.bashrc.

bash bashrc alias functions
  • 1 个回答
  • 2694 Views
Martin Hope
oligofren
Asked: 2018-05-02 01:41:48 +0800 CST

无法将语言更改为英语

  • 2

在此处输入图像描述 从上图中可以看出,挪威语选项是不可选择的。我无法选择,也无法重新排列选项,以便除黑色文本选项之外的任何内容都位于顶部。我已通读此线程,并尝试重新安装语言包而不做任何更改。

这是一个全新的 18.04 安装,我选择英语作为安装语言,但它似乎仍然根据我的 IP 所在位置安装了挪威语支持。

编辑:我后来能够将挪威语移到顶部并使其成为默认系统语言,但它并没有影响仍然是英语键盘布局的输入语言。原来这不是从语言设置中设置的,而是从区域和语言面板中设置的......

localization
  • 1 个回答
  • 2100 Views
Martin Hope
oligofren
Asked: 2017-06-16 05:25:04 +0800 CST

键盘快捷键间歇性停止工作

  • 4

编辑:从答案中可以看出,这实际上与待机或休眠无关,而是与我经常在进入待机状态之前关闭应用程序窗口(这触发了错误)有关。

我已经看到很多人在网上的各个地方报告了这个问题,没有任何解决方案,但我想无论如何我都会添加我的:

很多时候,在一段时间后(当它进入待机状态时)返回计算机后,我注意到一些快捷方式已经停止工作。这不仅发生在终端中,也发生在 Chrome 中(Ctrl-L、Ctrl-R、F5 都停止工作)。它也不会影响所有 ctrl 快捷键:例如,Ctrl-C 仍在工作(感谢上帝!)。

有没有办法调试这个?早点尝试xev并没有让我到任何地方,但也许有一些方法可以找出阻止我的按键到达程序的原因?

编辑:我可以看到 Ctrl-R 发生了一些奇怪的事情

有东西在抢键盘快捷键!

从捕获的输出xev

KeyPress event, serial 37, synthetic NO, window 0x5200001,
    root 0xee, subw 0x0, time 24547557, (-130,529), root:(0,633),
    state 0x10, keycode 105 (keysym 0xffe4, Control_R), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

FocusOut event, serial 37, synthetic NO, window 0x5200001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 37, synthetic NO, window 0x5200001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 37, synthetic NO, window 0x0,
    keys:  4294967278 0   0   0   0   0   0   0   0   0   0   0   0   2   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

KeyRelease event, serial 37, synthetic NO, window 0x5200001,
    root 0xee, subw 0x0, time 24548550, (-130,529), root:(0,633),
    state 0x14, keycode 105 (keysym 0xffe4, Control_R), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

将此与 Ctrl-C 进行比较

我们可以很容易地看到这里发生的四个逻辑事件

KeyPress event, serial 37, synthetic NO, window 0x5200001,
    root 0xee, subw 0x0, time 24724066, (572,852), root:(702,956),
    state 0x10, keycode 105 (keysym 0xffe4, Control_R), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 37, synthetic NO, window 0x5200001,
    root 0xee, subw 0x0, time 24724818, (572,852), root:(702,956),
    state 0x14, keycode 54 (keysym 0x63, c), same_screen YES,
    XLookupString gives 1 bytes: (03) ""
    XmbLookupString gives 1 bytes: (03) ""
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x5200001,
    root 0xee, subw 0x0, time 24724966, (572,852), root:(702,956),
    state 0x14, keycode 54 (keysym 0x63, c), same_screen YES,
    XLookupString gives 1 bytes: (03) ""
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x5200001,
    root 0xee, subw 0x0, time 24725339, (572,852), root:(702,956),
    state 0x14, keycode 105 (keysym 0xffe4, Control_R), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
keyboard
  • 1 个回答
  • 1707 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