Liunx系统报表服务开机自启

目录

本例报表服务开机自启演示linux系统版本为CentOS Linux release 7.9.2009

​编辑设置报表服务开机自启准备工作

配置报表服务开机自启

验证报表服务

设置为开机自启

验证开机自启服务

报表服务常用命令


本例报表服务开机自启演示linux系统版本为CentOS Linux release 7.9.2009

设置报表服务开机自启准备工作

1. 安装成功.net sdk6.0。

2. 下载并解压完成报表程序。

配置报表服务开机自启

1. 创建报表服务文件:reportweb.service

sudo vi /etc/systemd/system/reportweb.service

2. 填写内容如下

[Unit]

Description=ReportWeb .NET Application

After=network.target

[Service]

WorkingDirectory=/Report/HighReportV410/ReportWeb #报表程序ReportWeb路径

#/opt/dotnet/dotnet .net sdk安装路径

ExecStart=/opt/dotnet/dotnet ReportWeb.dll --urls http://*:5000 #报表程序使用端口 Restart=always

RestartSec=10

KillSignal=SIGINT

SyslogIdentifier=reportweb

User=root

Environment=ASPNETCORE_ENVIRONMENT=Production

[Install]

WantedBy=multi-user.target

3. 填写完成后保存退出重新加载 systemd

sudo systemctl daemon-reexec

sudo systemctl daemon-reload

4. 启动服务

sudo systemctl start reportweb.service

验证报表服务

1. 直接控制台验证

直接在控制台输入

curl http://localhost:5000/

得到结果如下:

即报表服务启动成功。

2. 浏览器访问报表服务验证(需要与服务器同一局域网或者服务器存在外网)

直接在浏览器访问报表端口

http://服务器ip地址:5000/

注意关闭防火墙

设置为开机自启

sudo systemctl enable reportweb.service

得到以上反馈即服务开机自启设置成功。

验证开机自启服务

1. 控制台命令验证

在控制台输入:

sudo systemctl is-enabled reportweb.service

得到enabled反馈就是服务开机自启设置成功了。

2. 重启服务器

输入:

sudo reboot

重启完成后浏览器刷新或者输入curl http://localhost:5000/得到上面同样的结果即开机自启服务设置成功。

报表服务常用命令

sudo journalctl -u reportweb.service -f --查看服务日志

sudo systemctl start reportweb.service --启动服务

sudo systemctl stop reportweb.service --停止服务

sudo systemctl restart reportweb.service --重启服务

sudo systemctl status reportweb.service --查看服务状态

sudo systemctl is-enabled reportweb.service --查看是否启用

sudo systemctl enable reportweb.service --设置开机自启

sudo systemctl disable reportweb.service --取消开机自启

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值