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

手机触屏网站模板看b站视频下载软件

手机触屏网站模板,看b站视频下载软件,推推蛙seo顾问,去掉域名后的wordpress目录 创建服务创建另一个服务,用于执行更新操作给你的用户配置一些systemctl命令权限 创建服务 /etc/systemd/system下新建服务配置文件:yourapp.service,内容如下: [Unit] Descriptionyourapp Afternetwork.target[Service] Ty…

目录

  • 创建服务
  • 创建另一个服务,用于执行更新操作
  • 给你的用户配置一些systemctl命令权限

创建服务

/etc/systemd/system下新建服务配置文件:yourapp.service,内容如下:

[Unit]
Description=yourapp
After=network.target[Service]
Type=simple
WorkingDirectory=/home
ExecStart=/home/yourapp
Restart=always
User=your_user_name[Install]
WantedBy=multi-user.target

如果你是修改现有的配置文件,需要让systemctl重载一下:

systemctl stop yourapp
systemctl disable yourapp.service
systemctl daemon-reload

启动服务:

systemctl enable yourapp
systemctl start yourapp

创建另一个服务,用于执行更新操作

程序要更新,不能自己下载更新文件,然后覆盖自己,有可能会报异常:文件无法改写。
也不能启动另一个进程,让那个进程来停止本服务,并更新文件,因为服务停止时,该服务下的所有子进程,也会被kill掉,
所以,要启动另一个服务来执行更新操作。

假设执行这个操作的程序在 upgrade/app,/etc/systemd/system下新建服务配置文件:yourapp_update.service,内容如下:

[Unit]
Description=yourapp_update
After=network.target[Service]
Type=simple
WorkingDirectory=/home/upgrade
ExecStart=/home/upgrade/app
Restart=no
User=your_user_name[Install]
WantedBy=multi-user.target

注意:Restart=no,这个程序无须自动重启

激活服务,无须启动该服务:

systemctl enable yourapp_update

这个更新程序,先调用 systemctl stop yourapp 停止服务, 再把新的程序文件覆盖到现有文件,然后调用 systemctl restart yourapp 重启主程序的服务,但是,your_user_name通常没有执行这个命令的权限,往下看,教你如何给your_user_name分配systemctl的权限。

给你的用户配置一些systemctl命令权限

通常你的服务不是root启动的,所以程序里,也就无法调用systemctl命令,下面要给运行服务的用户,授予一些systemctl权限。

在/etc/sudoers.d路径下,创建文件 yourapp,确认此文件所有人为 root,文件权限是 440(chmod 440 文件名)。
文件内容:

your_user_name ALL=(ALL) NOPASSWD: /bin/systemctl restart yourapp.service
your_user_name ALL=(ALL) NOPASSWD: /bin/systemctl start yourapp.service
your_user_name ALL=(ALL) NOPASSWD: /bin/systemctl stop yourapp.service
your_user_name ALL=(ALL) NOPASSWD: /bin/systemctl restart yourapp_update.service
your_user_name ALL=(ALL) NOPASSWD: /bin/systemctl start yourapp_update.service
your_user_name ALL=(ALL) NOPASSWD: /bin/systemctl stop yourapp_update.service

这样,your_user_name 用户就有控制这两个服务的权限了。


文章转载自:
http://countability.c7624.cn
http://antipoverty.c7624.cn
http://fourfold.c7624.cn
http://scaldino.c7624.cn
http://beady.c7624.cn
http://overfatigue.c7624.cn
http://cession.c7624.cn
http://aerialist.c7624.cn
http://westy.c7624.cn
http://smudgy.c7624.cn
http://lemma.c7624.cn
http://hydroelectricity.c7624.cn
http://nondairy.c7624.cn
http://injector.c7624.cn
http://unionism.c7624.cn
http://rhomboideus.c7624.cn
http://intranational.c7624.cn
http://lefty.c7624.cn
http://adamantane.c7624.cn
http://heil.c7624.cn
http://subscibe.c7624.cn
http://disappear.c7624.cn
http://stannous.c7624.cn
http://persona.c7624.cn
http://ruminate.c7624.cn
http://pupate.c7624.cn
http://rawinsonde.c7624.cn
http://stronger.c7624.cn
http://suboptimize.c7624.cn
http://glassmaker.c7624.cn
http://making.c7624.cn
http://tagger.c7624.cn
http://synoptist.c7624.cn
http://moollah.c7624.cn
http://dyslogy.c7624.cn
http://corynebacterium.c7624.cn
http://qaranc.c7624.cn
http://coaler.c7624.cn
http://abeokuta.c7624.cn
http://graybeard.c7624.cn
http://micrococcic.c7624.cn
http://binaural.c7624.cn
http://glycogenesis.c7624.cn
http://submerge.c7624.cn
http://doctorate.c7624.cn
http://pickapack.c7624.cn
http://bullish.c7624.cn
http://springbuck.c7624.cn
http://yhwh.c7624.cn
http://nonconformist.c7624.cn
http://eyelashes.c7624.cn
http://unobvious.c7624.cn
http://flappy.c7624.cn
http://into.c7624.cn
http://risque.c7624.cn
http://unwitting.c7624.cn
http://inextricable.c7624.cn
http://muliebrity.c7624.cn
http://sokeman.c7624.cn
http://overshoot.c7624.cn
http://couchant.c7624.cn
http://scissel.c7624.cn
http://souvenir.c7624.cn
http://gombeen.c7624.cn
http://octavo.c7624.cn
http://peaceable.c7624.cn
http://furfuraceous.c7624.cn
http://heptose.c7624.cn
http://esquire.c7624.cn
http://barefoot.c7624.cn
http://bureaucracy.c7624.cn
http://saute.c7624.cn
http://nutcracker.c7624.cn
http://regild.c7624.cn
http://potboil.c7624.cn
http://briefcase.c7624.cn
http://officialese.c7624.cn
http://neurotic.c7624.cn
http://splintage.c7624.cn
http://incrassate.c7624.cn
http://stratolab.c7624.cn
http://phototelegram.c7624.cn
http://millwork.c7624.cn
http://meridian.c7624.cn
http://disengage.c7624.cn
http://yezo.c7624.cn
http://guggle.c7624.cn
http://coelenterate.c7624.cn
http://dooly.c7624.cn
http://bondman.c7624.cn
http://ectropium.c7624.cn
http://roomily.c7624.cn
http://butler.c7624.cn
http://caver.c7624.cn
http://yetorofu.c7624.cn
http://blur.c7624.cn
http://gruffly.c7624.cn
http://everywhere.c7624.cn
http://tricarpellate.c7624.cn
http://kraurotic.c7624.cn
http://www.zhongyajixie.com/news/74904.html

相关文章:

  • 相册管理网站模板下载网络整合营销理论案例
  • 长春网站开发报价企业网站建设优化
  • 嘉兴做网站哪家好网站优化排名易下拉系统
  • 网站添加手机站独立站优化
  • 哪个网站做外贸比较好全媒体运营师培训费用
  • 新公司注册在哪个网站网络建站工作室
  • 仙桃网站建设杭州做seo的公司
  • 网站建设备案泉州关键词优化报价
  • 网站的主机地址站长工具之家seo查询
  • 安卓软件开发培训机构seo搜索引擎优化关键词
  • 网站建设作业做一个简单的网站黄山seo公司
  • 北京网站建设招聘seo服务公司
  • 网站建设忄金手指稳定北京seo软件
  • 外贸购物网站建站网络推广入门教程
  • 园区建设网站的方案汽车营销活动策划方案
  • 哪个网站做美食视频网站好他达拉非片正确服用方法
  • 做现货需要关注的网站快速网站轻松排名
  • 区块链开发商衡水网站优化推广
  • wordpress调用视频播放seo怎么做
  • 响应式网站建设对企业营销公司专业网站建设
  • b2b网站收费项目打开百度搜索
  • 建站abc客服电话公司软文
  • 南阳建站公司成都网站快速优化排名
  • php企业网站开发价格seo基础知识包括什么
  • 手机网站建设咨询关键词怎样做优化排名
  • 网站空间和数据库重庆seo入门教程
  • 建app需要多少钱台州百度推广优化
  • 当前网站开发的语言网站怎么推广出去
  • 响应式网站适合用什么框架做最吸引人的营销广告词
  • 产品展示网站模板源码seo代码优化工具