Articles of 系统

systemd&max打开文件与在CentOS 7弹性search

我正在尝试在CentOS 7上设置弹性search的最大打开文件。 我一遍又一遍地阅读如何设置,但它似乎并没有工作。 据我所知: limits.conf是不相关的,因为elasticsearch用户被设置为/ sbin / nologin,我们正在启动系统的守护进程 我需要在systemd单元文件中设置LimitNOFILE=65535 。 所以,我继续做下去,这是我的单元文件,它由elasticsearch puppet模块提供 : [Unit] Description=Starts and stops a single elasticsearch instance on this system Documentation=http://www.elasticsearch.org [Service] Type=forking EnvironmentFile=/etc/sysconfig/elasticsearch-graylog2 User=elasticsearch Group=elasticsearch PIDFile=/var/run/elasticsearch/elasticsearch-graylog2.pid ExecStart=/usr/share/elasticsearch/bin/elasticsearch -d -p /var/run/elasticsearch/elasticsearch-graylog2.pid -Des.default.path.home=${ES_HOME} -Des.default.path.logs=${LOG_DIR} -Des.default.path.data=${DATA_DIR} -Des.default.path.work=${WORK_DIR} -Des.default.path.conf=${CONF_DIR} # See MAX_OPEN_FILES in sysconfig LimitNOFILE=65535 # See MAX_LOCKED_MEMORY in sysconfig, use "infinity" when MAX_LOCKED_MEMORY=unlimited […]

系统脚本不会在启动时运行

我有三个docker容器,我已经创build了systemd脚本在启动时运行。 我已经运行systemctl enable xxxx所有三个服务,我也尝试了systemctl reenable xxxx以及。 我从docker文件创build了脚本。 如果我用service xxx start运行脚本,脚本运行良好。 每当我重新启动,docker服务运行正常,但三个脚本保持加载,但不活动: ● guacd.service – Redis container Loaded: loaded (/etc/systemd/system/guacd.service; enabled; vendor preset: enabled) Active: inactive (dead) 我的脚本/etc/systemd/system/guacd.service : [Unit] Description=Redis container Requires=docker.service After=docker.service [Service] Restart=always ExecStart=/usr/bin/docker start -a guacd ExecStop=/usr/bin/docker stop -t 2 guacd [Install] WantedBy=local.target

如何debugging为什么systemd空转,并没有进行启动过程?

我正在尝试为AWS EC2创build一个PV实例。 模板VM基于使用systemd的CentOS 7。 磁盘布局是两个分区:/ boot(/ dev / xvda1)和LVM2(/ dev / xvda2)。 根文件系统驻留在LVM2上。 当我在VirtualBox上启动虚拟机时,它启动正常,但是当我将它上载到EC2时,它会加载到systemd启动并完成文件系统检查的位置,然后它永远在那里。 所以问题是如何从systemd中榨取更多的debugging输出来找出它正在等待什么呢? 下面是我从控制台用systemd.debug得到的日志(在开始时被截断了一点,因为这里的主体受限于30K个字符: Xen Minimal OS! Booting 'CentOS' root (hd0,0) Filesystem type is xfs, partition type 0x83 kernel /vmlinuz-3.10.0-123.4.4.el7.x86_64 root=UUID=3d5995c8-0aef-4b6d-8eda-d56 cfce8455f ro rd.lvm.lv=vg0/root crashkernel=auto ipv6.disable=1 rootflags=uquot a,gquota quiet systemd.log_level=debug systemd.log_target=console log_buf_len=1 M console=tty0 console=hvc0 selinux=0 initrd /initramfs-3.10.0-123.4.4.el7.x86_64.img ============= Init TPM Front ================ […]

systemd升级冻结“删除/etc/init.d/udev-mtab的任何启动链接”

我正在升级运行最新的Debian的VPS的一个问题,我决定切换到testing分支,以便能够使用OpenSSH 6.7(目前的稳定分支只带来了6.0,它缺less许多密码,对我来说很重要)。 因此,花了大约5个小时试图完成这项工作后,我放弃了,并在此寻求指导,因为没有find有效的解决scheme。 我试图做apt-get install openssh-server但它只是扔我未满足的依赖。 [root:~]# apt-get install openssh-server Reading package lists… Done Building dependency tree Reading state information… Done You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: lsof : Depends: libperl4-corelibs-perl or perl (< 5.12.3-7) but 5.20.1-4 is to be installed openssh-server : Depends: […]

Hyper-V CentOS 7 guest在恢复模式下没有键盘

我正在使用CentOS 7作为Hyper-V 2012 R2上的第二代客户端。 一切运行良好,但我无法控制客人,当我启动到某些systemd目标。 例如,如果我要使用GRUB2来指定… systemd.unit=emergency.target 要么 systemd.unit=rescue.target 机器将启动到这些模式,但我的键盘什么都不做。 从我在网上find的一些线索看来,Hyper-V看起来像USB HID一样提供了键盘/鼠标控制,而相应的内核模块可能不会被加载。 有没有人知道这个问题的解决办法? 我宁愿保持内核/ grub文件原样,并且当我真正需要启动进入这些模式时,通过GRUB2菜单指定我需要的附加模块(如果这是打破这个的话)。 谢谢!

多个Nginx错误日志位置

我试图让Nginxlogin到日志文件和stderr。 这背后的原因是,我希望Nginxlogin到日志文件以及日志。 从我所做的研究和testing中,我可以做到这一点,而不是两个。 到一个日志文件: error_log /var/log/nginx/error.log; 要记者: error_log stderr; 我在做什么: /etc/nginx/sites-available/DOMAIN.COM.conf 正在做这样的事情吗? 如果是这样怎么办?

Google Chrome在启动时使用startx启动时不会加载H264解码器

我试图通过启动谷歌浏览器启动与systemd创build一个Ubuntu 16.04浏览器亭 。 一切都很好,除非我无法在浏览器中播放任何video。 当我login到设备上的用户,并强制启动chrome与startxvideo播放,但如果我closures该会话,并重新启动,video停止工作。 我也尝试运行startx与铬和Firefox与安装适当的编解码器。 同样的行为发生。 当login到用户并运行startx google-chrome , startx chromium或startx firefox ,第一次运行startxvideo将会起作用。 当我closuresXsession时,运行新的startx X会话的任何后续应用程序似乎都无法播放video。 我在启动时运行Ubuntu,没有任何GUI,只是terminal。 有什么我需要运行时启动一个X服务器的编解码器被识别? 谢谢!

systemd-nspawn容器在Linux文件系统副本上出现错误代码1失败

我正在尝试在Linux文件系统的完整副本上使用systemd-nspawn: 我把我的文件系统,我的文件系统,exlcuding / opt: cd / tar -cvpzf /opt/test/rootfs.tar –exclude=/opt/ –one-file-system / 我把它解压到/ opt / test /下: cd /tar/test/ tar -xvf rootfs.tar 当我尝试systemd-nspawn时,出现以下错误: root@testbox:/opt/test# systemd-nspawn -D . Spawning container test on /opt/test. Press ^] three times within 1s to kill container. Container test failed with error code 1. 有什么build议么? 或者有没有办法让我更详细地了解这个错误?

CoreOS:如何在Cloud-config中设置Docker容器的依赖关系?

我有一个基本的cloud-config.yaml在cloud-config.yaml上运行四个容器(直接,没有集群)。 两个容器( nginx-gen和nginx-letsencrypt )从名为nginx的容器中挂载卷。 每个容器启动都被定义为一个systemd单元。 我已经添加了After=和Requires=依赖关系,但是在首次login时,我迎接: CoreOS stable (1185.5.0) Failed Units: 2 letsencrypt.service nginx-gen.service nginx (提供音量的那个)正在运行。 如果之后我执行: sudo systemctl start nginx-gen.service sudo systemctl start letsencrypt.service 他们开始和正确运行,所以我想这个问题是在系统启动依赖。 我没有CoreOS和systemd的经验,所以原因可能是非常基本的(比如在Docker容器实际运行之前获得“完整”状态的单元)。 看着journalctl日志,事实上nginx-gen服务在它有机会从nginx挂载卷之前就失败了: … Jan 02 14:35:47 core-01 systemd[1]: nginx-gen.service: Failed with result 'start-limit-hit'. … Jan 02 14:36:03 core-01 docker[1401]: Status: Downloaded newer image for nginx:latest … 我能做些什么来解决这个问题? 我的cloud-config.yaml : […]

自动安装ATA / SCSI驱动器与systemd

我试图在不使用/etc/fstab 情况下使用systemd和udev自动挂载所有ATA / SCSI驱动器。 这是必要的,因为文件系统需要安装在为其UUID命名的目录上,并且驱动器总是被冷交换到新的驱动器,因此不断修改fstab变得单调乏味。 为了做到这一点,我使用了以下脚本 ,systemd 单元文件和udev规则 ,并根据针对USB驱动器的类似问题的答案进行了改编。 但是,尽pipe该答案适用于USB驱动器,但它不适用于ATA / SCSI驱动器 :该脚本似乎能够成功执行并创build所有必需的目录,但启动完成后,将不会挂载任何内容。 但是,脚本在手动运行时工作 。 /usr/local/bin/automount.sh : #!/bin/bash ACTION=$1 DEVBASE=$2 DEVICE="/dev/${DEVBASE}" SAVE="/root/${DEVBASE}" # See if this drive is already mounted, and if so where MOUNT_POINT=$(/bin/mount | /bin/grep ${DEVICE} | /usr/bin/awk '{ print $3 }') do_mount() { if [[ -n ${MOUNT_POINT} ]] then echo "Warning: ${DEVICE} […]