首页 > 系统相关 >ubuntu 新建 service

ubuntu 新建 service

时间:2023-08-23 10:56:40浏览次数:32  
标签:service api 新建 0.0 rtgapi Environment systemctl ubuntu

1、

cd  /etc/systemd/system

 

 2、

vim rtgapi.service

 

 

[Unit]
Description=rtgapi

[Service]
WorkingDirectory=/home/rtgweb/api/
ExecStart=/usr/bin/dotnet /home/rtgweb/api/rtgapi.dll
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=douyin and kuaishou
User=root
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=ASPNETCORE_URLS=http://0.0.0.0:8081       

[Install]
WantedBy=multi-user.target

 3、systemctl  服务管理

服务开启:
systemctl start rtgapi.service
状态:
systemctl status rtgapi.service

systemctl restart rtgapi.service

systemctl stop rtgapi.service

查看日志
journalctl -fu rtgapi.service

 


 

标签:service,api,新建,0.0,rtgapi,Environment,systemctl,ubuntu
From: https://www.cnblogs.com/shuihuren/p/17650586.html

相关文章

  • Ubuntu16.04+CUDA8.0+OpenCV3.1+python+caffe+faster-rcnn环境配置
    前言Ubuntu1604注意事项CUDA80安装显卡驱动安装CUDA80编译CUDASampleOpenCV31pythonCaffe安装CaffeMNIST数据集测试faster-rcnn后记前言经过大概两个星期的配置,终于将faster-rcnn安装好了,期间重装了大概十次系统,查阅了无数多文献博客,遇到了无数多坑。本人写这篇文章就是希望读者......
  • ubuntu/linux 好用的截图工具 搜狗输入法自带的截图快捷键,自己觉得不方便的话,修改为
    公司要求使用ubuntu开发,在安装完必要得开发工具之后,按照我在windows平台的习惯,就准备安装一个好用的截图工具了,我比较推荐的是snipaste([https://zh.snipaste.com/download.html)]),同时QQ,微信的自带快捷键也十分好用。以下分别是windowsQQ微信的截图方式,非常好用。好的,不墨......
  • Ubuntu22.04系统下安装配置rime五笔输入法
    1、安装 1.1 sudoaptinstallibus-rime 1.2 sudoaptinstalllibrime-data-wubi2、安装后重启系统,在设置-键盘-输入源 中添加汉语,再选择 中文Rime 3、配置第一步安装好后,默认的输入法是拼音输入法,还需要我们自己设置。打开设置的方法是先把输入法调到“中文(......
  • Ubuntu 20.04编译opencv-3.1.0时报错 error: 'CODEC_FLAG_GLOBAL_HEADER' was not dec
    Ubuntu20.04源码编译安装opencv320报错error:'CODEC_FLAG_GLOBAL_HEADER'wasnotdeclaredinthisscope的解决办法:修改/opt/opencv/opencv-3.2.0/modules/videoio/src/cap_ffmpeg_impl.hpp,顶端添加如下代码:#defineAV_CODEC_FLAG_GLOBAL_HEADER(1<<22)#defineCODEC_F......
  • ubuntu arm仓库
    mkdir-p~/repo.$$&&mv/etc/apt/source.list~/repo.$$cat>/etc/apt/source.list<<EOFdebhttp://mirrors.huaweicloud.com/ubuntu-ports/bionicmainmultiverserestricteduniversedebhttp://mirrors.huaweicloud.com/ubuntu-ports/bionic-back......
  • Ubuntu一键安装Docker
    懒人请直接复制sudoaptupdatesudoaptupgrade-ysudoaptinstalllsb-releaseca-certificatesapt-transport-httpssoftware-properties-common-ycurl-fsSLhttps://download.docker.com/linux/ubuntu/gpg|sudogpg--dearmor-o/usr/share/keyrings/docker-archiv......
  • 20230713 java.util.concurrent.ExecutorService
    介绍java.util.concurrent.ExecutorServicepublicinterfaceExecutorServiceextendsExecutorAPIshutdownshutdownNowisShutdownisTerminatedawaitTerminationsubmitFuture<?>submit(Runnabletask);<T>Future<T>submit(Runna......
  • 20230713 java.util.concurrent.ScheduledExecutorService
    介绍java.util.concurrent.ScheduledExecutorServicepublicinterfaceScheduledExecutorServiceextendsExecutorServiceAPIschedulepublicScheduledFuture<?>schedule(Runnablecommand,longdelay,TimeUnitunit);public<V>ScheduledFuture<......
  • 快速新建一个conda环境
    场景:遇到一个新的服务器,需要快速搭建一个conda环境,以及基本的python包,以正常运行代码搭建miniconda,参考Miniconda软件安装教程(Linux),下载conda以及换源等操作下载python包,尝试用不同源下载,哪个快用哪个,若是遇到需要下载torch-cu11这种特殊情况,换源下载也慢的情况,参考第......
  • ubuntu 修改计算机名字
     vimetc/hostname   vim/etc/hosts   retboot ......