Articles of systemd

systemd中可预测的networking接口名称

最近版本的Ubuntu和Debian(stretch)带来了新的networking接口命名scheme。 现在,从使用旧样式名称(如“eth0”)的系统进行更新时,我想知道在启动新名称之前。 我该怎么做? 是否有一个神奇的调用“systemd”我可以使用编辑/ etc /networking/接口引导(和随后失去networking连接)?

如何在CentOS 7上正确使用kexec与systemd?

我想用kexec来加速CentOS 7机器的重新启动。 我怎么能以一种很好地集成现有的关机/重启系统目标的方式做到这一点? 什么是适当的(官方)方式来做到这一点?

如何设置systemd服务依赖关系?

在CentOS 7系统启动期间,nginx启动失败,出现以下错误: 2014/08/04 17:27:34 [emerg] 790#0: bind() to abcd:443 failed (99: Cannot assign requested address) 我怀疑这是由于在尝试绑定到通过SSL提供虚拟主机的IP地址之前,networking接口尚未启动。 我的猜测是我需要指定network.service作为nginx.service的要求,但是我根本找不到/ etc / systemd /中的networking服务。 我如何在systemd中configuration服务顺序或依赖关系?

在Docker容器中运行systemd(arch linux)

我试图看看我是否可以在docker容器(在容器中运行arch linux)中运行systemd。 我使用所有function启动docker,并在cgroup中绑定mount: docker run -it –rm –privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro .. 但是,如果我尝试运行systemd二进制文件: Trying to run as user instance, but the system has not been booted with systemd. 试图找出如何正确启动systemd启动的东西。

如何区分RHEL7上的崩溃和重启?

有没有办法确定RHEL7服务器是否通过systemctl(或reboot / shutdown别名)重新启动,或者服务器是否崩溃? 预系统这是相当容易确定的last -x runlevel ,但与RHEL7它不是很清楚。

使用systemctl停止后,服务保持失败状态

我们有一个简单的systemd脚本以服务方式启动MineCraft服务器。 SO是CentOS 7.这里的脚本: [Unit] Description=Minecraft Server After=syslog.target network.target [Service] Type=simple WorkingDirectory=/root/Minecraft ExecStart=/bin/java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui Restart=on-failure [Install] WantedBy=multi-user.target 启动服务工作正常,但停止时,服务保持失败状态。 看到: systemctl status minecraftd.service minecraftd.service – Minecraft Server Loaded: loaded (/usr/lib/systemd/system/minecraftd.service; disabled) Active: active (running) since Mon 2015-06-01 16:00:12 UTC; 18s ago Main PID: 20975 (java) CGroup: /system.slice/minecraftd.service └─20975 /bin/java -Xmx1024M -Xms1024M -jar minecraft_server.jar […]

SSH会话在关机/重启时挂起

我有一台运行Debian和sshd的服务器,如果我需要重新启动服务器,我的SSH会话在客户端挂起,直到TCP超时。 我认为这是因为当sshd被终止时,它并没有明确closures到主机的开放SSH会话。 我应该做什么使sshd首先断开每个人,然后正常终止本身? 到目前为止,我没有看到man sshd_config中与shutsown行为有关的参数。

如何使用systemd-firstboot.service?

我正在制作Debian Jessie的图片。 系统启动时没有/etc/machine-id文件。 这会导致日记本无法启动的问题。 我发现,在systemd回购: # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) […]

systemd正常运行18天后使用4GB RAM

我有一台运行CentOS 7的networking服务器,系统进程在几个星期的正常运行时间之后使用了近4 GB的内存。 内存使用量正在稳步增加,每天大约200MB。 像systemd-logind和dbus-daemon这样的相关进程也会在很大程度上使用大量的CPU。 我的另一个使用“init”而不是systemd的CentOS 6服务器没有这样的资源使用情况。 在下面的例子中,systemd,systemd-logind,systemd-journal和dbus-daemon在正常的web服务中没有运行其他进程时,使用四核CPU的总计10.7%,而systemd占用了19%的系统的16GB的RAM。 这是不正常的行为,经过四处搜寻,我还没有发现任何其他人与这个问题。 什么可能导致这个资源被盗用? 任何build议,将不胜感激。 空闲期间从顶部输出(Web服务除外): top – 08:51:31 up 16 days, 13:43, 2 users, load average: 1.84, 1.39, 1.07 Tasks: 297 total, 2 running, 295 sleeping, 0 stopped, 0 zombie %Cpu(s): 5.6 us, 3.6 sy, 0.0 ni, 90.6 id, 0.1 wa, 0.0 hi, 0.1 si, 0.0 st KiB […]

你如何使用systemd的journalctl模式

我试图在journalctl上使用journalctl的模式匹配。 举个例子,我有很多标签为sshd的消息: $ journalctl -t sshd | wc -l 987 但如果我尝试使用模式匹配来find它们: $ journalctl -t 'ssh*' — No Entries — $ journalctl -t 'ssh.*' — No Entries — journalctl手册页说模式应该工作,但我无法find任何有关如何在systemd中使用/定义模式。 $ man journalctl …. -t, –identifier=SYSLOG_IDENTIFIER|PATTERN Show messages for the specified syslog identifier SYSLOG_IDENTIFIER, or for any of the messages with a "SYSLOG_IDENTIFIER" matched by PATTERN. 我正在运行ArchLinux: […]