原始地址如下:
http://beaglebone.cameon.net/home/autostarting-services
The easiest way is to just use the systemd service framework, like is already in use by the demo image. To add a new service, just create a file in /lib/systemd/system/myservice.service with content like:[Unit]Description=Reverse SSH ServiceConditionPathExists=|/usr/binAfter=network.target [Service]ExecStart=/usr/bin/wall "Hello world!"Restart=alwaysRestartSec=10StartLimitInterval=0 [Install]WantedBy=multi-user.target And then make a symlink to this file in /etc/systemd/system/multi-user.target.wants/. The service will start automatically on startup. You can also start and stop it manually, and query the status:
systemctl status myservice.service
systemctl start myservice.service
systemctl stop myservice.service
http://beaglebone.cameon.net/home/autostarting-services
The easiest way is to just use the systemd service framework, like is already in use by the demo image. To add a new service, just create a file in /lib/systemd/system/myservice.service with content like:[Unit]Description=Reverse SSH ServiceConditionPathExists=|/usr/binAfter=network.target [Service]ExecStart=/usr/bin/wall "Hello world!"Restart=alwaysRestartSec=10StartLimitInterval=0 [Install]WantedBy=multi-user.target And then make a symlink to this file in /etc/systemd/system/multi-user.target.wants/. The service will start automatically on startup. You can also start and stop it manually, and query the status:
systemctl status myservice.service
systemctl start myservice.service
systemctl stop myservice.service
