Articles of linux

是否有可能使用Docker或Vagrant来configuration物理机器

目前在我的工作中,我们使用buildroot来configurationDebian linux的物理机器。 rootfs.cpio.gz编译一个rootfs.cpio.gz文件,使用PXE提取待configuration的机器,运行一个脚本给我们一些安装时间选项,然后从configuration服务器rsyncs根和启动分区。 这个过程大约需要20到30分钟。 我们偶尔会更新一台机器并运行一个脚本,将其内容rsyncs下载到configuration服务器,供下次configuration机器时使用。 我不喜欢这个过程的是,它很难控制版本,看起来有点过时,并且不被主动维护。 我想知道是否有人已经 – 或者看到一种方法 – 使用Vagrant或Docker来执行类似的function(不一定使用PXE)。 或者,就像使用扳手驱动螺丝?

/ bin / sh:variables和直接命令的区别

想象一下,我有以下bash脚本: #/bin/sh #next line will work correctly, outputting user name and current directory start-stop-daemon –start –exec /bin/su — root -c 'whoami; ls' MYVAR="start-stop-daemon –start –exec /bin/su — root -c 'whoami; ls'" #next line will fail with following error: #ls': -c: line 0: unexpected EOF while looking for matching `'' $MYVAR 问题 – 为什么第二种方法通过variables不起作用? 如何使其工作?

设备上的缓冲区I / O错误(SATA驱动器)

我不断收到这些消息在我的服务器内核日志(这是负责文件操作)。 我想知道有没有人知道这些问题有多严重。 我不能使用smartmontools,因为磁盘是由拥有自己的(非常有限的tw_cli实用程序)的3ware卡处理的。 [2522065.275739] sd 0:0:1:0: [sdg] CDB: [2522065.275741] Read(10): 28 00 2e 90 97 f8 00 00 08 00 [2522065.275750] end_request: I/O error, dev sdg, sector 781228024 [2522065.281091] Buffer I/O error on device sdg, logical block 97653503 [2522065.287157] sd 0:0:1:0: [sdg] Device not ready [2522065.287163] sd 0:0:1:0: [sdg] [2522065.287166] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [2522065.287168] sd […]

如何防止系统日志消息在ssh会话中popup而不影响其他会话?

我有一台机器(RHEL 5.2),它从远程机器接收系统日志消息。 现在它不断从远程机器popup消息在ssh shell,这是令人讨厌的,当我想要做些什么。 消息是这样的: 来自syslogd @的讯息Thu Jul 17 18:05:45 2014 … xxx.xxx.xxx.xxx(数字似乎代表时间):blahblah 我在/etc/syslog.conf文件中find了这一行: kern。* / dev / console 问题是,我不想禁用它,我只想暂时禁用我当前的SSH会话 我已经尝试过'dmesg -n1',但它不起作用

如何在redhat中findmysql二进制文件

我正在使用Redhat发行版。 networkingpipe理员无法访问,所以我无法请求信息。 使用bash,我如何findmysql二进制文件,以便我可以运行sql命令? mysql -u user -p password -bash: mysql: command not found 所以他们没有设置path。

如何使Monit“检查过程”有条件?

我有一个像这样的monit脚本: check process sidekiq_1 with pidfile /tmp/pids/sidekiq_1.pid start program = "/bin/bash -l -c 'bundle exec sidekiq start" as uid jim and gid jim with timeout 250 seconds stop program = "/bin/bash -l -c 'bundle exec sidekiq stop" as uid jim and gid jim with timeout 120 seconds if cpu usage > 25% for 18 cycles […]

Systemd退出执行导致失败的命令的bash脚本,而不是继续

我试图得到一个脚本,推动我的系统login到CoreOS的logentries。 为了弥补这个事实,实例在AWS上分拆时没有互联网连接,我把这个命令放在了一个while循环中。 从命令行运行脚本while循环工作得很好。 但是,当systemd运行它的脚本时,它会立即退出netcat超时,所以它永远不会再有机会尝试。 有没有办法让systemd对退出脚本不那么积极? 系统输出,永远不会去“睡眠netcat” Jul 23 22:26:21 core-01 systemd[1]: Starting Push journal logs to logentries.com… Jul 23 22:26:21 core-01 systemd[1]: Started Push journal logs to logentries.com. Jul 23 22:26:21 core-01 bash[880]: trying netcat Jul 23 22:26:31 core-01 bash[880]: Ncat: Connection timed out. journal2logentries.sh #!/usr/bin/env bash token=logentriestoken while true do echo 'trying netcat' journalctl […]

显示自CentOS上次启动以来磁盘的I / O数量(读取/写入)

是否有可能使用iostat(或其他工具)来获取读取/写入操作的次数“自上次服务器重新启动”? 我的意思是:我需要知道自上次启动以来,服务器进行了多less次读取/写入,而不是实时。 谢谢!

在linux上转发linux日志到fluentd

在一个虚拟机上,我在/etc/rsyslog.d/50-default.conf有这个 *.* @192.168.29.1:42185 # Default rules for rsyslog. 在stream利的虚拟机上,我有这样的: 我在/etc/td-agent/td-agent.conf有这个 <source> type syslog port 42185 tag rsyslog </source> <match rsyslog.**> type copy <store> # for debug (see /var/log/td-agent.log) type stdout </store> <store> type elasticsearch logstash_format true flush_interval 10s # for testing. </store> </match> 但似乎没有任何东西发送到远程机器,因为我在/var/log/td-agent.log查看,我看到 2014-08-08 10:51:10 -0700 [info]: adding source type="syslog" 2014-08-08 10:51:10 -0700 [info]: […]

OpenLDAP给出重复的attributeType错误

我正在设置一个login节点,并使用Ubuntu 14.04上的存储库中的openLDAP,并且遇到了重复的attributeTypes问题。 问题似乎在于“gecos”字段属性。 当我尝试运行slapcat或slapadd或slapindex时,我得到这个输出: $ slapcat 53ecd288 olcAttributeTypes: value #0 olcAttributeTypes: Duplicate attributeType: "1.3.6.1.1.1.1.2" 53ecd288 config error processing cn={3}nis,cn=schema,cn=config: olcAttributeTypes: Duplicate attributeType: "1.3.6.1.1.1.1.2" slapcat: bad configuration file! 而当我grep为1.3.6.1.1.1.1.2我得到 $ cd /etc/ldap/ && grep -r '1.3.6.1.1.1.1.2' * schema/nis.schema:attributetype ( 1.3.6.1.1.1.1.2 NAME 'gecos' schema/nis.ldif:olcAttributeTypes: ( 1.3.6.1.1.1.1.2 NAME 'gecos' DESC 'The GECOS field; th slapd.d/cn=config/cn=schema/cn={3}nis.ldif:olcAttributeTypes: {0}( 1.3.6.1.1.1.1.2 NAME […]