Articles of systemctl

如何通过systemctl传递参数给systemd-nspawn?

我正在testingsystemd-nspawn并启动基本系统testcont (以前使用debootstrap创build) # systemd-nspawn -bD testcont –network-bridge=br1 要么 # systemctl start [email protected] 在第一种情况下,我可以传递一些参数给systemd-nspawn (特别是我想使用的桥) – 在第二种情况下我怎么能做到这一点? 对于我自己创build的服务,我有相关的/etc/systemd/systemd/<something>.service文件,我可以适应,但在上面的情况下,服务是神奇的,虽然systemd-nspawn@ ,没有configuration文件,我可以find。

超时后启动系统查杀进程

我在centos 7中得到了一个守护进程,我试图通过systemd在启动时进行设置。 守护进程是一个二进制(c源),做一个叉和改变的id /组。 我遇到的麻烦是系统似乎在超时后杀死守护进程。 我不确定它是否认为这个过程没有正确开始,或者它是否试图查看它是否仍然有效。 无论如何这里是状态信息: [root@billing init.d]# systemctl status bx_edge.service bx_edge.service – BillMax Customer Portal Daemon Loaded: loaded (/etc/systemd/system/bx_edge.service; disabled; vendor preset: disabled) Active: failed (Result: timeout) since Thu 2016-09-22 00:02:48 UTC; 48s ago Process: 10611 ExecStop=/bin/pkill edge (code=exited, status=0/SUCCESS) Process: 10606 ExecStart=/usr/local/billmax/bin/edge -i -o (code=exited, status=0/SUCCESS) Main PID: 10609 (code=exited, status=0/SUCCESS) Sep […]

无法在systemd服务脚本中创buildPID文件

我试图让RipRight安装在Debian上,对此,似乎没有任何预先构build的软件包。 我很难得到一个systemd脚本来启动/停止作为守护进程运行的RipRight,因为它不能将PID文件写入/run 。 我经历了通常的configuration/ make / make安装。 我还创build了一个ripright用户/组,并添加ripright到cdrom组。 这是我放在/etc/systemd/system/ripright.service的systemd脚本: [Unit] Description=RipRight [Service] Type=forking PrivateTmp=yes User=ripright Group=ripright RuntimeDirectory=ripright RuntimeDirectoryMode=0750 ExecStart=/usr/local/bin/ripright \ –daemon \ –w32-filenames \ –require-art \ –folder-art folder.png \ –output-file "%B/%D/%C – %N %T.flac" \ "/opt/ripright/data" PIDFile=/var/run/ripright/ripright.pid [Install] WantedBy=multi-user.target 我使用脚本中最近添加的RuntimeDirectory指令来创build一个ripright作为所有者的/run/ripright文件夹。 我运行时会创build这个目录: # systemctl daemon-reload # systemctl start ripright 在另一个窗口中: # ls -lhrt /run … drwxr-x— […]

Redis在OpenSuse 42.1上运行,但是会抛出很多错误,我该如何解决?

使用软件包pipe理器在OpenSuse 42.1上安装Redis 3.2.4。 机器有16GB的内存。 这些步骤是否正在运行。 (我想运行deamon,但没有改变设置。) cp default.conf.example default.conf chown root.redis default.conf systemctl enable redis@default systemctl start redis@default service redis start 获取这些错误: 54778:C 18 Jan 12:38:56.664 # systemd supervision requested, but NOTIFY_SOCKET not found 54778:M 18 Jan 12:38:56.665 # You requested maxclients of 10000 requiring at least 10032 max file descriptors. 54778:M 18 Jan 12:38:56.665 […]

系统服务:发出方法调用失败:单元服务失败

我正在尝试在我的VPS中进行自定义服务。 但是,它不让我去运行它。 它说以下。 我不知道发生了什么事,但是当我在Ubuntu笔记本电脑上运行它时,它正常工作。 可能是什么问题呢? sudo systemctl启动websocket.service Failed to issue method call: Unit websocket.service failed to load: No such file or directory. See system logs and 'systemctl status websocket.service' for details. cat /lib/systemd/system/websocket.service [Unit] Description=php webSocket After=syslog.target network.target [Service] User=root Type=simple ExecStart=/usr/bin/webs.sh TimeoutStopSec=20 KillMode=process Restart=always RestartSec=2 [Install] WantedBy=multi-user.target Alias=websocket.service cat /usr/bin/webs.sh #!/bin/bash ### BEGIN INIT […]

CentOS 7:全新安装Firewalld根本不起作用(致命错误:没有IPv4和IPv6防火墙)

我有以下问题。 我只是做了一个DVD CenOS 7安装。 在我启动到系统后,我通常以root用户身份login。 从那里我试图在我的服务器上configuration防火墙。 由于我对所有这些都比较陌生,所以我只是做了一些关于如何启动和pipe理Firewalld的search,似乎是CentOS 7的预期防火墙软件。我尝试的第一件事就是打字 systemctl status firewalld 作为输出我得到 Warning: iptables not usable, disabling IPv4 firewall. Warning: ip6tables not usable, disabling IPv6 firewall. FATAL ERROR: No IPv4 and IPv6 firewall. ERROR: Raising SystemExit in run_server 我已经尝试重新启动系统,更新它。 我重新安装了iptables和firewalld。 试图用任何一个蒙面或禁用。 这一切都没有奏效,但也许我想念一些东西。 我通常只想设置一个Teamspeak服务器,在Windows下工作的时候,我在防火墙上添加了一个特定的规则。 我想在CentOS 7下做同样的事,主要是为了学习目的,或者熟悉Linux作为服务器。 我会很感激任何帮助。 先谢谢你。

无法启用mysqld服务,但在重新启动服务运行在centos 7上

安装后,我运行systemctl enable mysqld.service 。 那么,输出是: Failed to execute operation: Too many levels of symbolic links 在这个错误之后,我重启我的服务,然后检查mysqld.service的状态。 systemctl status mysqld.service -l 输出是 ● mariadb.service – MariaDB database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) Drop-In: /etc/systemd/system/mariadb.service.d └─migrated-from-my.cnf-settings.conf Active: active (running) since Tue 2017-05-16 13:41:06 UTC; 8min ago Process: 1930 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, […]

systemctl在安装包之后在启动/启用时抛出错误

在努力locking一个新的Centos框我正在build设我正在安装iptables。 我希望能够把这个脚本,所以我可以做到这一点的其他箱子,但我得到一些奇怪的错误,回滚需要重新启动? 用。安装 yum install iptables 这工作正常,但在重新启动之前: [root@ip-10-0-0-132 ~]# systemctl start iptables Failed to issue method call: Unit iptables.service failed to load: No such file or directory. [root@ip-10-0-0-132 ~]# systemctl enable iptables Failed to issue method call: Access denied [root@ip-10-0-0-132 ~]# 之后 [root@ip-10-0-0-132 ~]# systemctl enable iptables ln -s '/usr/lib/systemd/system/iptables.service' '/etc/systemd/system/basic.target.wants/iptables.service' [root@ip-10-0-0-132 ~]# systemctl start […]

service和systemctl有什么区别?

也许这是一个微不足道的问题,但是我不完全清楚。 在我们的一台服务器上,我们有一些后台进程正在运行,这些进程是由service启动的,还有一些启动了systemctl进程,如下所示: $ service nginx start $ systemctl start gunicorn 这两个命令有什么区别? 哪一个是处理后台服务的首选方式? 如何configuration首选命令?

Fedora Core 21上的postgreyconfiguration是非常不同的,没有logging

在从Fedora Core 16升级到Fedora Core 21的过程中,其中一个挑战就是让postfix和Postgrey合作。 经过许多长时间的关注,我仍然没有工作。 在旧的策略中,官方指导你创build你自己的脚本放入/etc/init.d 。 而且,事实上,在FC16上,我做到了! 但是今天,我们有systemctl 。 你可以用yum安装postgrey ,仓库知道它。 它安装正常。 然后你启用systemctl enable postgrey.service ,这也很好。 到现在为止还挺好。 只剩下几件事情要做… 接下来,移动您的白名单文件 – 似乎是相同的格式。 在旧的scheme中,你的postfix main.cf文件中会有这样的一行: … smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_pipelining, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_unauth_destination, check_policy_service inet:127.0.0.1:10023, permit_mynetworks … 在我的/etc/init.d中,我写了一个脚本,其中的以下摘录显示了有趣的部分,并且运行良好: … exec="/usr/sbin/postgrey" prog="postgrey" options="–unix=/var/spool/postfix/postgrey/socket –inet=10023" [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog lockfile=/var/lock/subsys/$prog start() { [ […]