Yocto Version is warrior. I did a yocto project with a GO/golang user app (https-server) that works just fine on a raspi3. Now I'm trying to autostart it at the yocto image and doesnt't got it working. I know there are plenty outher questions regarding this, but I didnt found something that helped. e.g. I tried to follow all steps in this post Enable systemd services using yocto but it doesn't autostart at the raspi.
These files at the raspi for the service I found:
/lib/systemd/system/https-server.service
/etc/systemd/system/multi-user.target.wants/https-server.service
The application itself is running great if I start it manually, it is at the raspi at /usr/bin/https-server
my build/conf/local.conf:
IMAGE_INSTALL_append = " kernel-image kernel-devicetree sudo apt dnsmasq nano dhcpcd git glibc-utils localedef curl go https-server"
meta-https-server/
├── conf
│ └── layer.conf
└── recipes-https-server
└── https-server
├── files
│ ├── https-server.go
│ ├── https-server.service
│ ├── mytest
│ ├── server.crt
│ ├── server.key
│ └── testvideo.mp4
├── go-sw.inc
└── https-server.bb
https-server.bb
require go-sw.inc
inherit go systemd
#inherit go update-rc.d systemd
SRC_URI += "file://https-server.service"
SRC_URI += "file://https-server.go"
SYSTEMD_PACKAGES = "${PN}"
INITSCRIPT_PACKAGES = "${PN}"
SYSTEMD_SERVICE_${PN} = "https-server.service"
# Path
MY_KEY = "/data/yocto/2020-04-21-poky-warrior/poky-warrior/meta-https-server/recipes-https-server/https-server/files/server.key"
MY_CERT = "/data/yocto/2020-04-21-poky-warrior/poky-warrior/meta-https-server/recipes-https-server/https-server/files/server.crt"
TESTVIDEO = "/data/yocto/2020-04-21-poky-warrior/poky-warrior/meta-https-server/recipes-https-server/https-server/files/testvideo.mp4"
MY_TEST = "/data/yocto/2020-04-21-poky-warrior/poky-warrior/meta-https-server/recipes-https-server/https-server/files/mytest"
# COMPILER
do_compile() {
go build /data/yocto/2020-04-21-poky-warrior/poky-warrior/meta-https-server/recipes-https-server/https-server/files/https-server.go
}
# INSTALL
do_install() {
# install -d to create directories, "${D}/${bindir}" is /usr/bin
# systemd
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/https-server.service ${D}${systemd_unitdir}/system
# HTTPS certificate and key
install -d "${D}/${bindir}"
install -m 0755 "${MY_KEY}" "${D}/${bindir}"
install -m 0755 "${MY_CERT}" "${D}/${bindir}"
install -m 0777 "${TESTVIDEO}" "${D}/${bindir}"
install -m 0777 "${MY_TEST}" "${D}/${bindir}"
# HTTPS Server Software
install -m 0755 "${S}/build/https-server" "${D}/${bindir}"
}
FILES_${PN} += "${bindir}"
FILES_${PN} += "${libexecdir}"
FILES_${PN} += "${systemd_system_unitdir}"
REQUIRED_DISTRO_FEATURES= "systemd"
the service https-server.service
[Unit]
Description=HTTPS Server sw startup script
[Service]
ExecStart=/usr/bin/https-server
[Install]
WantedBy=multi-user.target