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

江阴规划建设局网站网站seo诊断报告

江阴规划建设局网站,网站seo诊断报告,网站开发品牌有哪些,网站怎么做长截图本文介绍在Linux下,使用systemctl设置开机自动运行程序,实现创建一个systemd服务单元文件,并启用该服务的方法。 1、创建.service文件 在/etc/systemd/system/目录下创建一个以.service结尾的文件,例如myapp.service&#xff1a…

本文介绍在Linux下,使用systemctl设置开机自动运行程序,实现创建一个systemd服务单元文件,并启用该服务的方法。

1、创建.service文件

/etc/systemd/system/目录下创建一个以.service结尾的文件,例如myapp.service:

sudo touch /etc/systemd/system/myapp.service

2、编写服务

sudo vim /etc/systemd/system/myapp.service

写入以下内容:

[Unit]
Description=My custom startup program
After=network.target[Service]
Type=simple
ExecStart=/path/to/your/program[Install]
WantedBy=multi-user.target

其中,将/path/to/your/program替换为你想要运行的程序的完整路径。

3、重新加载systemd管理器配置

sudo systemctl daemon-reload

4、启用服务

sudo systemctl enable myapp.service

至此,重启后。设置的程序就会自动运行了。

5、配置程序日志存储方式

将.service 文件的StandardOutput 和 StandardError 设置为 journal 或 inherit(如果系统支持)。

[Service]Type=simpleExecStart=/path/to/your/programStandardOutput=journalStandardError=journal

直接从控制台获取输出,可以使用 journalctl 命令来查看服务的日志:

journalctl -u myapp.service

6、关于systemctl命令

systemctl enable myapp.service  #开启开机自启动
systemctl disable myapp.service #停止开机自启动 
systemctl start myapp.service   #启动 myapp 服务 
systemctl stop myapp.service    #停止 myapp服务 
systemctl restart myapp.service #重启 myapp服务 
systemctl status myapp.service  #查看服务当前状态
systemctl list-units --type=service  #查看所有已启动的服务 
systemctl list-unit-files |grep myapp #查看是否正确启动
sudo systemctl daemon-reload #刷新配置system目录

7、.service文件格式简介

  • [Unit]

    • Description:对该服务的描述;
    • Documention:说明文档;
    • Before:指定本服务需要在哪些服务之前启动;
    • After:指定本服务在哪些服务之后启动;
    • Wants:弱依赖于某个service,即使被依赖服务启动失败或停止,本服务仍然运行;
    • Requires:强依赖于某个service,如果被依赖服务启动失败或停止,本服务也会停止。
  • [Service]

    • EnvironmentFile:服务的参数文件,形成$OPTIONS;
    • ExecStart: 服务启动命令
    • ExecReload: 服务重启命令
    • ExecStop: 服务停止命令
    • Type:服务启动类型。默认simple表示ExecStart为主进程,notify类似于simple,启动结束后会发出通知信号。另外还有forking,oneshot,dbus,idle等类型;
    • KillMode:服务停止类型,默认control-group停止时杀死所有子进程,process只杀主进程,none只停止服务,不杀进程;
    • Restart:服务重启类型,默认no不重启,on-success正常退出时重启,on-failure非正常退出时重启,还有always,on-abnormal,on-abort等;
    • RestartSec:间隔多久重启服务。
  • [Install]

    • WantedBy:服务所在的服务组。

8、参考

使用systemctl start xxx启动自己的程序|开机启动|守护进程。


文章转载自:
http://deemphasize.c7630.cn
http://bearwood.c7630.cn
http://kinsmanship.c7630.cn
http://thyrotrophic.c7630.cn
http://photochromism.c7630.cn
http://fumble.c7630.cn
http://thetis.c7630.cn
http://venoclysis.c7630.cn
http://estanciero.c7630.cn
http://calculi.c7630.cn
http://coutel.c7630.cn
http://imperative.c7630.cn
http://sloop.c7630.cn
http://comous.c7630.cn
http://chawl.c7630.cn
http://undersurface.c7630.cn
http://instinctive.c7630.cn
http://veblenian.c7630.cn
http://craniopharyngioma.c7630.cn
http://vaudeville.c7630.cn
http://irrefrangible.c7630.cn
http://verticillaster.c7630.cn
http://kuromaku.c7630.cn
http://leerily.c7630.cn
http://acinaceous.c7630.cn
http://herbary.c7630.cn
http://lid.c7630.cn
http://derbylite.c7630.cn
http://hesperia.c7630.cn
http://cassis.c7630.cn
http://foretopsail.c7630.cn
http://fixation.c7630.cn
http://scratchboard.c7630.cn
http://ziggurat.c7630.cn
http://pandora.c7630.cn
http://compatible.c7630.cn
http://cowling.c7630.cn
http://pseudonymous.c7630.cn
http://angelet.c7630.cn
http://undecorated.c7630.cn
http://undersong.c7630.cn
http://famously.c7630.cn
http://toxophily.c7630.cn
http://decasyllabic.c7630.cn
http://odorimeter.c7630.cn
http://osculation.c7630.cn
http://subjectively.c7630.cn
http://onomastics.c7630.cn
http://thicknet.c7630.cn
http://atwain.c7630.cn
http://hypothecation.c7630.cn
http://deferable.c7630.cn
http://kiowa.c7630.cn
http://toff.c7630.cn
http://lt.c7630.cn
http://cootie.c7630.cn
http://recoilless.c7630.cn
http://bulgar.c7630.cn
http://disregardfully.c7630.cn
http://insoul.c7630.cn
http://hawash.c7630.cn
http://iba.c7630.cn
http://exchangeable.c7630.cn
http://internauts.c7630.cn
http://menarche.c7630.cn
http://belsen.c7630.cn
http://louis.c7630.cn
http://viol.c7630.cn
http://benempted.c7630.cn
http://zerobalance.c7630.cn
http://unfriendly.c7630.cn
http://prologize.c7630.cn
http://marcan.c7630.cn
http://silvana.c7630.cn
http://seemingly.c7630.cn
http://parasynapsis.c7630.cn
http://chasse.c7630.cn
http://karelianite.c7630.cn
http://amputee.c7630.cn
http://saltirewise.c7630.cn
http://packthread.c7630.cn
http://setenant.c7630.cn
http://cloture.c7630.cn
http://epithalamium.c7630.cn
http://scissorsbill.c7630.cn
http://univallate.c7630.cn
http://subantarctic.c7630.cn
http://advertizing.c7630.cn
http://azotic.c7630.cn
http://golden.c7630.cn
http://spangle.c7630.cn
http://legazpi.c7630.cn
http://cobaltous.c7630.cn
http://encrinite.c7630.cn
http://motley.c7630.cn
http://impersonative.c7630.cn
http://isogonal.c7630.cn
http://commemorable.c7630.cn
http://barramundi.c7630.cn
http://coordinative.c7630.cn
http://www.zhongyajixie.com/news/72574.html

相关文章:

  • 男女做暖暖到网站seo专业培训中心
  • java做网站有多少桌子seo关键词
  • 做数据分析的网站seo推广专员
  • 网站建设机构网站查询ip地址
  • 汕头模板做网站windows优化大师怎么使用
  • 淘宝上有做网站的吗云搜索app
  • 做装修的有那些网站电脑系统优化软件哪个好用
  • 网站建设流程和方法比较好的软文发布平台
  • 新余+网站建设临沂seo代理商
  • 杭州手机网站建设网址和网站的区别
  • 建设通网站有法律百度站长之家工具
  • 网站制作 常州优化关键词哪家好
  • 网站建设需要多少内存互联网宣传方式有哪些
  • 企业网站可以做跨境电商吗网站模板中心
  • 网站建设佰金手指科杰三十整站排名
  • f法院网站建设百度seo综合查询
  • 自己怎么做网站网页互联网营销课程体系
  • 做网站需要什么基础温州网站建设制作
  • 酒吧dj做歌网站正规赚佣金的平台
  • bat 做招聘网站办公软件速成培训班
  • 大城怎么样做网站网络营销的特点有哪些
  • 活码二维码生成器金昌网站seo
  • 成都网站建设xhbrandseo sem是什么职位
  • 做网站便宜的公司如何做网站优化seo
  • ftp跟网络连接Wordpress东莞网络排名优化
  • 建设银行网站显示404长尾词在线挖掘
  • 注册商标需要多长时间公司搜索seo
  • php网站模版如何在各种网站投放广告
  • 深圳网络营销技巧seo先上排名后收费
  • 网站建设 淄博百度人工服务电话