Created
December 18, 2019 18:45
-
-
Save peeyushsrj/7153a17a3ef6387c80c2f0c103c4137a to your computer and use it in GitHub Desktop.
Start a service bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo nano /lib/systemd/system/sample.service | |
Add in the following text : | |
[Unit] | |
Description=My Sample Service | |
After=multi-user.target | |
[Service] | |
Type=idle | |
ExecStart=/usr/bin/python /home/pi/sample.py | |
[Install] | |
WantedBy=multi-user.target | |
sudo chmod 644 /lib/systemd/system/sample.service | |
sudo systemctl daemon-reload | |
sudo systemctl enable sample.service | |
sudo reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment