Articles of systemctl

如何让用户使用journalctl查看用户特定的系统服务日志?

我在Ubuntu 16.04 LTS中运行用户级服务。 例如,我有我的test.service位于〜/ .config / systemd / user / test.service 我能够通过做运行服务 systemctl –user start test.target 但是,当我尝试使用journalctl读取其日志时,出现了以下错误消息: journalctl –user -u test.service Hint: You are currently not seeing messages from other users and the system. Users in the 'systemd-journal' group can see all messages. Pass -q to turn off this notice. No journal files were opened […]

系统服务中释放时间的含义是什么?

我已经在CentOS 7上安装了Puppet Enterprise。我可以看到,有几个Puppet服务无法启动延期。 这是什么意思? Sep 03 20:50:16 l-pm1 systemd[1]: pe-puppetdb.service holdoff time over, scheduling restart. Sep 03 20:50:16 l-pm1 systemd[1]: Starting pe-puppetdb Service…

gunicorn 19.2未能以18.0configuration启动

我有一个dev服务器在nginx后面运行gunicorn / Django。 作为更广泛的服务器环境更新的一部分,我试图将gunicorn从18.0升级到19.2.1,但服务将不再启动。 (服务器正在运行Arch,因此使用systemctl。) gunicorn的configuration是由一个已经不在我们手中的人来完成的,并且不是真的知道gunicorn那么好,我无法修复,甚至找不到这个问题,所以我回到了18.0版本,现在它已经在运行了。 不过,我想最终升级它,并将其configuration成可以工作的形状。 我有一种感觉,目前的configuration是不是最理想的或多余的,但我无法肯定知道:-)。 在环境中没有任何变化(或者是运行在gunicorn的virtualenv),只有gunicorn本身被升级。 Systemctl在systemctl start gunicorn上产生这个错误: ● gunicorn.service – gunicorn daemon (production) Loaded: loaded (/usr/lib/systemd/system/gunicorn.service; enabled) Active: failed (Result: resources) since Tue 2015-02-17 20:55:41 UTC; 8s ago Process: 2837 ExecStop=/bin/kill -s QUIT $MAINPID (code=exited, status=0/SUCCESS) Process: 9608 ExecReload=/bin/kill -s HUP $MAINPID (code=exited, status=0/SUCCESS) Process: 5353 ExecStart=/home/django/gunicorn/run.sh (code=exited, status=0/SUCCESS) Main […]

在CentOS 7上与systemctl和Haproxy发生奇怪的交互

通过systemctl运行haproxy与手动运行haproxy不同 。 手动启动,一切正常。 从systemctl开始,haproxy无法find它所代理的服务,并用503来回答。 这是通过systemctl启动时的输出: > sudo systemctl status -l haproxy.service haproxy.service – HAProxy Load Balancer Loaded: loaded (/usr/lib/systemd/system/haproxy.service; enabled) Active: active (running) since Wed 2014-12-24 08:08:49 EST; 4min 59s ago Main PID: 20307 (haproxy) CGroup: /system.slice/haproxy.service └─20307 /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid Dec 24 08:08:49 localhost.localdomain systemd[1]: Starting HAProxy Load Balancer… Dec 24 08:08:49 […]

重新启动systemctl上的所有特定的单位,而不是for循环?

在这里有人能够启动/停止/重新加载/ … systemctl上通配符或类似的方法指定单位的列表? 我尝试做一些事情,如: systemctl restart openstack-nova-*.services systemctl restart openstack-nova-?.services或systemctl restart openstack-nova-?.services 但是这是一个死路一条,我在systemctl的手册上没有发现任何有用的东西。 我可以使用for循环,但在此之前,我将不得不make一个systemctl -t service –failed ,然后grep列出的单位…有点无聊不是? 所以,如果有人知道是否可以做这样的事情,我会很高兴听到。 如果不是的话,我想我会推荐systemctl开发者名单上的想法,或者如果我有时间的话可以做补丁^^

Systemctl:找出哪些命令适用于服务

如何找出哪些命令适用于systemctl的服务? # systemctl reload nagios.service failed to reload nagios.service: Job type reload is not applicable for unit nagios.service. 使用init.d,你可以不用命令就运行这个脚本,并查看适用命令的使用信息: # /etc/init.d/nagios Usage: /etc/init.d/nagios {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}

我如何预测systemd的关机顺序?

有没有办法让systemd告诉我关掉整个系统的closures服务的粗略顺序? 由于systemd会并行closures,我很欣赏没有办法知道确切的顺序,但是知道系统会对closures顺序施加什么约束仍然是非常有帮助的,最好是在某种forms的可视化中很容易理解。 其动机是,为了开发和debugging服务文件,预先得到这个预测列表会更加方便,而不是必须进行真正的closures,然后再次启动并在每次我想确定时检查日志对服务单元文件的更改或systemdconfiguration的其他某个方面对shutdown命令有什么影响。 我希望有这样的事情 systemctl list-dependencies –before shutdown.service 会做这项工作,但只会发出: shutdown.service

为什么systemctl在CentOS 7上启动redis-server?

我已经在新的CentOS 7盒子上安装了redis,但无法使用systemctl启动它。 它是这样安装的: rpm -i http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm yum install redis 试图像这样启动它似乎默默无闻(没有输出): systemctl start redis-server # also tried redis-server.service 以下是尝试连接时发生的情况: redis-cli Could not connect to Redis at 127.0.0.1:6379: Connection refused not connected> 但手动启动它的作品: [root@redis ~]# redis-server /etc/redis.conf [root@redis ~]# redis-cli 127.0.0.1:6379> 任何人都知道什么是错的,或者如何debugging呢? 更新: /var/log/redis/redis.log输出如下。 顺便说一句,这是一个512MB的RAM VPS。 [1972] 29 Jul 18:52:16.258 # You requested maxclients of 10000 requiring […]

使用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 […]

未能获得D-Bus连接:不允许操作

我正在尝试在使用Docker运行的CentOS镜像上列出服务 systemctl list-units 但我得到这个错误消息: Failed to get D-Bus connection: Operation not permitted 有什么build议可能是什么问题?