报错信息 [root@controller ~]# openstack-service status | grep failed MainPID=0 Id=neutron-server.service
但是通过systemctl show --property MainPID 命令只能获取最左边的父进程ID....怎么样通过这个MainPID获取实际工作的子进程ID呢,ps的 -g选项可以根据PID过程要显示的所有属于指定PID的进程及子进程,比如: $ ps --forest -o pid,cmd -g 1088.../bin/bash # 获取服务的MainPID,$service_name 为服务名称 main_pid="$(systemctl show $service_name --property=MainPID
ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/conf/redis.conf ExecReload=/bin/kill -s HUP $MAINPID...ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target 重载服务 # 重载服务
ExecStart=/usr/local/redis/src/redis-server /usr/local/redis/etc/redis.conf ExecReload=/bin/kill -s HUP $MAINPID...ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target 6.x [Unit]...usr/local/redis-6.2.4/src/redis-server /usr/local/redis-6.2.4/redis.conf ExecReload=/bin/kill -s HUP $MAINPID...ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target Docker安装Redis
sbin/php-fpm --nodaemonize --fpm-config /data/soft/php/etc/php-fpm.conf ExecReload=/bin/kill -USR2 $MAINPID...ExecStart=/data/soft/nginx/sbin/nginx -c /data/soft/nginx/conf/nginx.conf ExecReload=/bin/kill -s HUP $MAINPID...ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target Mysql的systemd...mysqld_safe --defaults-file=/data/soft/mysql/my.cnf --ledir=/data/soft/mysql/bin ExecStop=kill -s -QUIT $MAINPID
local/zabbix/sbin/zabbix_server -c /usr/local/zabbix/etc/zabbix_server.conf ExecStop=/usr/bin/kill $MAINPID...local/zabbix/sbin/zabbix_agentd -c /usr/local/zabbix/etc/zabbix_agentd.conf ExecStop=/usr/bin/kill $MAINPID
bin/redis-server /usr/local/redis/conf/redis.conf --supervised systemd ExecReload=/bin/kill -s HUP $MAINPID...ExecStop=/bin/kill -S QUIT $MAINPID Type=notify User=redis Group=redis RuntimeDirectory=redis RuntimeDirectoryMode
home/ec2-user/root #程序工作目录 ExecStart=/home/ec2-user/root/server #程序启动命令 ExecReload=/bin/kill -s -HUP $MAINPID...ExecStop=/bin/kill -s QUIT $MAINPID KillMode=process Restart=on-failure RestartSec=20s [Install] WantedBy
/tools/redis-5.0.4/src/redis-server /root/tools/redis-5.0.4/redis.conf ExecReload=/bin/kill -s HUP $MAINPID...ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target 重载系统服务 sudo
# 重启间隔时间 RestartSec=3 # 重启当前服务时执行的命令,应该是固定写法 ExecReload=/bin/kill -s HUP $MAINPID...# 停止当前服务时执行的命令,应该是固定写法 ExecStop=/bin/kill -s TERM $MAINPID [Install
Type=forking PIDFile=${DSR}/tomcat.pid ExecStart=${DSR}/bin/startup.sh ExecReload=/bin/kill -s HUP $MAINPID...ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target eof
redis_6379.pid ExecStart=/usr/local/redis/bin/redis-server /etc/redis.conf ExecReload=/bin/kill -s HUP $MAINPID...ExecStop=/bin/kill -s QUIT $MAINPID [Install] WantedBy=multi-user.target systemctl enable redis systemctl
ExecStart=/REDIS_PATH/redis-3.2.0/src/redis-server /usr/local/redis/redis.conf ExecReload=/bin/kill -s HUP $MAINPID...ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target 相关链接
ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf ExecReload=/bin/kill -s HUP $MAINPID...ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target 4、修改文件权限
ExecStartPre=/data/nginx/sbin/nginx -t ExecStart=/data/nginx/sbin/nginx ExecReload=/bin/kill -s HUP $MAINPID...ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target 保存并退出。
ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf ExecReload=/bin/kill -s HUP $MAINPID...ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target 添加完成后再来看下
pid ExecStart=/opt/redis5/bin/redis-server /opt/redis5/conf/redis.conf ExecReload=/bin/kill -s HUP $MAINPID...ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target 重载系统服务:systemctl
领取专属 10元无门槛券
手把手带您无忧上云