Articles of linux

(Debian)Linux中的重复分区表

磁盘在软件RAIDarrays中失败,我试图replace它。 我已经完成了这一切没有一个困难,但这次我得到一个错误,当试图复制分区表。 我正在使用这个命令: sfdisk -l /dev/sda | sfdisk /dev/sdb 得到这个错误: sfdisk: unrecognized input: 121601 cylinders, 255 heads, 63 sectors/track 阅读sfdisk手册页我不能诚实地看到这个命令是如何工作的,但过去曾多次使用过。 问:如何将确切的分区表复制到第二个磁盘,以便我可以将其用作RAID成员? 我并不喜欢sfdisk,这只是以前的工作。 这里有一些细节,如果有帮助 sfdisk -l / dev / sda Disk /dev/sda: 121601 cylinders, 255 heads, 63 sectors/track Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls […]

正确的postfix smtp限制处理顺序

我在postfixconfiguration文件中有这个smtp限制: smtpd_sender_restrictions = permit_sasl_authenticated, check_policy_service inet:127.0.0.1:10031,permit_mynetworks, warn_if_reject reject_non_fqdn_sender, reject_unauth_pipelining, reject_authenticated_sender_login_mismatch, reject_unknown_sender_domain 据我所知,如果permit_sasl_authenticated说特定的用户被authentication,那么其余的限制不会被检查。 如果我想要确保“permit_sasl_authenticated”和“check_policy_service inet:127.0.0.1:10031”,如果他们都说是的,那么只有这样才能通过邮件否则不会? 实际上我试图设置cluebringer,但得到的问题是说“发件人地址被拒绝”,即使发件人从SASL正确authentication后。 这是我的postconf -n输出: append_dot_mydomain = no biff = no broken_sasl_auth_clients = yes config_directory = /etc/postfix disable_vrfy_command = yes inet_interfaces = 91.91.98.67, localhost mailbox_command = procmail -a "$EXTENSION" mailbox_size_limit = 0 mydestination = mauth.fdomain.co.uk, localhost myhostname = mauth.fdomain.co.uk mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 […]

Linux内存不足,无法控制哪个程序死掉

我们正在进行一项我们知道的工作,有时会过度地挤压内存。 然而,这导致杀死一到两个进程,我们希望成为在这种情况下死亡的最后一个进程。 我们如何告诉linux,请不要杀死pid XXXX和pid YYY,并且首先杀死其他作业,包括那个占用所有CPU的作业(如果有必要的话),因为那个作业(我们正在运行的作业)的生存优先级低于两个其他进程。 基本上我们正在用我们的cassandra数据库运行map / reduce作业,而linux正在决定杀死cassandra而不是杀死map / reduce任务(这是理想的,因为它们内置了恢复function,并且也可以是黑名单任务)。

更改主IP时,IP别名丢失

我的/ etc / network / interfaces: auto eth0 iface eth0 inet static address 192.168.3.75 netmask 255.255.255.0 gateway 192.168.3.0 情况1: 在linux启动后,我设置了一个IP别名: ifconfig eth0:0 192.168.3.111 现在, ifconfig在eth0报告两个IP地址192.168.3.75 ,在eth0:0报告192.168.3.75 当我将主IP更改为另一个networking时: ifconfig eth0 192.168.1.111 alias eth0:0 丢失 ! 情况2: 在linux启动后,我设置了一个IP别名: ifconfig eth0:0 192.168.4.111 现在, ifconfig在eth0报告两个IP地址192.168.3.75 ,在eth0:0报告192.168.3.75 当我更改主IP到另一个networking: ifconfig eth0 192.168.1.111别名eth0:0 保持 ! 我如何正确地更改主IP,所以我所有的别名都不会丢失?

我是否因为这个错误而编译nginx错误

我用了: ./configure –prefix=/usr/local/nginx –with-poll_module 每次我重新启动,我得到这个: service nginx restart nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok nginx: [warn] 2048 worker_connections exceed open file resource limit: 1024 nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful Stopping nginx: [ OK ] grep: unrecognized option '–prefix=/usr/local/nginx' Usage: grep [OPTION]… PATTERN [FILE]… Try `grep –help' for more information. useradd: unrecognized […]

mount.nfs:在Ubuntu机器上安装时被服务器拒绝访问?

我有三台机器 – machineA 10.108.24.132 machineB 10.108.24.133 machineC 10.108.24.134 所有这些机器都安装了Ubuntu 12.04,并且我可以对这三台机器进行root访问。 现在我应该在我的上面的机器中做下面的事情 – Create mount point /opt/exhibitor/conf Mount the directory in all servers. sudo mount <NFS-SERVER>:/opt/exhibitor/conf /opt/exhibitor/conf/ 我已经在上述三台机器中创build了/opt/exhibitor/conf目录。 现在我正试图在所有这三台机器上创build一个安装点。 所以我遵循下面的过程 – 安装NFS支持文件和NFS内核服务器 $ sudo apt-get install nfs-common nfs-kernel-server 创build共享目录 $ mkdir /opt/exhibitor/conf/ 编辑/ etc / exports并添加如下所示的条目: # /etc/exports: the access control list for filesystems which may […]

如何使用程序的名称而不是PID来杀死进程?

我使用nohup在后台启动了我的Python程序,如下所述 – nohup zook.py & 现在我试图杀死这个进程,所以我做了ps命令,如下所述 root@phxdbx1145:/home/david/zook# ps ax | grep zook.py 16352 pts/6 S+ 0:00 grep –color=auto zook.py 但不知何故,每当它的PID发生变化,我不知道为什么。 每当我这样做 – kill -9 16352 它总是说, No Such Process 。 而当我再次执行px命令时,我发现PID自动改变了。 所以我不知道如何杀死这个过程? 有什么办法可以用这个名字杀死进程吗? 我试过了 killall zook.py 但它不适合我,我得到 – zook.py: no process found 任何其他选项? 不知何故每次,它的PID得到改变..所以我不能使用kill -9 pid 更新: – 这是我得到的。 我做了pkill -9 zook.py ,然后我做了ps命令,如下所述,这是不断scooking zook.py? root@dbx1145:/home/david/zook# […]

为什么Ubuntu / Linux / proc / mounts对我说谎?

我有一个坏的硬盘的rootfs – 这可能导致文件系统被挂载只读…然而, /proc/mounts仍然说,它被挂载rw : $ cat /proc/mounts rootfs / rootfs rw 0 0 sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 udev /dev devtmpfs rw,relatime,size=7575440k,nr_inodes=1893860,mode=755 0 0 devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 tmpfs /run tmpfs rw,nosuid,relatime,size=3033888k,mode=755 0 0 /dev/disk/by-uuid/548b00b0-bd98-4017-9e62-5c27b633268b / ext4 ro,noatime,errors=remount- ro,data=ordered 0 0 none /sys/fs/fuse/connections fusectl rw,relatime […]

运行切换到用户的远程shell脚本不会返回到发行本地服务器shell

当我运行这样的脚本时: ssh -t [email protected] '/tmp/somescript.sh' 脚本被定义为: #!/bin/sh mkdir -p /data/workday/cred chown -R myuser:myuser /data su myuser – # <——- NOTICE THIS ! ! ! ! rpm -Uvp –force –nodeps –prefix /data/place /data/RPMs/myrpm.rpm 注意上面的su命令。 如果我注释掉su命令,脚本就会远程运行,然后我的shell提示符返回到我来自的地方(与上面运行ssh命令的服务器相同) 但是,如上所述,保留脚本将导致脚本成功完成,但shell提示符保留在远程服务器上 。 我怎样才能防止呢? 确保rpm命令的颁发者是一个不同于超级用户的用户?

Linux:如何在没有太多硬盘空间的情况下接收来自服务器的警告邮件?

我正在构build一个新的CentOS 6.4服务器。 我想知道是否有一种方式,我可以收到一个警告电子邮件时,使用任何分区超过80%的服务器。 提前致谢。