Welcome to Jetson AGX Orin repository
当製品の日本語版マニュアル資料は、こちらからご取得ください。
14. Managing custom services
Custom Service Management
This course uses creating a new OLED startup service as an example for reference only. The actual factory image already has the OLED service configured to start automatically at boot.
1. Create a new service file
Create a new file named yahboom_oled.service in the user directory.
xxxxxxxxxxtouch yahboom_oled.servicevim yahboom_oled.service
Add the following content: User represents the username (modify according to your actual username); ExecStart represents the command to be executed (modify according to your actual command).
System service file:
x[Unit]Description=yahboom_oled start serviceAfter=multi-user.target[Service]Type=idleUser=jetsonExecStart=/bin/sh -c "python3 /home/jetson/software/oled_yahboom/yahboom_oled.py"WorkingDirectory=/home/jetson[Install]WantedBy=multi-user.target
Then press Esc to exit editing, and type :qw to save the file.
2. Update the service
Copy the newly created yahboom_oled.service service file to the /etc/systemd/system/ directory.
xxxxxxxxxxsudo cp yahboom_oled.service /etc/systemd/system/
Update system service
xxxxxxxxxxsudo systemctl daemon-reload
3. Managing services
Check service status
xxxxxxxxxxsudo systemctl status yahboom_oled.service
Start service
xxxxxxxxxxsudo systemctl start yahboom_oled.service
Restart service
xxxxxxxxxxsudo systemctl restart yahboom_oled.service
Set service to start automatically on boot
xxxxxxxxxxsudo systemctl enable yahboom_oled.service
Stop service
xxxxxxxxxxsudo systemctl stop yahboom_oled.service
Prevent service from starting on boot
sudo systemctl disable yahboom_oled.service