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-39501

Nate Lockwood's questions

Martin Hope
Nate Lockwood
Asked: 2015-07-18 10:38:41 +0800 CST

如何在没有用户输入的情况下通过脚本停止系统?

  • 0

我的系统无头运行,在通电时启动,并在启动结束时通过/etc/init中的.conf文件自动启动一些软件。这将启动启动软件的脚本。该脚本会一直等到最后一个应用程序退出(其他应用程序已经退出),然后尝试停止计算机以便它可以安全地关机。

我无法停止工作。如果计算机没有正确关闭,它可能会在下次供电时挂起,因为它显然会永远等待响应。

我尝试编辑/etc/sudoers以允许/sbin/halt不需要密码,尝试对包含命令/sbin/halt的脚本执行相同操作,但没有任何效果;最后一个应用程序运行、退出,然后什么也没有发生。

如何设计一个脚本来自动停止机器?

/etc/init 配置文件:

description "Copies fireimager executeables to the ram disk and executes them."
author "Robert Lockwood"

start on net-device-up
stop on shutdown

script
echo "[`date`] Fireimager initializing Started" >> /var/log/fireimager.log
exec /home/programmer/bin/init/inittest

end script

/home/programmer/bin/init/inittest(片段)

#!/bin/bash
# this script is extecuted by root when the interfaces become active.
# when the last application shuts down the computer is commanded to shut down.

# start the micro-server 
su -c "/home/programmer/bin/startServer &" user-name password -

# start fireimager controller 
su -c "/home/programmer/bin/startController" user-name password -
# following appears in the log
echo "[`date '+%a %b %2d %T.%3N %Z %Y'`] Starting poweroff" >> /var/log/fireimager.log

# when the controller shuts down, then poweroff FAILS
su -c "sudo /home/programer/bin/halt" user-name password -

~/bin/暂停脚本

#!/bin/bash         
# This should halt the computer

/sbin/halt
14.04
  • 1 个回答
  • 155 Views
Martin Hope
Nate Lockwood
Asked: 2015-06-21 14:23:08 +0800 CST

如何在 xfce4 LXTerminal 中控制光标?

  • 0

我刚刚在 14.04 服务器上安装了 xfce4 轻量级桌面,但是当使用箭头键控制光标时,控制台和 LXTerminal 无法正常工作。当我按下箭头键时,键码的表示似乎被输出到控制台,而不是被执行。操作系统刚刚安装,在之前的 14.04.x 安装(使用轻量级 gnome)中,控制台和终端都不是这样工作的。

Byobu Terminal 中的箭头键也不起作用。

如何强制终端(和控制台)识别导航键?

编辑 原因是在启动时 shell 是 sh(破折号),大约是 bash 大小的十分之一。

尚未解决的问题是如何将系统 shell 设置为 bash,我应该这样做吗?

xfce4-terminal
  • 1 个回答
  • 279 Views
Martin Hope
Nate Lockwood
Asked: 2015-05-08 14:51:51 +0800 CST

是什么导致我的 /etc .conf 文件在启动时突然失败

  • 2

我需要在 14.04 服务器上启动时启动一些应用程序。我有一个 conf 文件,/etc/init/fireimager.conf它执行一个启动其他一些脚本的脚本,已经对其进行了测试,并且它在三月份工作。我一直在编写代码并在今天启用配置文件的情况下启动,但它不再有效:它退出并出现错误 2。我怀疑某些更新/升级已经改变了一些东西。

我希望脚本在引导几乎完成时启动。我是一个LINUX新手。

fireimager.conf(未创建日志条目):

description "Copies fireimager executeables to the ram disk and executes them."
author "Robert Lockwood"

#start on filesystem or runLevel [2345]
start on net-device-added INTERFACE=eth0
stop on shutdown

script
echo "[`date`] Fireimager initializing Started" >> /var/log/fireimager.log
exec /home/programmer/bin/init/inittest

end script
14.04
  • 1 个回答
  • 63 Views
Martin Hope
Nate Lockwood
Asked: 2015-05-06 08:46:17 +0800 CST

删除 Thunderbird 后删除 .thunderbird 是否安全?

  • 1

我正在运行带有 ~16 GB SSD 的 14.04 服务器,但空间不足。我能够清理并获得一些可用空间,但 Thunderbird 在我的主目录中使用了 1.7 GB 的.thunderbird. 我已经卸载了 Thunderbird,因为它不是必需的,并运行了各种apt-get命令来清理但目录仍然存在。删除安全.thunderbird吗?

14.04
  • 3 个回答
  • 1117 Views
Martin Hope
Nate Lockwood
Asked: 2015-04-23 14:31:48 +0800 CST

如何修复 apt-get 损坏的更新 wireshark

  • 3

几个月前更新后,Wireshark 不会更新。我学会了取消检查但今天忘记了。更新程序已下载所有更新。当我尝试更新时收到以下错误消息。当我尝试使用 apt-get remove 和 apt-get purge 来摆脱 Wireshark 时,我可能犯了一个错误。

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  libwireshark-data
The following NEW packages will be installed:
  libwireshark-data
0 upgraded, 1 newly installed, 0 to remove and 24 not upgraded.
1 not fully installed or removed.
Need to get 0 B/848 kB of archives.
After this operation, 5,292 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 233363 files and directories currently installed.)
Preparing to unpack .../libwireshark-data_1.99.6+git20150422121542~afb70bba-0ubuntu1~trusty1~ppa0_all.deb ...
Unpacking libwireshark-data (1.99.6+git20150422121542~afb70bba-0ubuntu1~trusty1~ppa0) ...
dpkg: error processing archive /var/cache/apt/archives/libwireshark-data_1.99.6+git20150422121542~afb70bba-0ubuntu1~trusty1~ppa0_all.deb (--unpack):
 trying to overwrite '/usr/share/wireshark/dtds/pocsettings.dtd', which is also in package wireshark-common 1.99.0+git20140730111853~82bb8008-0ubuntu1~trusty1~ppa0
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/libwireshark-data_1.99.6+git20150422121542~afb70bba-0ubuntu1~trusty1~ppa0_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
programmer@fireimager:~$ sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of libwireshark0:amd64:
 libwireshark0:amd64 depends on libwireshark-data (>= 1.99.6+git20150422121542~afb70bba-0ubuntu1~trusty1~ppa0); however:
  Package libwireshark-data is not installed.

dpkg: error processing package libwireshark0:amd64 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libwireshark0:amd64

这也失败了。

apt-get -f install

如何修复 apt-get 数据库?

编辑

根据 Terrance 的评论,我再次搜索并发现:

sudo dpkg --remove --force-remove-reinstreq wireshark
sudo dpkg --remove -force --force-remove-reinstreqgrep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* wireshark

我得到了运行的第一个命令,但第二个命令似乎格式不正确。

在/usr/share/wireshark我找到这些文件和目录(partial是空的)。

libwireshark-data_1.99.6+git20150422121542~afb70bba-0ubuntu1~trusty1~ppa0_all.deb  
libwireshark-data_1.99.6+git20150424075214~b284de81-0ubuntu1~trusty1~ppa0_all.deb  
lock  
partial

/usr/share/wireshark有几个目录和文件。

没有 Wireshark 我也能过得很好。

编辑

apt-cache policy libwireshark-data

libwireshark-data:
  Installed: 1.99.6+git20150430165916~3bf0d14a-0ubuntu1~trusty1~ppa0
  Candidate: 1.99.6+git20150430165916~3bf0d14a-0ubuntu1~trusty1~ppa0
  Version table:
 *** 1.99.6+git20150430165916~3bf0d14a-0ubuntu1~trusty1~ppa0 0
    500 http://ppa.launchpad.net/dreibh/ppa/ubuntu/ trusty/main amd64 Packages
    100 /var/lib/dpkg/status
 1.10.6-1 0
    500 http://apt-cache policy wireshark-common/ubuntu/ trusty/universe amd64 Packages

和

apt-cache policy wireshark-common

wireshark-common:
  Installed: 1.99.6+git20150430165916~3bf0d14a-0ubuntu1~trusty1~ppa0
  Candidate: 1.99.6+git20150430165916~3bf0d14a-0ubuntu1~trusty1~ppa0
  Version table:
 *** 1.99.6+git20150430165916~3bf0d14a-0ubuntu1~trusty1~ppa0 0
    500 http://ppa.launchpad.net/dreibh/ppa/ubuntu/ trusty/main amd64 Packages
    100 /var/lib/dpkg/status
 1.10.6-1 0
    500 http://us.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
14.04
  • 3 个回答
  • 3751 Views
Martin Hope
Nate Lockwood
Asked: 2014-12-11 10:41:38 +0800 CST

如何解锁用户、日期和时间等系统工具

  • 0

我正在使用带有 Gnome 的 Ubuntu Server 14.04,突然我无法解锁系统设置,例如用户和时间和日期:解锁图标变灰,即使我是管理员和以 sudo 开头的终端命令也能正常工作从 Ubuntu 软件中心安装应用程序。

我对系统所做的最后更改是安装 ssh 客户端和服务器,但我不知道问题是否在此之前开始。

gnome
  • 1 个回答
  • 1745 Views
Martin Hope
Nate Lockwood
Asked: 2014-08-09 07:53:49 +0800 CST

如何与 Gnome 共享 14.04 服务器中的文件夹

  • 2

我正在使用新安装的 Ubuntu Server 14.04 64 位。在安装过程中,我选择了 Samba 服务器选项,我相信它正在运行。我的意图是 OS X 机器将能够共享辅助内部磁盘中的顶级文件夹(可能还有一些其他文件夹)。我可以从我的 mac ping 服务器。我安装了一个最小的 Gnome GUI,并根据需要添加功能。

在我的 12.04 机器上,我只需右键单击一个文件夹并共享它。在服务器上,右键单击不会显示任何与共享有关的信息,因此我可能需要安装一些东西或编辑一些文件。

如何在文件夹上启用共享?

[编辑] 我无法检测到 Samba 实际上正在运行!

networking
  • 1 个回答
  • 21426 Views
Martin Hope
Nate Lockwood
Asked: 2014-06-28 11:07:16 +0800 CST

12.04 桌面和服务器双启动 - 安装顺序是什么?

  • 0

几周后,我将拥有一台未安装操作系统的新计算机。我想将其设置为双启动,默认情况下使用服务器,启动时选择桌面作为选项。我想让这两个操作系统的安装尽可能简单。

我应该先安装哪个,服务器还是桌面?

我需要双启动,因为我需要在这台机器上进行应用程序开发,该机器具有我需要的所有硬件,但需要在无头环境中进行部署测试。

我计划使用 12.04 LTS,因为我有一个尚未在更高版本的内核上测试的供应商驱动程序。

我是 LINUX 的新手

12.04
  • 1 个回答
  • 47 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