[root@localhost~]# vim /etc/systemd/system/wgcloudAgent.service
[Unit]
Description=auto Start Wgcloud Agent
After=network.target syslog.target
[Service]
Type=forking
ExecStart=/etc/wgcloudAgent.local
[Install]
WantedBy=multi-user.target
[root@localhost~]# vim /etc/wgcloudAgent.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/usr/local/wgcloud-v3.3.5/agent/start.sh
exit 0
[root@localhost~]# chmod +x /etc/wgcloudAgent.local
[root@localhost~]# /etc/wgcloudAgent.local
[root@localhost~]# systemctl daemon-reload
[root@localhost~]# systemctl enable wgcloudAgent
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/wgcloud/wgcloud-v3.4.1/server/start.sh
/wgcloud/agent-linux-amd64-v3.4.1/start.sh
exit 0