Articles of systemd

/etc/pam.d/system-session中“-session …”是什么意思?

在红帽7我看到 -session optional pam_systemd.so 在/etc/pam.d/system-session 。 我还看到在LFS文档中提到了-前缀: http : //www.linuxfromscratch.org/blfs/view/7.6-systemd/general/systemd.html 请帮我理解这里的情况是什么意思,而不是简单的session 。

如何确保CoreOS云configuration服务能够下载文件?

我在CoreOS云configuration中定义了一次性服务,但由于无法从Google云端存储(通过wget)下载文件,因此无法正常运行: 4月13日11:09:56 staging-node-ys9y.c.experimentalberlin.internal sh [1132]:正在连接到storage.googleapis.com | 74.125.133.128 |:443 …失败:连接超时。 我应该如何确保服务能够从互联网上下载文件? 我的云configuration #cloud-config coreos: units: – name: bootstrap.service command: start content: | [Unit] Description=Bootstrap instance After=network-online.target Requires=network-online.target [Service] Type=oneshot RemainAfterExit=true ExecStart=/usr/bin/mkdir -p /tmp/kubernetes-staging ExecStart=cd /tmp/kubernetes-staging ExecStart=/bin/sh -c "cd /tmp/kubernetes-staging && wget https://storage.googleapis.com/experimentalberlin/staging.tar.gz && tar xf staging.tar.gz" ExecStart=/tmp/kubernetes-staging/worker/bootstrap.sh [Install] WantedBy=local.target

CentOS 7.2 / ProxyPass本地地址好,localhost和127.0.0.1错误

有一些开发主机,我们正在尝试运行Apache / PHP和Node.js。 对于运行在本地端口上的节点服务,理想的简单ProxyPass应该可以工作,但由于某种原因,我需要提供本地networkingIP,localhost会给出503错误。 $ cat nodeproxy.conf <Directory /public/np1/site> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> <VirtualHost *:80> ServerName np1.local.zaptech.org DocumentRoot /public/np1/site ProxyRequests on # ProxyPass /np1/ http://localhost:1337/ <- doesn't work, 503 error # ProxyPass /np1/ http://127.0.0.1:1337/ <- doesn't work, 503 error ProxyPass /np1/ http://10.10.10.76:1337/ </VirtualHost> $ cat sysd [Unit] Description=Node.js Example Server […]

在debian systemd软件包中找不到systemd-machined

我有一个Docker容器,运行一个非常裸露的debian版本。 有了这个,我必须首先从外部安装systemd。 要做到这一点,我有一个docker容器,运行安装,然后我把它提交到一个图像,然后从该图像运行systemd。 当我撞到容器中时,在文件系统的任何地方都找不到machinectl,机器似乎没有运行。 有没有我需要安装的特定软件包? 或者由于我在一个容器开始的事实,机加工不可用? 我认识到,容器中的容器是皱眉,但这个容器的目的是运行与systemd-machined接口的testing。 重现步骤: docker run –privileged –cidfile=/tmp/cidfile debian:stretch bash -c 'apt-get update && apt-get install -y build-essential git dbus libsystemd-dev libpam-systemd' docker commit `cat /tmp/cidfile` deb-machined-test rm /tmp/cidfile docker run -d –cidfile=/tmp/cidfile –privileged deb-machined-test /bin/systemd –system

systemd:如何获得运行目标

命令systemctl get-default返回user-defined.target 。 然后我使用systemctl isolate multi-user.target切换到multi-user.target 。 我可以看到一堆不应该在user-defined.taret上运行的服务,并且应该在multi-user上运行,这意味着我在multi-user.target 。 但是, systemctl get-default总是返回user-defined.target 。 问题是,没有查看和sorting服务,我怎么知道我使用isolate后在multi-user.target运行?

在Redhat 7上创buildmongo数据库启动init.d脚本时出现Exec格式错误

我已经按照链接添加mongod作为Linux服务。 重新启动服务器后,mongod服务器不会重新启动。 /etc/rc.d/init.d/mongod文件内容: #!/bin/bash # # mongodb Startup script for the mongodb server # # chkconfig: – 64 36 # description: MongoDB Database Server # # processname: mongodb # # Source function library . /etc/rc.d/init.d/functions if [ -f /etc/sysconfig/mongodb ]; then . /etc/sysconfig/mongodb fi prog="mongod" mongod="/usr/bin/mongod" mongodb_user="myUserAdmin" RETVAL=0 start() { echo -n $"Starting $prog: " […]

系统活动(退出)状态mrd6

我已经安装了mrd6(多播路由守护进程),它附带了一个init脚本。 我决定build立一个系统化的服务单位来pipe理相关的服务。 我创build的单元文件是下面描述的单元文件: [Unit] Description=Multicast routing daemon Wants=network-online.target After=network-online.target [Service] ExecStart=/usr/sbin/mrd6 -D PIDFile=/run/mrd6.pid Type=simple Restart=always User=root 但是,当我使用systemd启动服务时,我得到状态Active(退出),这意味着systemd执行单元文件中指定的命令,但不知道进程是否确实在运行。 检查正在运行的进程并不表示该服务已启动。 root@debsrv:/etc/systemd/system# systemctl status mrd6.service ● mrd6.service – Multicast routing daemon Loaded: loaded (/etc/systemd/system/mrd6.service; static) Active: active (exited) since …. 我怎样才能让systemd正确处理这个服务,并能够识别这个进程已经启动并运行?

Postfix只在“systemctl守护进程重新加载”之后启动

今天我升级了Postfix,一切正常,直到我决定让服务器重启,看看是否所有的东西都恢复了。 一切都很好,但systemd似乎“忽略”后缀启动: Oct 7 22:59:25 [REDACTED] systemd[1]: Stopped Postfix Mail Transport Agent. Oct 7 22:59:25 [REDACTED] systemd[1]: Stopping Postfix Mail Transport Agent… Oct 7 22:59:25 [REDACTED] systemd[1]: Starting Postfix Mail Transport Agent… Oct 7 22:59:25 [REDACTED] systemd[1]: Started Postfix Mail Transport Agent. 正如你所看到的,它没有显示Postfix的启动 ,预计会是这样的: postfix: Postfix is running with backwards-compatible default settings postfix: See http://www.postfix.org/COMPATIBILITY_README.html […]

systemd:停止所有卸载的单位

我有一些systemd单位安装和运行。 比方说,我手动卸载foo.service通过 删除.service(和.socket)文件 删除所有的符号链接(例如default.target.wants /) 我可以运行systemctl daemon-reload ,然后我看到: # systemctl status foo.service foo.service Loaded: error (Reason: No such file or directory) Active: active (running) since Mon 2013-07-08 13:50:29 EST; 48s ago Main PID: 1642 (node) 所以systemd知道它没有安装,并且正在运行。 有一些命令,我​​可以用来停止所有运行的服务,不再有单位文件? 我已经考虑过的事情: systemctl isolate <current-target> 这将会阻止当前目标不需要的其他手动启动服务的副作用。 使用systemctl disable而不是手动删除文件 我想,但是这个脚本可以从一个可以访问正在运行的容器的文件系统的主机运行 – 它不能直接调用systemd 。 使用systemctl stop foo.service 这意味着我知道哪些服务已被卸载。 我不想弄清楚(或者记住它),我想要一个可以随时运行的通用命令来停止任何拖延的服务。

如果一个systemd服务到达它的MemoryLimit会发生什么?

systemd重启服务还是系统拒绝让服务分配更多内存?