golang在linux下面设置开机启动

netaxcess · · 3794 次点击
谢谢你的指点,首先这段go程序肯定没问题。可以单独跑,其次我直接在linux命令行下面输入/usr/local/go/bin/go run /data0/go/src/xiyu/goods_wg.go & 也可以让go执行,但是我把他放到/etc/rc.local里的时候。就无法执行了。
#2
更多评论
$ cat /etc/rc.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. exit 0
#1