如何在 beaglebone black 中启用服务?

How to enable services in beaglebone black?

[Unit]
Description=Splash screen
DefaultDependencies=no

[Service]
Type=oneshot
ExecStart=/usr/local/bin/psplash

[Install]
WantedBy=basic.target

.service 的作业失败,因为控制进程退出并出现错误代码

我遵循了这个例子,它对我的​​ BBB 很有效:

https://gist.github.com/tstellanova/7323116

这里是 shell 脚本,用于为 python 代码提供服务。 它会在启动时开始执行,

[Unit]
Description= Python First Service
After=multi-user.target

[Service]
Type=simple
ExecStart=/usr/bin/python /home/debian/serv_demo.py
Restart=on-abort

[Install]
WantedBy=multi-user.target