ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
[TOC] ## Type=forking 的使用 当你以 systemctl 的方式启动 bash 脚本时,可以使用此方法 如 <details> <summary>im_server.service</summary> 启动效果 ``` [Unit] Description=login im_server [Service] Type=forking WorkingDirectory=/opt/im_user/im_server/im_server/ ExecStart=/opt/im_user/im_server/im_server/im_common/start all Restart=always RestartSec=5 Environment=LD_LIBRARY_PATH=/opt/im_user/im_server/im_server/im_common/:/opt/im_user/im_server/im_webserver/common [Install] WantedBy=multi-user.target ``` </details> <br/> ``` ├─16463 /bin/bash /opt/im_user/im_server/im_server/im_common/start all ├─16474 /bin/bash ../upmessageserver/upmessageserver_guard ├─16482 ./UpMessageServer ├─16535 sleep 30 ├─16547 /bin/bash ../uporgserver/uporgserver_guard ├─16555 ./UpOrgServer ├─16644 sleep 30 ├─16655 /bin/bash ../uploginserver/uploginserver_guard ├─16668 sleep 30 ├─16677 /bin/bash ../upstatusserver/upstatusserver_guard ├─16685 ./UpStatusServer ├─16738 sleep 30 ├─16747 /bin/bash ../upfileserver/upfileserver_guard ├─16755 ./UpFileServer ├─16808 sleep 30 ├─16817 /bin/bash ../upgroupserver/upgroupserver_guard ├─16825 ./UpGroupServer ├─16827 sleep 30 ├─16840 /bin/bash ../uppushserver/uppushserver_guard ├─16841 sleep 3 ├─16843 /bin/bash ./uppushserver_starter ├─16848 ./UpPushServer └─16849 sleep 1 ```