348 Star 3.2K Fork 787

GVPFastTunnel / FastTunnel

 / 详情

请问做成linux(centos7)的服务怎么搞,想做成服务+自启,我试过,一直没搞起来,望指教

已完成
创建于  
2021-04-14 17:45
[Unit]
Description=fastTunnel
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking

ExecStart=/opt/FastTunnel.Client/FastTunnel.Client
ExecStop=/opt/FastTunnel.Client/stop.sh
PrivateTmp=true

[Install]
WantedBy=multi-user.target

systemctl start fastTunnel.service 报异常

[root@localhost FastTunnel.Client]# journalctl -xe
4月 14 17:13:55 localhost.localdomain FastTunnel.Client[4503]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType)
4月 14 17:13:55 localhost.localdomain FastTunnel.Client[4503]: at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
4月 14 17:13:55 localhost.localdomain FastTunnel.Client[4503]: at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
4月 14 17:13:55 localhost.localdomain FastTunnel.Client[4503]: at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
4月 14 17:13:55 localhost.localdomain FastTunnel.Client[4503]: at FastTunnel.Client.Program.Run(IServiceProvider servicesProvider)
4月 14 17:13:55 localhost.localdomain FastTunnel.Client[4503]: at FastTunnel.Client.Program.Main(String[] args)
4月 14 17:13:55 localhost.localdomain systemd[1]: fastTunnel.service: control process exited, code=killed status=6
4月 14 17:13:55 localhost.localdomain systemd[1]: Failed to start fastTunnel.
-- Subject: Unit fastTunnel.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit fastTunnel.service has failed.
-- 
-- The result is failed.
4月 14 17:13:55 localhost.localdomain systemd[1]: Unit fastTunnel.service entered failed state.
4月 14 17:13:55 localhost.localdomain systemd[1]: fastTunnel.service failed.
4月 14 17:13:55 localhost.localdomain polkitd[694]: Unregistered Authentication Agent for unix-process:4496:402885 (system bus name :1.61, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale zh_CN.UTF-8) (disconnected from bus)
4月 14 17:15:20 localhost.localdomain polkitd[694]: Registered Authentication Agent for unix-process:4594:411530 (system bus name :1.62 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale zh_C
4月 14 17:15:20 localhost.localdomain systemd[1]: Starting fastTunnel...
-- Subject: Unit fastTunnel.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit fastTunnel.service has begun starting up.
4月 14 17:15:20 localhost.localdomain FastTunnel.Client[4600]: 2021/04/14 17:15:20.621|DEBUG|===== FastTunnel Client Start =====
4月 14 17:15:21 localhost.localdomain FastTunnel.Client[4600]: 2021/04/14 17:15:21.472|ERROR|Stopped program because of exception Object reference not set to an instance of an object.
4月 14 17:15:21 localhost.localdomain FastTunnel.Client[4600]: Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
4月 14 17:15:21 localhost.localdomain FastTunnel.Client[4600]: at FastTunnel.Client.Program.implementationFactory(IServiceProvider arg)
4月 14 17:15:21 localhost.localdomain FastTunnel.Client[4600]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
4月 14 17:15:21 localhost.localdomain FastTunnel.Client[4600]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
4月 14 17:15:21 localhost.localdomain FastTunnel.Client[4600]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProvider
4月 14 17:15:21 localhost.localdomain FastTunnel.Client[4600]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
4月 14 17:15:21 localhost.localdomain FastTunnel.Client[4600]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
4月 14 17:15:21 localhost.localdomain FastTunnel.Client[4600]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
4月 14 17:15:21 localhost.localdomain FastTunnel.Client[4600]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
4月 14 17:15:21 localhost.localdomain FastTunnel.Client[4600]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
4月 14 17:15:21 localhost.localdomain FastTunnel.Client[4600]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType)
4月 14 17:15:21 localhost.localdomain FastTunnel.Client[4600]: at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
4月 14 17:15:21 localhost.localdomain FastTunnel.Client[4600]: at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
4月 14 17:15:21 localhost.localdomain FastTunnel.Client[4600]: at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
4月 14 17:15:21 localhost.localdomain FastTunnel.Client[4600]: at FastTunnel.Client.Program.Run(IServiceProvider servicesProvider)
4月 14 17:15:21 localhost.localdomain FastTunnel.Client[4600]: at FastTunnel.Client.Program.Main(String[] args)
4月 14 17:15:21 localhost.localdomain systemd[1]: fastTunnel.service: control process exited, code=killed status=6
4月 14 17:15:21 localhost.localdomain systemd[1]: Failed to start fastTunnel.
-- Subject: Unit fastTunnel.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit fastTunnel.service has failed.
-- 
-- The result is failed.
4月 14 17:15:21 localhost.localdomain systemd[1]: Unit fastTunnel.service entered failed state.
4月 14 17:15:21 localhost.localdomain systemd[1]: fastTunnel.service failed.
4月 14 17:15:21 localhost.localdomain polkitd[694]: Unregistered Authentication Agent for unix-process:4594:411530 (system bus name :1.62, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale zh_CN.UTF-8) (disconnected from bus)
4月 14 17:24:01 localhost.localdomain anacron[3815]: Job `cron.daily' started
4月 14 17:24:01 localhost.localdomain run-parts(/etc/cron.daily)[5066]: starting logrotate
4月 14 17:24:01 localhost.localdomain run-parts(/etc/cron.daily)[5071]: finished logrotate
4月 14 17:24:01 localhost.localdomain run-parts(/etc/cron.daily)[5073]: starting man-db.cron
4月 14 17:24:04 localhost.localdomain run-parts(/etc/cron.daily)[15101]: finished man-db.cron
4月 14 17:24:04 localhost.localdomain anacron[3815]: Job `cron.daily' terminated
lines 2289-2349/2349 (END)

评论 (2)

jjcbcjh 创建了任务
jjcbcjh 关联仓库设置为FastTunnel/FastTunnel
展开全部操作日志
Gui.H 任务状态待办的 修改为已完成

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(3)
768739 hgui 1578932418 333264 quliting admin 1578920340
C#
1
https://gitee.com/Hgui/FastTunnel.git
git@gitee.com:Hgui/FastTunnel.git
Hgui
FastTunnel
FastTunnel

搜索帮助