dpub33855 2018-01-28 22:17
浏览 75

使用Golang管理Linux守护程序

I need to manage the varnish service through an application in Golang, more specifically I need to have the application change the port, ip, storage method and etc. At first I started by following the official varnish documentation (https://varnish-cache.org/docs/trunk/tutorial/putting_varnish_on_port_80.html), so I did with that the application created the following file in the path: /etc/systemd/system/varnish.service.d/customexec.conf

[Service] 
ExecStart= 
ExecStart=/usr/sbin/varnishd -a :6081 -T
localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret

There was no error, however, the service does not start In the service status it displays the following message:

● varnish.service - Varnish HTTP accelerator    Loaded: loaded
(/lib/systemd/system/varnish.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/varnish.service.d
           └─customexec.conf    Active: inactive (dead) since Dom 2018-01-28 15:10:46 -03; 3h 56min ago
     Docs: https://www.varnish-cache.org/docs/4.1/
           man:varnishd   Process: 970 ExecStart=/usr/sbin/varnishd -a :6081 -T localhost:6082 -f /etc/varnish/default.vcl -S
/etc/varnish/secret (code=exited, status=0/SUCCESS)  Main PID: 970
(code=exited, status=0/SUCCESS)

Is there another way to manage a service across an application?

Thank you all

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 关于#java#的问题,请各位专家解答!
    • ¥15 急matlab编程仿真二阶震荡系统
    • ¥20 TEC-9的数据通路实验
    • ¥15 ue5 .3之前好好的现在只要是激活关卡就会崩溃
    • ¥50 MATLAB实现圆柱体容器内球形颗粒堆积
    • ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
    • ¥20 vitis-ai量化基于pytorch框架下的yolov5模型
    • ¥15 如何实现H5在QQ平台上的二次分享卡片效果?
    • ¥30 求解达问题(有红包)
    • ¥15 请解包一个pak文件