当前位置: 首页 > news >正文

建设工作室网站网站运营专员岗位职责

建设工作室网站,网站运营专员岗位职责,拼多多网站建设的目的,已备案网站域名supervisord 使用指南 supervisord的安装 supervisor是一系列python脚本文件,以python package的形式管理,可以用于UNIX类系统的进程管理。 安装supervisor也相当简单,只需要用pip安装即可。 sudo pip install supervisor但是有可能将其安…

supervisord 使用指南

supervisord的安装

supervisor是一系列python脚本文件,以python package的形式管理,可以用于UNIX类系统的进程管理。
安装supervisor也相当简单,只需要用pip安装即可。

sudo pip install supervisor

但是有可能将其安装在了~/.local/lib下,会导致systemd自启动管理软件找不到supervisor这个包。典型的错误为 from supervisor.supervisord import main. ERROR: No MODULE named supervisor
此时卸载supervisor重装,需安装在系统python的dist-packages目录下,比如通过--target指定安装位置,确保supervisor和其他python包在一个目录(常见的如numpy等)

sudo pip install --target=/usr/local/lib/python3.8/dist-packages supervisor

和systemd一起管理自启动

启动链:systemd → supervisord → YOUR_APP

其中两个核心配置文件,/etc/systemd/system/supervisord.service/etc/supervisord/supervisord.conf/etc/supervisord/目录和文件自行创建

  1. supervisord.service为systemd启动系统常驻服务supervisord的配置文件,参考如下:
[Unit]
Description=supervisord - Supervisor process control system for UNIX;
After=network.target[Service]
Type=forking
ExecStart=/usr/local/bin/supervisord -c /etc/supervisord/supervisord.conf  
ExecReload=/usr/local/bin/supervisorctl reload
ExecStop=/usr/local/bin/supervisorctl shutdown[Install]
WantedBy=multi-user.target
  1. supervisord.conf为supervisord启动自定义程序的配置文件,参考如下:
[unix_http_server]
file=/tmp/supervisor.sock                       ; path to your socket file[supervisord]logfile=/home/Alex/shepherd/supervisord/supervisord.log    ; supervisord log file
logfile_maxbytes=50MB                           ; maximum size of logfile before rotation
logfile_backups=10                              ; number of backed up logfiles
loglevel=info                                  ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid                ; pidfile location
nodaemon=false                                  ; run supervisord as a daemon
minfds=1024                                     ; number of startup file descriptors
minprocs=200                                    ; number of process descriptors
user=Alex                                       ; default user
childlogdir=/home/Alex/shepherd/supervisord              ; where child log files will live[inet_http_server]
port = 127.0.0.1:9001[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface[supervisorctl]
serverurl=unix:///tmp/supervisor.sock         ; use a unix:// URL  for a unix socket[program:roscore]
command=/home/Alex/shepherd/supervisord/startup/rosl_roscore start-foreground
autostart=true
stopsignal=TERM
stopasgroup=true
stderr_logfile = /home/Alex/shepherd/supervisord/log/roscore-stderr.log
stdout_logfile = /home/Alex/shepherd/supervisord/log/roscore-stdout.log[program:slam]
command=/home/Alex/shepherd/supervisord/startup/rosl_slam -start-foreground
autostart=true
stopsignal=TERM
stopasgroup=true
stderr_logfile = /home/Alex/shepherd/supervisord/log/slam-stderr.log
stdout_logfile = /home/Alex/shepherd/supervisord/log/slam-stdout.log[program:sensor]
command=/home/Alex/shepherd/supervisord/startup/rosl_sensor -start-foreground
autostart=true
stopsignal=TERM
stopasgroup=true
stderr_logfile = /home/Alex/shepherd/supervisord/log/sensor-stderr.log
stdout_logfile = /home/Alex/shepherd/supervisord/log/sensor-stdout.log
  1. 自定义程序的启动脚本
    以下文件需要 chmod +x 权限

a. startup/rosl_sensor

#!/bin/bashsudo chmod 777 /dev/spidev3.0
source /opt/ros/noetic/setup.bash
cd /home/Alex/shepherd/fays_inside_out_sensor_bringup
source /home/Alex/shepherd/fays_inside_out_sensor_bringup/ROS/devel/setup.bash
export ROS_HOME=/home/Alex/.ros
rosrun vi_driver vi_publisher 61 &
PID=$!
wait "$PID"

在shell脚本中想要免密sudo可以sudo visudo,追加一行:

YOUR_USERNAME ALL=(ALL) NOPASSWD: /bin/chmod

b. startup/rosl_slam

#!/bin/bashsource /opt/ros/noetic/setup.bash
source /home/Alex/shepherd/vinsfusion_ws/devel/setup.bash
export ROS_HOME=/home/Alex/.ros
rosrun vins vins_node /home/Alex/shepherd/vinsfusion_ws/src/VINS-Fusion/config/OV9281_ICM42688_2_2/stereo_imu_config.yaml &
rosrun loop_fusion loop_fusion_node /home/Alex/shepherd/vinsfusion_ws/src/VINS-Fusion/config/OV9281_ICM42688_2_2/stereo_imu_config.yaml &
PID=$!
wait "$PID"

c. startup/rosl_roscore

#!/bin/bashsource /opt/ros/noetic/setup.bash
# source /home/griz/panther_ws/devel/setup.bash
export ROS_HOME=/home/Alex/.ros
roscore
PID=$!
wait "$PID"
http://www.yayakq.cn/news/25498/

相关文章:

  • 网站开发招聘名称云南省建设厅网站发文
  • 杭州模板网站好网站策划书模板范文
  • 宁波制作网站哪个好网站开通宣传怎么写
  • 网站改版 大量旧页面网站备案要营业执照吗
  • 泊头网站制作国外教程 网站
  • 免费网站建设合同书.net网站开发代码
  • 网站建设与管理中专燕郊做网站的公司
  • 网站开发前段和后端泗洪网页定制
  • 网站建设的英文翻译在线制图生成器
  • 自助建站网站的宣传手册上海网站建设多少费用
  • 网站建设服务提供商网站建设公司源码 asp
  • 深圳有哪些网站是做餐饮沙龙的福田区网站建
  • 网站后台如何更改广州外贸营销型网站建设
  • 网站站点建设分为佛山企业网站排名
  • 网站开发公司经营范围服务器搭建网站环境
  • 购物网站建设收费邢台做网站的公司有那个
  • 两学一做网站飘窗企业网站建设参考文献
  • 沈阳网站制作定制策划捕鱼网站建设
  • 云南旅游网站开发公司产品推广活动方案
  • 《php与mysql网站开发全接触》光盘源码.rarwordpress如何开启cdn加速服务
  • 涉密项目单位网站建设流程网站建设验收书
  • 代做设计的网站小红书推广计划
  • 通辽市工程建设网站新专业建设的重点任务
  • 网站网页设计原则中小型企业网站建设与管理考试
  • 购物网站排名2018wordpress授权系统
  • 网站认证金额怎么做分录北滘禅城网站建设
  • 个人网站心得凡科沙发官网
  • 做网站设计师好吗江门手机模板建站
  • 做网站的基本条件娄底市住房和城乡建设局官方网站
  • 官方网站建设意义长沙网站设计认准智优营家