systemd

VMware修改默认开机方式

笑着哭i 提交于 2019-12-06 04:33:26
1 1.首先删除已经存在的符号链接 2 ---------------------------------------------------------------------------------- 3 rm /etc/systemd/system/default.target 4 ---------------------------------------------------------------------------------- 5 2.默认级别转换为3(文本模式) 6 ---------------------------------------------------------------------------------- 7 ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target 8 ---------------------------------------------------------------------------------- 9 或者默认级别转换为5(图形模式) 10 -------------------------------------------------------------------------------

关于图形界面下Ubuntu的max file open 值

五迷三道 提交于 2019-12-06 03:46:14
正常在Linux下,对打开的文件描述符的数量限制设置有两个地方: sudo sysctl -a | grep file-max 是全局最多可打开文件描述符设置 sudo ulimit -n 是单进程最多可打开的文件描述符设置 全局的修改比较容易,只需要在 /etc/sysctl.conf 中添加 fs.file-max 并指定值即可,如 fs.file-max = 6553500 . 单进程就比较坑了,我当前用的是 Ubuntu 18.04 ,若仅是Server版本Ubuntu或是用SSH登陆的情况下,只需在 /etc/security/limits.conf 添加如下: * soft nofile 1024000 * hard nofile 1024000 # 16.04下用 * 会无效,需要指定用户如: root soft nofile 1024000 root hard nofile 1024000 不过种方式在图形界面下,这并不起效, 除非是 SSH 登录来的. 根据 systemd-system.conf 的 manpage 说明,你只需在 /etc/systemd/system.conf 或 /etc/systemd/user.conf 中设置 DefaultLimitNOFILE= 的值,或在 /etc/systemd/system.conf.d/ 或 etc

Linux添加systemd服务,使用systemctl start xxx启动服务

夙愿已清 提交于 2019-12-06 02:46:24
文章目录 Linux使用systemctl启动服务 systemctl 新增服务 第一步:进入/usr/lib/systemd/system文件夹 第二步:创建service启动文件 第三步:添加tomcat.service文件的启动权限 第四步:测试 Linux使用systemctl启动服务 Linux版本:Centos 7.4 参考 systemctl 新增服务 第一步:进入/usr/lib/systemd/system文件夹 cd /usr/lib/systemd/system [root@VM_46_94_centos ~]# cd /usr/lib/systemd/system 第二步:创建service启动文件 以本机tomcat为例,/usr/lib/systemd/system下创建tomcat.service文件 [root@VM_46_94_centos system]# vi tomcat.service 内容如下: [Unit] Description=tomcatapi After=network.target [Service] Type=forking ExecStart=/usr/local/apache-tomcat-8.5.29/bin/startup.sh ExecReload= ExecStop=/usr/local/apache

二进制安装K8S集群

≡放荡痞女 提交于 2019-12-06 02:40:33
centos linux7.5 cat > /etc/hosts << EOF 192.168.199.221 master 192.168.199.222 node1 192.168.199.223 node2 EOF 1、关闭防火墙、关闭selinux、关闭swapoff -a systemctl stop firewalld selinux=disabled swapoff -a 2、安装docker 1)常用方法 a、配置yum源 阿里镜像源 yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo Docker官方镜像源 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo b、安装docker 显示docker-ce所有可安装版本: yum list docker-ce --showduplicates | sort -r 安装指定docker版本 yum install docker-ce-18.06.1.ce-3.el7 -y 设置镜像存储目录 找到大点的挂载的目录进行存储 # 修改docker配置 vi /lib

Linux Systemd管理的12种服务单元

牧云@^-^@ 提交于 2019-12-06 02:32:26
在Linux中,systemd是排名第1的守护进程,它管理着很多服务单元(service unit),运行下面这个命令就能查询得到: # systemd --type help 显示的结果是12种业务单元: service,服务 一个或多个守护进程共同协作,向系统用户提供的一种功能,其名称后通常是.service,如firewalld.service提供的是防火墙服务,其功能包括规则的添加、修改、查询、删除,及使用netfilter来进行数据包过滤等等。这一类业务通常访问量较大,业务频繁。 而守护进程则是在后台运行的程序,一般跟着系统的关停而关停,且多以d为其名称最后一个字母,如firewalld。 systemctl --type=service socket,套接字 它负责一个进程与另一个进程的通信,即IPC - inter-process communication。进程A创建了一个套接字,等着别的进程来通信;进程B去连接那个套接字时,systemd会启动一个守护进程,将套接字提供给进程B。启动时,会有意将套接字的启动过程加以延时。通常套接字的访问不会太频繁。 target, 以.target为后缀的配置文件,负责将一组相关的服务单元组合在一起,以提供某个特定的运行环境。如multi-user.target是一个字符界面的窗口,graphical

Docker as a builder, can't install systemd header files

流过昼夜 提交于 2019-12-06 01:57:12
I'm trying to update a Docker image based on the official CentOS7 image. It is used as a builder for Node.js projects. I need to add the systemd-devel package for compiling some dependencies, but this fails with the following error: fakesystemd-1-17.el7.centos.noarch has installed conflicts systemd: fakesystemd-1-17.el7.centos.noarch Thanks fakesystemd is a special package in the CentOS Docker image that satisfies the dependency to Systemd without actually installing Systemd (after all, you don't usually need an init system within a container). yum info fakesystemd tells a bit more: Minimal

pactl called from systemd service always reports “pa_context_connect() failed connection refused”

邮差的信 提交于 2019-12-06 01:14:15
I've setup a systemd service file to perform some pactl operations at system startup for a test process. While the commands work fine when performed from a terminal I always get "pa_context_connect() failed connection refused" when running the same script from the systemd service by starting the service. I'm also using the 'User=' directive in the service file to ensure that the auto-login user matches the user used to run the service commands. I've read that this is somehow related to the pulseaudio session not being valid in the environmentless context of the systemd service but I haven't

k8s 集群安装(自用)

早过忘川 提交于 2019-12-05 23:52:38
k8s 集群安装 1)初始化: 每台机器上均需要执行 yum install -y conntrack ntpdate ntp ipvsadm ipset jq iptables curl sysstat libseccomp wget vim net-tools git # 关闭防火墙 安装,清空 iptables systemctl stop firwalld && systemctl disable firewalld yum -y install iptables-services && systemctl start iptables && systemctl enable ipstables && iptables -F && service iptables save # 关闭虚拟内存 swapoff -a && sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab # 关闭 Selinux setenforce 0 && sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config # 调整内核参数,对于k8s cat > k8s.conf << EOF net.bridge.bridge-nf-call-iptables=1 net.bridge.bridge-nf

How to configure ExecStart for Gunicorn without WSGI?

时光总嘲笑我的痴心妄想 提交于 2019-12-05 22:46:42
Systemd and Gunicorn require a wsgi file of some sort as the last arg to ExecStart : http://docs.gunicorn.org/en/latest/deploy.html?highlight=ExecStart#systemd With Django, this was in the main module as wsgi.py : ExecStart=/home/admin/django/bin/gunicorn --config /home/admin/src/gunicorn.py --bind unix:/tmp/api.sock myapp.wsgi But this file obviously doesn't exist when using Sanic and uvloop (I believe the new protocol is called ASGI). I tried substituting it for app.py which unsurprisingly didn't work: ExecStart=/home/admin/sanic/bin/gunicorn --config /home/admin/src/gunicorn.py --bind unix:

caddy.service start request repeated too quickly

99封情书 提交于 2019-12-05 22:32:16
问题 I'm using systemd to start a caddy webserver on an ubuntu 16.04 machine. Whenever I run sudo service caddy start and service caddy status , I get this error: ● caddy.service - Caddy webserver Loaded: loaded (/etc/systemd/system/caddy.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Mon 2016-08-29 05:03:02 EDT; 4s ago Docs: https://caddyserver.com/ Process: 1135 ExecStart=/usr/local/bin/caddy -agree -email me@example -pidfile=/var/run/caddy/caddy.pid (code